2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-01-28 03:48:35 +00:00

Improve collective startup behavior

Have confluent focus on establishing quorum before
initiating headless console and discovery activity.
This commit is contained in:
Jarrod Johnson 2021-04-07 07:58:10 -04:00
parent 4724d9e45b
commit 9a779f2dd2

View File

@ -244,7 +244,7 @@ def run(args):
_updatepidfile()
signal.signal(signal.SIGINT, terminate)
signal.signal(signal.SIGTERM, terminate)
collective.startup()
atexit.register(doexit)
if dbgif:
oumask = os.umask(0o077)
try:
@ -258,19 +258,27 @@ def run(args):
except AttributeError:
pass # Windows...
os.umask(oumask)
collective.startup()
consoleserver.initialize()
http_bind_host, http_bind_port = _get_connector_config('http')
sock_bind_host, sock_bind_port = _get_connector_config('socket')
consoleserver.initialize()
webservice = httpapi.HttpApi(http_bind_host, http_bind_port)
webservice.start()
disco.start_detection()
pxe.start_proxydhcp()
try:
sockservice = sockapi.SockApi(sock_bind_host, sock_bind_port)
sockservice.start()
except NameError:
pass
atexit.register(doexit)
webservice = httpapi.HttpApi(http_bind_host, http_bind_port)
webservice.start()
while len(configmanager.list_collective) >= 2:
# If in a collective, stall automatic startup activity
# until we establish quorum
try:
configmanager.check_quorum()
break
except Exception:
eventlet.sleep(0.5)
disco.start_detection()
pxe.start_proxydhcp()
eventlet.sleep(1)
consoleserver.start_console_sessions()
while 1: