Skip to content

Commit 9a47188

Browse files
author
雪染
committed
Merge branch 'dev_3.2.1' into 'master'
Dev 3.2.1 See merge request oceanbase/ob-deploy!456
2 parents 6345b15 + 44d1205 commit 9a47188

File tree

43 files changed

+138
-97
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+138
-97
lines changed

_cmd.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,7 @@ def _do_command(self, obd):
918918
obd.set_options(self.opts)
919919
res = obd.deploy_cluster(self.cmds[0])
920920
self.background_telemetry_task(obd)
921-
if res and const.COMP_OB_STANDALONE not in obd.deploy.deploy_config.components:
921+
if res and COMMAND_ENV.get(const.INTERACTIVE_INSTALL, '0') == '0':
922922
obd.stdio.print(FormatText.success('Please execute ` obd cluster start %s ` to start' % self.cmds[0]))
923923
return res
924924
else:

_errno.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ class InitDirFailedErrorMessage(object):
291291
SUG_ULIMIT = OBDErrorSuggestionTemplate('Please execute `echo -e "* soft {name} {value}\\n* hard {name} {value}" >> /etc/security/limits.d/{name}.conf` as root in {ip}. if it dosen\'t work, please check whether UsePAM is yes in /etc/ssh/sshd_config.')
292292
SUG_CONNECT_EXCEPT = OBDErrorSuggestionTemplate('Connection exception or unsupported OS. Please retry or contact us.')
293293
SUG_UNSUPPORT_OS = OBDErrorSuggestionTemplate('It may be an unsupported OS, please contact us for assistance')
294+
SUG_CHANGE_SERVER = OBDErrorSuggestionTemplate('Please change the server.')
294295
SUG_OBSERVER_SYS_MEM_TOO_LARGE = OBDErrorSuggestionTemplate('`system_memory` should be less than {factor} * memory_limit/memory_limit_percentage.', fix_eval=[FixEval(FixEval.DEL, 'system_memory')])
295296
SUG_OBSERVER_NOT_ENOUGH_MEMORY_ALAILABLE = OBDErrorSuggestionTemplate('Please execute `echo 1 > /proc/sys/vm/drop_caches` as root in {ip} to release cached.')
296297
SUG_OBSERVER_REDUCE_MEM = OBDErrorSuggestionTemplate('Please reduce the `memory_limit` or `memory_limit_percentage`', fix_eval=[FixEval(FixEval.DEL, 'memory_limit'), FixEval(FixEval.DEL, 'system_memory'), FixEval(FixEval.DEL, 'memory_limit_percentage')])
@@ -309,7 +310,7 @@ class InitDirFailedErrorMessage(object):
309310
SUG_OCP_EXPRESS_EDIT_ADMIN_PASSWD = OBDErrorSuggestionTemplate('Please edit the `admin_passwd`, must be 8 to 32 characters in length, and must contain at least two digits, two uppercase letters, two lowercase letters, and two of the following special characters:~!@#%^&*_-+=|(){{}}[]:;,.?/)', fix_eval=[FixEval(FixEval.DEL, 'admin_passwd')], auto_fix=True)
310311
SUG_RESTART_OR_RELOAD = OBDErrorSuggestionTemplate('Please restart or reload the cluster manually')
311312
SUG_OCP_SERVER_JDBC_URL_CONFIG_ERROR = OBDErrorSuggestionTemplate('Please ensure that the `jdbc_url` in the `config.yaml` configuration file is set correctly to establish a successful connection with your database')
312-
SUG_OCP_SERVER_SUDO_NOPASSWD = OBDErrorSuggestionTemplate('Please execute `bash -c \'echo "{user} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers`\' as root in {ip}.')
313+
SUG_OCP_SERVER_SUDO_NOPASSWD = OBDErrorSuggestionTemplate('Please execute `bash -c \'echo "{user} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers\'` as root in {ip}.')
313314
SUG_OCP_SERVER_INSTALL_JAVA_WITH_VERSION = OBDErrorSuggestionTemplate('Please install java with version {version}. If java is already installed, please set `java_bin` to the expected java binary path')
314315
SUG_OCP_SERVER_REDUCE_MEM = OBDErrorSuggestionTemplate('Please reduce the `memory_size`', fix_eval=[FixEval(FixEval.DEL, 'memory_size')])
315316
SUG_OCP_SERVER_REDUCE_DISK = OBDErrorSuggestionTemplate('Please reduce the `logging_file_total_size_cap`', fix_eval=[FixEval(FixEval.DEL, 'logging_file_total_size_cap')])

