未验证 提交 27ce397d 编写于 作者: R Rongfeng Fu 提交者: GitHub

Obproxy start (#72)

* new build

* obproxy start O
上级 1baf5487
...@@ -217,7 +217,7 @@ def start(plugin_context, local_home_path, repository_dir, *args, **kwargs): ...@@ -217,7 +217,7 @@ def start(plugin_context, local_home_path, repository_dir, *args, **kwargs):
stdio.start_loading('obproxy program health check') stdio.start_loading('obproxy program health check')
failed = [] failed = []
servers = cluster_config.servers servers = cluster_config.servers
count = 4 count = 8
while servers and count: while servers and count:
count -= 1 count -= 1
tmp_servers = [] tmp_servers = []
...@@ -230,9 +230,14 @@ def start(plugin_context, local_home_path, repository_dir, *args, **kwargs): ...@@ -230,9 +230,14 @@ def start(plugin_context, local_home_path, repository_dir, *args, **kwargs):
for pid in remote_pid.split('\n'): for pid in remote_pid.split('\n'):
confirm = confirm_port(client, pid, int(server_config["listen_port"])) confirm = confirm_port(client, pid, int(server_config["listen_port"]))
if confirm: if confirm:
proxyd_Pid_path = os.path.join(server_config["home_path"], 'run/obproxyd-%s-%d.pid' % (server.ip, server_config["listen_port"]))
if client.execute_command("pid=`cat %s` && ls /proc/$pid" % proxyd_Pid_path):
stdio.verbose('%s obproxy[pid: %s] started', server, pid) stdio.verbose('%s obproxy[pid: %s] started', server, pid)
else:
client.execute_command('echo %s > %s' % (pid, pid_path[server])) client.execute_command('echo %s > %s' % (pid, pid_path[server]))
obproxyd(server_config["home_path"], client, server.ip, server_config["listen_port"]) obproxyd(server_config["home_path"], client, server.ip, server_config["listen_port"])
client.execute_command('cat %s | xargs kill -9' % pid_path[server])
tmp_servers.append(server)
break break
stdio.verbose('failed to start %s obproxy, remaining retries: %d' % (server, count)) stdio.verbose('failed to start %s obproxy, remaining retries: %d' % (server, count))
if count: if count:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册