本文整理匯總了Python中lib.membase.helper.cluster_helper.ClusterOperationHelper.start_cluster方法的典型用法代碼示例。如果您正苦於以下問題:Python ClusterOperationHelper.start_cluster方法的具體用法?Python ClusterOperationHelper.start_cluster怎麽用?Python ClusterOperationHelper.start_cluster使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類lib.membase.helper.cluster_helper.ClusterOperationHelper
的用法示例。
在下文中一共展示了ClusterOperationHelper.start_cluster方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: save_snapshots
# 需要導入模塊: from lib.membase.helper.cluster_helper import ClusterOperationHelper [as 別名]
# 或者: from lib.membase.helper.cluster_helper.ClusterOperationHelper import start_cluster [as 別名]
def save_snapshots(self, file_base, bucket):
"""Save snapshots on all servers"""
if not self.input.servers or not bucket:
self.log.error("invalid server list or bucket name")
return False
ClusterOperationHelper.stop_cluster(self.input.servers)
for server in self.input.servers:
self._save_snapshot(server, bucket, file_base)
ClusterOperationHelper.start_cluster(self.input.servers)
return True
示例2: load_snapshots
# 需要導入模塊: from lib.membase.helper.cluster_helper import ClusterOperationHelper [as 別名]
# 或者: from lib.membase.helper.cluster_helper.ClusterOperationHelper import start_cluster [as 別名]
def load_snapshots(self, file_base, bucket):
"""Load snapshots on all servers"""
if not self.input.servers or not bucket:
print "[perf: load_snapshot] invalid server list or bucket name"
return False
ClusterOperationHelper.stop_cluster(self.input.servers)
for server in self.input.servers:
if not self._load_snapshot(server, bucket, file_base):
ClusterOperationHelper.start_cluster(self.input.servers)
return False
ClusterOperationHelper.start_cluster(self.input.servers)
return True
示例3: set_up_dgm
# 需要導入模塊: from lib.membase.helper.cluster_helper import ClusterOperationHelper [as 別名]
# 或者: from lib.membase.helper.cluster_helper.ClusterOperationHelper import start_cluster [as 別名]
def set_up_dgm(self):
"""Download fragmented, DGM dataset onto each cluster node, if not
already locally available.
The number of vbuckets and database schema must match the
target cluster.
Shutdown all cluster nodes.
Do a cluster-restore.
Restart all cluster nodes."""
bucket = self.param("bucket", "default")
ClusterOperationHelper.stop_cluster(self.input.servers)
for server in self.input.servers:
remote = RemoteMachineShellConnection(server)
#TODO: Better way to pass num_nodes and db_size?
self.get_data_files(remote, bucket, 1, 10)
remote.disconnect()
ClusterOperationHelper.start_cluster(self.input.servers)