provisioner.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:krafters 作者: GianlucaBortoli 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号