Skip to content

Commit e69168f

Browse files
authored
V2.6.2 (#192)
* V2.6.2
1 parent 4740aa7 commit e69168f

File tree

42 files changed

+264
-193
lines changed

Some content is hidden

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

42 files changed

+264
-193
lines changed

plugins/grafana/7.5.17/start_check.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
def get_port_socket_inode(client, port):
3232
port = hex(port)[2:].zfill(4).upper()
33-
cmd = "bash -c 'cat /proc/net/{udp*,tcp*}' | awk -F' ' '{print $2,$10}' | grep '00000000:%s' | awk -F' ' '{print $2}' | uniq" % port
33+
cmd = "bash -c 'cat /proc/net/{udp*,tcp*}' | awk -F' ' '{if($4==\"0A\") print $2,$4,$10}' | grep ':%s' | awk -F' ' '{print $3}' | uniq" % port
3434
res = client.execute_command(cmd)
3535
if not res or not res.stdout.strip():
3636
return False

plugins/ob-configserver/1.0.0/start_check.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
def get_port_socket_inode(client, port):
3838
port = hex(port)[2:].zfill(4).upper()
39-
cmd = "bash -c 'cat /proc/net/tcp*' | awk -F' ' '{print $2,$10}' | grep ':%s' | awk -F' ' '{print $2}' | uniq" % port
39+
cmd = "bash -c 'cat /proc/net/tcp*' | awk -F' ' '{if($4==\"0A\") print $2,$4,$10}' | grep ':%s' | awk -F' ' '{print $3}' | uniq" % port
4040
res = client.execute_command(cmd)
4141
if not res or not res.stdout.strip():
4242
return False

plugins/obagent/0.1/start_check.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
def get_port_socket_inode(client, port):
3232
port = hex(port)[2:].zfill(4).upper()
33-
cmd = "bash -c 'cat /proc/net/{tcp*,udp*}' | awk -F' ' '{print $2,$10}' | grep '00000000:%s' | awk -F' ' '{print $2}' | uniq" % port
33+
cmd = "bash -c 'cat /proc/net/{tcp*,udp*}' | awk -F' ' '{if($4==\"0A\") print $2,$4,$10}' | grep ':%s' | awk -F' ' '{print $3}' | uniq" % port
3434
res = client.execute_command(cmd)
3535
if not res or not res.stdout.strip():
3636
return False

plugins/obagent/1.1.1/start_check.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
def get_port_socket_inode(client, port):
3232
port = hex(port)[2:].zfill(4).upper()
33-
cmd = "bash -c 'cat /proc/net/{tcp*,udp*}' | awk -F' ' '{print $2,$10}' | grep '00000000:%s' | awk -F' ' '{print $2}' | uniq" % port
33+
cmd = "bash -c 'cat /proc/net/{tcp*,udp*}' | awk -F' ' '{if($4==\"0A\") print $2,$4,$10}' | grep ':%s' | awk -F' ' '{print $3}' | uniq" % port
3434
res = client.execute_command(cmd)
3535
if not res or not res.stdout.strip():
3636
return False

plugins/obagent/1.3.0/start_check.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def get_missing_required_parameters(parameters):
5454

5555
def get_port_socket_inode(client, port):
5656
port = hex(port)[2:].zfill(4).upper()
57-
cmd = "bash -c 'cat /proc/net/{tcp*,udp*}' | awk -F' ' '{print $2,$10}' | grep '00000000:%s' | awk -F' ' '{print $2}' | uniq" % port
57+
cmd = "bash -c 'cat /proc/net/{tcp*,udp*}' | awk -F' ' '{if($4==\"0A\") print $2,$4,$10}' | grep ':%s' | awk -F' ' '{print $3}' | uniq" % port
5858
res = client.execute_command(cmd)
5959
if not res or not res.stdout.strip():
6060
return False

plugins/oblogproxy/2.0.0/start_check.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
def get_port_socket_inode(client, port):
3333
port = hex(port)[2:].zfill(4).upper()
34-
cmd = "bash -c 'cat /proc/net/{tcp*,udp*}' | awk -F' ' '{print $2,$10}' | grep '00000000:%s' | awk -F' ' '{print $2}' | uniq" % port
34+
cmd = "bash -c 'cat /proc/net/{tcp*,udp*}' | awk -F' ' '{if($4==\"0A\") print $2,$4,$10}' | grep ':%s' | awk -F' ' '{print $3}' | uniq" % port
3535
res = client.execute_command(cmd)
3636
if not res or not res.stdout.strip():
3737
return False

plugins/obproxy/3.1.0/start_check.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
def get_port_socket_inode(client, port):
3232
port = hex(port)[2:].zfill(4).upper()
33-
cmd = "bash -c 'cat /proc/net/{tcp*,udp*}' | awk -F' ' '{print $2,$10}' | grep '00000000:%s' | awk -F' ' '{print $2}' | uniq" % port
33+
cmd = "bash -c 'cat /proc/net/{tcp*,udp*}' | awk -F' ' '{if($4==\"0A\") print $2,$4,$10}' | grep ':%s' | awk -F' ' '{print $3}' | uniq" % port
3434
res = client.execute_command(cmd)
3535
if not res or not res.stdout.strip():
3636
return False

plugins/oceanbase-diagnostic-tool/1.5/generate_config.py

+5-23
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,11 @@ def parse_empty(value,default=''):
4949
def get_obdiag_config():
5050
# obproxy
5151
obproxy_depend = None
52-
obproxy_ip = None
53-
obproxy_port = None
5452
for comp in ['obproxy', 'obproxy-ce']:
5553
if comp in deploy_config.components:
5654
obproxy_depend = comp
5755
obproxy_servers = deploy_config.components[comp].servers
5856
obproxy_server = obproxy_servers[0]
59-
obproxy_ip = obproxy_server.ip
60-
obproxy_port = deploy_config.components[comp].get_server_conf(obproxy_servers[0]).get("listen_port")
6157
break
6258
obproxy_nodes = []
6359
if obproxy_depend:
@@ -93,25 +89,11 @@ def get_obdiag_config():
9389
observer_nodes.append(nodeItem)
9490
sys_tenant_conf = {}
9591
if len(ob_services) > 0:
96-
if obproxy_ip and obproxy_port:
97-
obcluster_config["db_host"] = obproxy_ip
98-
obcluster_config["db_port"] = obproxy_port
99-
sys_tenant_conf["user"] = 'root@proxysys'
100-
obproxy_sys_password = deploy_config.components[comp].get_global_conf().get("obproxy_sys_password")
101-
sys_tenant_conf["password"] = obproxy_sys_password if obproxy_sys_password else ''
102-
else:
103-
port = 2881
104-
if global_conf.get('mysql_port') is not None:
105-
port = global_conf.get('mysql_port')
106-
else:
107-
port = cluster_config.get_server_conf(ob_services[0]).get("mysql_port")
108-
if global_conf.get('root_password') is not None:
109-
sys_tenant_conf["password"] = global_conf.get('root_password')
110-
else:
111-
sys_tenant_conf["password"] = ''
112-
sys_tenant_conf["user"] = 'root@sys'
113-
obcluster_config["db_host"] = ob_services[0].ip
114-
obcluster_config["db_port"] = port
92+
port = cluster_config.get_server_conf(ob_services[0]).get("mysql_port", 2881)
93+
sys_tenant_conf["password"] = global_conf.get('root_password', '')
94+
sys_tenant_conf["user"] = 'root@sys'
95+
obcluster_config["db_host"] = ob_services[0].ip
96+
obcluster_config["db_port"] = port
11597
obcluster_config["ob_cluster_name"] = deploy_name
11698
obcluster_config["tenant_sys"] = sys_tenant_conf
11799
obcluster_config["servers"] = {"nodes": observer_nodes, "global": {}}

plugins/oceanbase/3.1.0/start_check.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
def get_port_socket_inode(client, port):
3535
port = hex(port)[2:].zfill(4).upper()
36-
cmd = "bash -c 'cat /proc/net/{tcp*,udp*}' | awk -F' ' '{print $2,$10}' | grep '00000000:%s' | awk -F' ' '{print $2}' | uniq" % port
36+
cmd = "bash -c 'cat /proc/net/{tcp*,udp*}' | awk -F' ' '{if($4==\"0A\") print $2,$4,$10}' | grep ':%s' | awk -F' ' '{print $3}' | uniq" % port
3737
res = client.execute_command(cmd)
3838
if not res or not res.stdout.strip():
3939
return False

plugins/oceanbase/4.0.0.0/start_check.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
def get_port_socket_inode(client, port):
3737
port = hex(port)[2:].zfill(4).upper()
38-
cmd = "bash -c 'cat /proc/net/{tcp*,udp*}' | awk -F' ' '{print $2,$10}' | grep '00000000:%s' | awk -F' ' '{print $2}' | uniq" % port
38+
cmd = "bash -c 'cat /proc/net/{tcp*,udp*}' | awk -F' ' '{if($4==\"0A\") print $2,$4,$10}' | grep ':%s' | awk -F' ' '{print $3}' | uniq" % port
3939
res = client.execute_command(cmd)
4040
if not res or not res.stdout.strip():
4141
return False

plugins/oceanbase/4.2.0.0/parameter.yaml

+17-17
Original file line numberDiff line numberDiff line change
@@ -59,23 +59,6 @@
5959
need_redeploy: true
6060
description_en: the directory for the ilog file
6161
description_local: 存储ilog数据的目录
62-
- name: devname
63-
name_local: 网卡名
64-
essential: true
65-
type: SAFE_STRING
66-
min_value: NULL
67-
max_value: NULL
68-
need_restart: true
69-
description_en: name of network adapter
70-
description_local: 服务进程绑定的网卡设备名
71-
- name: local_ip
72-
name_local: 本机ip
73-
type: SAFE_STRING
74-
min_value: NULL
75-
max_value: NULL
76-
need_restart: true
77-
description_en: local ip address
78-
description_local: 本机ip地址
7962
- name: rpc_port
8063
name_local: 内部通信端口
8164
require: true
@@ -1214,6 +1197,23 @@
12141197
need_restart: true
12151198
description_en: the number of CPUs in the system. If this parameter is set to zero, the number will be set according to sysconf; otherwise, this parameter is used.
12161199
description_local: 系统CPU总数,如果设置为0,将自动检测
1200+
- name: devname
1201+
name_local: 网卡名
1202+
essential: true
1203+
type: SAFE_STRING
1204+
min_value: NULL
1205+
max_value: NULL
1206+
need_restart: true
1207+
description_en: name of network adapter
1208+
description_local: 非必填, 服务进程绑定的网卡设备名, 默认通过配置的ip设置local_ip, 如果预检查失败可通过配置此项来指定网卡
1209+
- name: local_ip
1210+
name_local: 本机ip
1211+
type: SAFE_STRING
1212+
min_value: NULL
1213+
max_value: NULL
1214+
need_restart: true
1215+
description_en: local ip address
1216+
description_local: 本机ip地址
12171217
- name: appname
12181218
require: false
12191219
type: SAFE_STRING

plugins/oceanbase/4.2.0.0/start_check.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
def get_port_socket_inode(client, port):
3737
port = hex(port)[2:].zfill(4).upper()
38-
cmd = "bash -c 'cat /proc/net/{tcp*,udp*}' | awk -F' ' '{print $2,$10}' | grep '00000000:%s' | awk -F' ' '{print $2}' | uniq" % port
38+
cmd = "bash -c 'cat /proc/net/{tcp*,udp*}' | awk -F' ' '{if($4==\"0A\") print $2,$4,$10}' | grep ':%s' | awk -F' ' '{print $3}' | uniq" % port
3939
res = client.execute_command(cmd)
4040
if not res or not res.stdout.strip():
4141
return False

plugins/oceanbase/4.2.1.0/parameter.yaml

+17-17
Original file line numberDiff line numberDiff line change
@@ -59,23 +59,6 @@
5959
need_redeploy: true
6060
description_en: the directory for the ilog file
6161
description_local: 存储ilog数据的目录
62-
- name: devname
63-
name_local: 网卡名
64-
essential: true
65-
type: SAFE_STRING
66-
min_value: NULL
67-
max_value: NULL
68-
need_restart: true
69-
description_en: name of network adapter
70-
description_local: 服务进程绑定的网卡设备名
71-
- name: local_ip
72-
name_local: 本机ip
73-
type: SAFE_STRING
74-
min_value: NULL
75-
max_value: NULL
76-
need_restart: true
77-
description_en: local ip address
78-
description_local: 本机ip地址
7962
- name: rpc_port
8063
name_local: 内部通信端口
8164
require: true
@@ -1214,6 +1197,23 @@
12141197
need_restart: true
12151198
description_en: the number of CPUs in the system. If this parameter is set to zero, the number will be set according to sysconf; otherwise, this parameter is used.
12161199
description_local: 系统CPU总数,如果设置为0,将自动检测
1200+
- name: devname
1201+
name_local: 网卡名
1202+
essential: true
1203+
type: SAFE_STRING
1204+
min_value: NULL
1205+
max_value: NULL
1206+
need_restart: true
1207+
description_en: name of network adapter
1208+
description_local: 非必填, 服务进程绑定的网卡设备名, 默认通过配置的ip设置local_ip, 如果预检查失败可通过配置此项来指定网卡
1209+
- name: local_ip
1210+
name_local: 本机ip
1211+
type: SAFE_STRING
1212+
min_value: NULL
1213+
max_value: NULL
1214+
need_restart: true
1215+
description_en: local ip address
1216+
description_local: 本机ip地址
12171217
- name: appname
12181218
require: false
12191219
type: SAFE_STRING

plugins/oceanbase/4.2.2.0/parameter.yaml

+18-18
Original file line numberDiff line numberDiff line change
@@ -59,23 +59,6 @@
5959
need_redeploy: true
6060
description_en: the directory for the ilog file
6161
description_local: 存储ilog数据的目录
62-
- name: devname
63-
name_local: 网卡名
64-
essential: true
65-
type: SAFE_STRING
66-
min_value: NULL
67-
max_value: NULL
68-
need_restart: true
69-
description_en: name of network adapter
70-
description_local: 服务进程绑定的网卡设备名
71-
- name: local_ip
72-
name_local: 本机ip
73-
type: SAFE_STRING
74-
min_value: NULL
75-
max_value: NULL
76-
need_restart: true
77-
description_en: local ip address
78-
description_local: 本机ip地址
7962
- name: rpc_port
8063
name_local: 内部通信端口
8164
require: true
@@ -1226,6 +1209,23 @@
12261209
need_restart: true
12271210
description_en: the number of CPUs in the system. If this parameter is set to zero, the number will be set according to sysconf; otherwise, this parameter is used.
12281211
description_local: 系统CPU总数,如果设置为0,将自动检测
1212+
- name: devname
1213+
name_local: 网卡名
1214+
essential: true
1215+
type: SAFE_STRING
1216+
min_value: NULL
1217+
max_value: NULL
1218+
need_restart: true
1219+
description_en: name of network adapter
1220+
description_local: 非必填, 服务进程绑定的网卡设备名, 默认通过配置的ip设置local_ip, 如果预检查失败可通过配置此项来指定网卡
1221+
- name: local_ip
1222+
name_local: 本机ip
1223+
type: SAFE_STRING
1224+
min_value: NULL
1225+
max_value: NULL
1226+
need_restart: true
1227+
description_en: local ip address
1228+
description_local: 本机ip地址
12291229
- name: appname
12301230
require: false
12311231
type: SAFE_STRING
@@ -1880,4 +1880,4 @@
18801880
default: ''
18811881
need_redeploy: true
18821882
description_en: The password for obagent monitor user
1883-
description_local: obagent 监控用户的密码
1883+
description_local: obagent 监控用户的密码

plugins/oceanbase/4.2.2.0/start_check.py

+4-12
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,15 @@
3535
success = True
3636
production_mode = False
3737

38-
def format_for_proc_net_tcp4(ip_address, port):
39-
ip_int = int.from_bytes(socket.inet_aton(ip_address), byteorder=sys.byteorder) #
40-
port_hex = hex(port)[2:].upper().zfill(4)
41-
ip_hex = hex(ip_int)[2:].upper().zfill(8)
42-
formatted_address = f"{ip_hex}:{port_hex}"
43-
return formatted_address
44-
45-
def get_port_socket_inode(client, port, ip='0.0.0.0'):
46-
formatted_address = format_for_proc_net_tcp4(ip, port)
47-
cmd = "bash -c 'cat /proc/net/{tcp*,udp*}' | awk -F' ' '{print $2,$10}' | grep '%s' | awk -F' ' '{print $2}' | uniq" % formatted_address
38+
def get_port_socket_inode(client, port):
39+
port = hex(port)[2:].zfill(4).upper()
40+
cmd = "bash -c 'cat /proc/net/{tcp*,udp*}' | awk -F' ' '{if($4==\"0A\") print $2,$4,$10}' | grep ':%s' | awk -F' ' '{print $3}' | uniq" % port
4841
res = client.execute_command(cmd)
4942
if not res or not res.stdout.strip():
5043
return False
5144
stdio.verbose(res.stdout)
5245
return res.stdout.strip().split('\n')
5346

54-
5547
def parse_size(size):
5648
_bytes = 0
5749
if not isinstance(size, str) or size.isdigit():
@@ -387,7 +379,7 @@ def system_memory_check():
387379
'server': server,
388380
'key': key
389381
}
390-
if (key == 'obshell_port' and get_port_socket_inode(client, port, ip)) or get_port_socket_inode(client, port):
382+
if get_port_socket_inode(client, port):
391383
critical('port', err.EC_CONFLICT_PORT.format(server=ip, port=port), [err.SUG_USE_OTHER_PORT.format()])
392384

