本文整理汇总了Python中membase.helper.cluster_helper.ClusterOperationHelper.set_vbuckets方法的典型用法代码示例。如果您正苦于以下问题:Python ClusterOperationHelper.set_vbuckets方法的具体用法?Python ClusterOperationHelper.set_vbuckets怎么用?Python ClusterOperationHelper.set_vbuckets使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类membase.helper.cluster_helper.ClusterOperationHelper
的用法示例。
在下文中一共展示了ClusterOperationHelper.set_vbuckets方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: install
# 需要导入模块: from membase.helper.cluster_helper import ClusterOperationHelper [as 别名]
# 或者: from membase.helper.cluster_helper.ClusterOperationHelper import set_vbuckets [as 别名]
def install(self, params):
# log = logger.new_logger("Installer")
build = self.build_url(params)
remote_client = RemoteMachineShellConnection(params["server"])
info = remote_client.extract_remote_info()
type = info.type.lower()
server = params["server"]
if "vbuckets" in params:
vbuckets = int(params["vbuckets"][0])
else:
vbuckets = None
if type == "windows":
build = self.build_url(params)
remote_client.download_binary_in_win(build.url, params["product"], params["version"])
remote_client.membase_install_win(build, params["version"])
else:
downloaded = remote_client.download_build(build)
if not downloaded:
log.error(downloaded, 'unable to download binaries : {0}'.format(build.url))
#TODO: need separate methods in remote_util for couchbase and membase install
path = server.data_path or '/tmp'
remote_client.membase_install(build, path=path, vbuckets=vbuckets)
log.info('wait 5 seconds for membase server to start')
time.sleep(5)
if "rest_vbuckets" in params:
rest_vbuckets = int(params["rest_vbuckets"])
ClusterOperationHelper.set_vbuckets(server, rest_vbuckets)
示例2: tearDown
# 需要导入模块: from membase.helper.cluster_helper import ClusterOperationHelper [as 别名]
# 或者: from membase.helper.cluster_helper.ClusterOperationHelper import set_vbuckets [as 别名]
def tearDown(self):
master = self.servers[0]
ClusterOperationHelper.set_vbuckets(master, self.old_vbuckets)
rest = RestConnection(master)
rest.stop_rebalance()
self.cluster.rebalance(self.servers[:self.num_servers], [],
self.servers[1:self.num_servers])
self.cluster.bucket_delete(master, self.bucket)
self.cluster.shutdown()
示例3: setUp
# 需要导入模块: from membase.helper.cluster_helper import ClusterOperationHelper [as 别名]
# 或者: from membase.helper.cluster_helper.ClusterOperationHelper import set_vbuckets [as 别名]
def setUp(self):
self.cluster = Cluster()
self.input = TestInputSingleton.input
self.servers = self.input.servers
self.num_servers = self.input.param("servers", 1)
master = self.servers[0]
num_replicas = self.input.param("replicas", 1)
self.bucket = 'default'
# Start: Should be in a before class function
BucketOperationHelper.delete_all_buckets_or_assert(self.servers, self)
for server in self.servers:
ClusterOperationHelper.cleanup_cluster([server])
ClusterOperationHelper.wait_for_ns_servers_or_assert([master], self)
# End: Should be in a before class function
self.quota = self.cluster.init_node(master)
self.old_vbuckets = self._get_vbuckets(master)
ClusterOperationHelper.set_vbuckets(master, 1)
self.cluster.create_default_bucket(master, self.quota, num_replicas)
self.cluster.rebalance(self.servers[:self.num_servers],
self.servers[1:self.num_servers], [])