def configure_rethinkdb_gce(cluster, configure_daemons):
# RethinkDB requires multiple nodes to join the master
# RethinkDB requires every node to provide a set of ports
# One port is used to interact with the node running the algorithm (driver_port), the others are framework's ones
# On GCE we can always use the same set of ports, because they will be surely available (VM just spun up)
print("Trying to contact remote master configure daemon...")
# configure_daemon = rpcClient('http://{}:{}'.format(cluster[0]['address'], CONFIGURE_DAEMON_PORT))
print(configure_daemons[0].configure_rethinkdb_master(GCE_RETHINKDB_PORTS['cluster_port'],
GCE_RETHINKDB_PORTS['driver_port'],
GCE_RETHINKDB_PORTS['http_port'], cluster[0]['address']))
print("Trying to contact remote followers configure daemons...")
for (i, node) in enumerate(cluster[1:]):
print(configure_daemons[i + 1].configure_rethinkdb_follower(node['id'], cluster[0]['address'],
GCE_RETHINKDB_PORTS['cluster_port'],
GCE_RETHINKDB_PORTS['cluster_port'],
GCE_RETHINKDB_PORTS['driver_port'],
GCE_RETHINKDB_PORTS['http_port']))
# main
评论列表
文章目录