const.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@
5252
COMP_OBDIAG = "obdiag"
5353
COMP_JRE = 'openjdk-jre'
5454

55+
TPCC_PATH = "/usr/ob-benchmarksql/OB-BenchmarkSQL-5.0.jar"
56+
TPCH_PATH = "/usr/tpc-h-tools/tpc-h-tools/bin/dbgen"
57+
5558
# ocp
5659
COMP_OCP_EXPRESS = 'ocp-express'
5760
COMP_OCP_SERVER = 'ocp-server'
@@ -128,3 +131,6 @@
128131
TENANT_BACKUP = 'backup'
129132
TENANT_RESTORE = 'restore'
130133

134+
#standalone
135+
INTERACTIVE_INSTALL = 'INTERACTIVE_INSTALL'
136+

core.py

Lines changed: 45 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
from _optimize import OptimizeManager
4646
from _environ import ENV_REPO_INSTALL_MODE, ENV_BASE_DIR
4747
from _types import Capacity
48-
from const import COMP_OCEANBASE_DIAGNOSTIC_TOOL, COMP_OBCLIENT, PKG_RPM_FILE, TEST_TOOLS, COMPS_OB, COMPS_ODP, PKG_REPO_FILE, TOOL_TPCC, TOOL_TPCH, TOOL_SYSBENCH, COMP_OB_STANDALONE
48+
from const import COMP_OCEANBASE_DIAGNOSTIC_TOOL, COMP_OBCLIENT, PKG_RPM_FILE, TEST_TOOLS, COMPS_OB, COMPS_ODP, PKG_REPO_FILE, TOOL_TPCC, TOOL_TPCH, TOOL_SYSBENCH, COMP_OB_STANDALONE, TPCC_PATH, TPCH_PATH, COMP_JRE
4949
from ssh import LocalClient
5050

5151

@@ -3921,11 +3921,17 @@ def sysbench(self, name, opts):
39213921
self._call_stdio('print', '%s %s is stopped' % (server, repository.name))
39223922
return False
39233923

3924-
if not self.install_tool(TOOL_SYSBENCH):
3925-
return False
3924+
sysbench_bin = getattr(opts, 'sysbench_bin', 'sysbench')
3925+
sysbench_cmd = f"{sysbench_bin} --help"
3926+
if not LocalClient.execute_command(sysbench_cmd):
3927+
if not self.install_tool(TOOL_SYSBENCH):
3928+
return False
39263929

3927-
if not self.install_tool(COMP_OBCLIENT):
3928-
return False
3930+
obclient_bin = getattr(opts, 'obclient_bin', 'obclient')
3931+
obclient_cmd = f"{obclient_bin} --help"
3932+
if not LocalClient.execute_command(obclient_cmd):
3933+
if not self.install_tool(COMP_OBCLIENT):
3934+
return False
39293935

39303936
ob_repository = None
39313937
repository = None
@@ -4050,11 +4056,20 @@ def tpch(self, name, opts):
40504056
self._call_stdio('print', '%s %s is stopped' % (server, repository.name))
40514057
return False
40524058

4053-
if not self.install_tool(TOOL_TPCH):
4054-
return False
4059+
dbgen_bin = getattr(opts, 'dbgen_bin')
4060+
if not dbgen_bin:
4061+
dbgen_bin = TPCH_PATH
4062+
dbgen_cmd = f"{dbgen_bin} -h"
4063+
result = LocalClient.execute_command(dbgen_cmd)
4064+
if result.code > 1:
4065+
if not self.install_tool(TOOL_TPCH):
4066+
return False
40554067

4056-
if not self.install_tool(COMP_OBCLIENT):
4057-
return False
4068+
obclient_bin = getattr(opts, 'obclient_bin', 'obclient')
4069+
obclient_cmd = f"{obclient_bin} --help"
4070+
if not LocalClient.execute_command(obclient_cmd):
4071+
if not self.install_tool(COMP_OBCLIENT):
4072+
return False
40584073

40594074
repository = repositories[0]
40604075
namespace = self.get_namespace(repository.name)
@@ -4281,11 +4296,25 @@ def tpcc(self, name, opts):
42814296
self._call_stdio('print', '%s %s is stopped' % (server, repository.name))
42824297
return False
42834298

4284-
if not self.install_tool(TOOL_TPCC):
4285-
return False
4299+
java_bin = getattr(opts, 'java_bin', 'java')
4300+
java_cmd = f"{java_bin} -version"
4301+
if not LocalClient.execute_command(java_cmd):
4302+
if not self.install_tool(COMP_JRE):
4303+
return False
42864304

4287-
if not self.install_tool(COMP_OBCLIENT):
4288-
return False
4305+
bmsql_dir = getattr(opts, 'bmsql_dir')
4306+
if not bmsql_dir:
4307+
bmsql_dir = TPCC_PATH
4308+
if not os.path.exists(bmsql_dir):
4309+
if not self.install_tool(TOOL_TPCC):
4310+
return False
4311+
4312+
4313+
obclient_bin = getattr(opts, 'obclient_bin', 'obclient')
4314+
obclient_cmd = f"{obclient_bin} --help"
4315+
if not LocalClient.execute_command(obclient_cmd):
4316+
if not self.install_tool(COMP_OBCLIENT):
4317+
return False
42894318

42904319
ob_repository = None
42914320
repository = None
@@ -5584,7 +5613,7 @@ def init_cluster_env(self, name):
55845613
return False
55855614
return True
55865615

5587-
def register_license(self, name):
5616+
def load_license(self, name):
55885617
self._call_stdio('verbose', 'Get Deploy by name')
55895618
deploy = self.deploy_manager.get_deploy_config(name)
55905619
self.set_deploy(deploy)
@@ -5662,8 +5691,8 @@ def get_ob_repo_by_normal_check_for_use_obshell(self, name, deploy):
56625691

56635692
for repository in repositories:
56645693
if repository.name in const.COMPS_OB:
5665-
if Version('4.2.0.0') <= repository.version <= Version('4.2.5.0'):
5666-
self._call_stdio('error', 'Oceanbase must be higher than version 4.2.5.0 .')
5694+
if Version('4.2.0.0') <= repository.version <= Version('4.2.1.8'):
5695+
self._call_stdio('error', 'Oceanbase must be higher than version 4.2.1.8 .')
56675696
return None
56685697
elif Version('4.3.0.0') <= repository.version <= Version('4.3.3.0'):
56695698
self._call_stdio('error', 'Oceanbase must be higher than version 4.3.3.0 .')

init.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,15 @@ fi
8686
for DIR in workflows plugins config_parser; do
8787
if [ ! -e ${OBD_HOME}/${DIR}/oceanbase-ce ]; then
8888
ln -s ${OBD_HOME}/${DIR}/oceanbase ${OBD_HOME}/${DIR}/oceanbase-ce
89+
fi
90+
if [ ! -e ${OBD_HOME}/${DIR}/oceanbase-ce-libs ]; then
91+
ln -s ${OBD_HOME}/${DIR}/oceanbase-libs ${OBD_HOME}/${DIR}/oceanbase-ce-libs
92+
fi
93+
if [ ! -e ${OBD_HOME}/${DIR}/oceanbase-standalone-utils ]; then
94+
ln -s ${OBD_HOME}/${DIR}/oceanbase-ce-utils ${OBD_HOME}/${DIR}/oceanbase-standalone-utils
95+
fi
96+
if [ ! -e ${OBD_HOME}/${DIR}/oceanbase-standalone-libs ]; then
97+
ln -s ${OBD_HOME}/${DIR}/oceanbase-libs ${OBD_HOME}/${DIR}/oceanbase-standalone-libs
8998
fi
9099
if [ ! -e ${OBD_HOME}/${DIR}/oceanbase-standalone ]; then
91100
ln -s ${OBD_HOME}/${DIR}/oceanbase ${OBD_HOME}/${DIR}/oceanbase-standalone

plugins/obproxy/3.1.0/display.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,15 @@ def display(plugin_context, cursor, display_encrypt_password='******', *args, **
6363
with_observer = True
6464
info_dict['user'] = user
6565
info_dict['password'] = password
66-
cmd = 'obclient -h%s -P%s -u%s %s-Doceanbase -A \n' % (server.ip, server_config['listen_port'], user, '-p%s ' % ((passwd_format(password) if password else '') if not display_encrypt_password else display_encrypt_password))
66+
cmd = 'obclient -h%s -P%s -u%s %s-Doceanbase -A \n' % (server.ip, server_config['listen_port'], user, '-p%s ' % ((passwd_format(password) if password else '') if not display_encrypt_password else passwd_format(display_encrypt_password)))
6767
break
6868

6969
if (with_observer and server_config.get('obproxy_sys_password', '')) or not with_observer:
7070
user = 'root@proxysys'
7171
password = server_config.get('obproxy_sys_password', '')
7272
info_dict['user'] = user
7373
info_dict['password'] = password
74-
cmd = 'obclient -h%s -P%s -u%s %s-Doceanbase -A \n' % (server.ip, server_config['listen_port'], user, '-p%s ' % ((passwd_format(password) if password else '') if not display_encrypt_password else display_encrypt_password))
74+
cmd = 'obclient -h%s -P%s -u%s %s-Doceanbase -A \n' % (server.ip, server_config['listen_port'], user, '-p%s ' % ((passwd_format(password) if password else '') if not display_encrypt_password else passwd_format(display_encrypt_password)))
7575

7676
stdio.print(cmd)
7777
info_dict['cmd'] = cmd

plugins/obproxy/4.3.0/display.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,15 @@ def display(plugin_context, cursor, display_encrypt_password='******', *args, **
6565
with_observer = True
6666
info_dict['user'] = user
6767
info_dict['password'] = password
68-
cmd = 'obclient -h%s -P%s -u%s %s-Doceanbase -A \n' % (server.ip, server_config['listen_port'], user, '-p%s ' % ((passwd_format(password) if password else '') if not display_encrypt_password else display_encrypt_password))
68+
cmd = 'obclient -h%s -P%s -u%s %s-Doceanbase -A \n' % (server.ip, server_config['listen_port'], user, '-p%s ' % ((passwd_format(password) if password else '') if not display_encrypt_password else passwd_format(display_encrypt_password)))
6969
break
7070

7171
if (with_observer and server_config.get('obproxy_sys_password', '')) or not with_observer:
7272
user = 'root@proxysys'
7373
password = server_config.get('obproxy_sys_password', '')
7474
info_dict['user'] = user
7575
info_dict['password'] = password
76-
cmd = 'obclient -h%s -P%s -u%s %s-Doceanbase -A \n' % (server.ip, server_config['listen_port'], user, '-p%s ' % ((passwd_format(password) if password else '') if not display_encrypt_password else display_encrypt_password))
76+
cmd = 'obclient -h%s -P%s -u%s %s-Doceanbase -A \n' % (server.ip, server_config['listen_port'], user, '-p%s ' % ((passwd_format(password) if password else '') if not display_encrypt_password else passwd_format(display_encrypt_password)))
7777

7878
stdio.print(cmd)
7979
info_dict['cmd'] = cmd

plugins/oceanbase-ce-libs/3.1.0/file_map.yaml

Lines changed: 0 additions & 3 deletions
This file was deleted.

plugins/oceanbase-ce/3.1.0/file_map.yaml

Lines changed: 0 additions & 12 deletions
This file was deleted.

plugins/oceanbase-ce/3.1.0/requirement.yaml

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)