本文整理汇总了Python中cluster.Cluster.request_gce_cluster方法的典型用法代码示例。如果您正苦于以下问题:Python Cluster.request_gce_cluster方法的具体用法?Python Cluster.request_gce_cluster怎么用?Python Cluster.request_gce_cluster使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cluster.Cluster
的用法示例。
在下文中一共展示了Cluster.request_gce_cluster方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: request_cluster
# 需要导入模块: from cluster import Cluster [as 别名]
# 或者: from cluster.Cluster import request_gce_cluster [as 别名]
def request_cluster(argv):
"""
only request cluster on GCE, and output all configuration information
:param argv: sys.argv
:return: None
"""
if len(argv) < 7:
print_help()
exit(1)
cluster_name = argv[2]
ambari_agent_vm_num = int(argv[3])
docker_num = int(argv[4])
service_server_num = int(argv[5])
with_ambari_server = False
ambari_server_num = int(argv[6])
if ambari_server_num > 0:
with_ambari_server = True
cluster = Cluster()
cluster.request_gce_cluster(ambari_agent_vm_num, docker_num, service_server_num,
with_ambari_server, cluster_name)
time_to_wait = Config.ATTRIBUTES["gce_boot_time"]
print "wait ", str(time_to_wait), " seconds for the cluster to boot ... ..."
time.sleep(int(time_to_wait))
data = Data()
data.add_new_cluster(cluster)
print "complete"