You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
564 B
26 lines
564 B
# 分布式节点集群服务器
|
|
from loguru import logger
|
|
|
|
from dcs.clients.client import Client
|
|
|
|
start = 9000
|
|
ip = '192.168.43.241'
|
|
port = 7777
|
|
local_ip = ip
|
|
local_port = None
|
|
# 开启的分布节点数量
|
|
count = 5
|
|
|
|
if __name__ == '__main__':
|
|
clients = []
|
|
socket_to_servers = []
|
|
|
|
for i in range(start, start + count):
|
|
client = Client(ip, port, local_ip, i)
|
|
client.daemon = True
|
|
clients.append(client)
|
|
|
|
[c.start() for c in clients]
|
|
logger.info('[CLIENTS] starting all client nodes...')
|
|
[c.join() for c in clients]
|