393385
if parameter_check:

plugins/ocp-express/1.0.1/start.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ def start(plugin_context, start_env=None, *args, **kwargs):
348348
port = server_config['port']
349349
pid_path = os.path.join(home_path, 'run/ocp-express.pid')
350350
pids = client.execute_command("cat %s" % pid_path).stdout.strip()
351-
bootstrap_flag = client.execute_command('ls %s'%os.path.join(home_path, '.bootstrapped'))
351+
bootstrap_flag = client.execute_command('ls %s' % os.path.join(home_path, '.bootstrapped'))
352352
if pids and all([client.execute_command('ls /proc/%s' % pid) for pid in pids.split('\n')]):
353353
server_pid[server] = pids
354354
continue
@@ -399,18 +399,18 @@ def start(plugin_context, start_env=None, *args, **kwargs):
399399
public_key_str = get_plain_public_key(public_key)
400400
jdbc_password = rsa_private_sign(jdbc_password, private_key)
401401
else:
402-
public_key_str = ''
402+
public_key_str = ""
403403
memory_size = server_config['memory_size']
404404
jvm_memory_option = "-Xms{0} -Xmx{0}".format(format_size(parse_size(memory_size) * 0.5, 0).lower())
405405
java_bin = server_config['java_bin']
406406
cmd = '{java_bin} -jar {jvm_memory_option} -DJDBC_URL={jdbc_url} -DJDBC_USERNAME={jdbc_username}' \
407-
'{public_key} {home_path}/lib/ocp-express-server.jar --port={port}'.format(
407+
' -DPUBLIC_KEY={public_key} {home_path}/lib/ocp-express-server.jar --port={port}'.format(
408408
java_bin=java_bin,
409409
home_path=home_path,
410410
port=port,
411411
jdbc_url=jdbc_url,
412412
jdbc_username=jdbc_username,
413-
public_key=' -DPUBLIC_KEY={}'.format(public_key_str) if public_key_str else "",
413+
public_key=public_key_str,
414414
jvm_memory_option=jvm_memory_option
415415
)
416416
if "log_dir" not in server_config:
@@ -500,7 +500,7 @@ def start(plugin_context, start_env=None, *args, **kwargs):
500500
return plugin_context.return_false()
501501
else:
502502
stdio.stop_loading('succeed')
503-
plugin_context.return_true()
503+
plugin_context.return_true(need_bootstrap=True)
504504

505505
return False
506506

plugins/ocp-express/1.0.1/start_check.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def get_missing_required_parameters(parameters):
4141

4242
def get_port_socket_inode(client, port):
4343
port = hex(port)[2:].zfill(4).upper()
44-
cmd = "bash -c 'cat /proc/net/{udp*,tcp*}' | awk -F' ' '{print $2,$10}' | grep '00000000:%s' | awk -F' ' '{print $2}' | uniq" % port
44+
cmd = "bash -c 'cat /proc/net/{udp*,tcp*}' | awk -F' ' '{if($4==\"0A\") print $2,$4,$10}' | grep ':%s' | awk -F' ' '{print $3}' | uniq" % port
4545
res = client.execute_command(cmd)
4646
if not res or not res.stdout.strip():
4747
return False

plugins/ocp-express/1.0/start.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ def start(plugin_context, start_env=None, *args, **kwargs):
376376
jdbc_password = rsa_private_sign(jdbc_password, private_key)
377377
system_password = rsa_private_sign(system_password, private_key)
378378
else:
379-
public_key_str = ''
379+
public_key_str = ""
380380
memory_size = server_config['memory_size']
381381
jvm_memory_option = "-Xms{0} -Xmx{0}".format(format_size(parse_size(memory_size) * 0.5, 0).lower())
382382
extra_options = {
@@ -385,14 +385,14 @@ def start(plugin_context, start_env=None, *args, **kwargs):
385385
extra_options_str = ' '.join(["-D{}={}".format(k, v) for k, v in extra_options.items()])
386386
java_bin = server_config['java_bin']
387387
cmd = '{java_bin} -jar {jvm_memory_option} -DJDBC_URL={jdbc_url} -DJDBC_USERNAME={jdbc_username} -DJDBC_PASSWORD={jdbc_password} ' \
388-
'{public_key} {extra_options_str} {home_path}/lib/ocp-express-server.jar --port={port}'.format(
388+
'-DPUBLIC_KEY={public_key} {extra_options_str} {home_path}/lib/ocp-express-server.jar --port={port}'.format(
389389
java_bin=java_bin,
390390
home_path=home_path,
391391
port=port,
392392
jdbc_url=jdbc_url,
393393
jdbc_username=jdbc_username,
394394
jdbc_password=jdbc_password,
395-
public_key=' -DPUBLIC_KEY={}'.format(public_key_str) if public_key_str else "",
395+
public_key=public_key_str,
396396
jvm_memory_option=jvm_memory_option,
397397
extra_options_str=extra_options_str,
398398
)

0 commit comments

Comments
 (0)