本文整理汇总了Python中remote.remote_util.RemoteMachineShellConnection.membase_install方法的典型用法代码示例。如果您正苦于以下问题:Python RemoteMachineShellConnection.membase_install方法的具体用法?Python RemoteMachineShellConnection.membase_install怎么用?Python RemoteMachineShellConnection.membase_install使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类remote.remote_util.RemoteMachineShellConnection
的用法示例。
在下文中一共展示了RemoteMachineShellConnection.membase_install方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: install_membase
# 需要导入模块: from remote.remote_util import RemoteMachineShellConnection [as 别名]
# 或者: from remote.remote_util.RemoteMachineShellConnection import membase_install [as 别名]
def install_membase(ip,username,key_location,build):
connection = RemoteMachineShellConnection(ip = ip,
username = username,
pkey_location = key_location)
remote_client = RemoteMachineShellConnection(ip = ip,
pkey_location = self.get_pkey())
downloaded = connection.download_build(build)
if not downloaded:
raise BuildException(build)
connection.membase_uninstall()
remote_client.membase_install(build)
#TODO: we should poll the 8091 port until it is up and running
log.info('wait 5 seconds for membase server to start')
time.sleep(5)
rest = RestConnection(ip = ip,username = 'Administrator',
password = 'password')
#try this max for 2 minutes
start_time = time.time()
cluster_initialized = False
while time.time() < (start_time + (2 * 60)):
try:
rest.init_cluster(username = 'Administrator',password = 'password')
cluster_initialized = True
except ServerUnavailableException:
log.error("error happened while initializing the cluster @ {0}".format(ip))
log.info('wait 5 for seconds before trying again...')
time.sleep(5)
if not cluster_initialized:
log.error("error happened while initializing the cluster @ {0}".format(ip))
raise Exception("error happened while initializing the cluster @ {0}".format(ip))
示例2: install
# 需要导入模块: from remote.remote_util import RemoteMachineShellConnection [as 别名]
# 或者: from remote.remote_util.RemoteMachineShellConnection import membase_install [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))
path = server.data_path or "/tmp"
remote_client.membase_install(build, path=path, vbuckets=vbuckets)
ready = RestHelper(RestConnection(params["server"])).is_ns_server_running(60)
if not ready:
log.error("membase-server did not start...")
log.info("wait 5 seconds for membase server to start")
time.sleep(5)
示例3: _test_install
# 需要导入模块: from remote.remote_util import RemoteMachineShellConnection [as 别名]
# 或者: from remote.remote_util.RemoteMachineShellConnection import membase_install [as 别名]
def _test_install(self,serverInfo,version,builds):
query = BuildQuery()
info = self.machine_infos[serverInfo.ip]
names = ['membase-server-enterprise',
'membase-server-community',
'couchbase-server-enterprise',
'couchbase-server-community']
build = None
for name in names:
build = query.find_membase_build(builds,
name,
info.deliverable_type,
info.architecture_type,
version.strip())
if build:
break
if not build:
self.fail('unable to find any {0} build for {1} for arch : {2} '.format(info.distribution_type,
info.architecture_type,
version.strip()))
print 'for machine : ', info.architecture_type, info.distribution_type, 'relevant build : ', build
remote_client = RemoteMachineShellConnection(serverInfo)
remote_client.membase_uninstall()
remote_client.couchbase_uninstall()
if 'amazon' in self.input.test_params:
build.url = build.url.replace("http://builds.hq.northscale.net/latestbuilds/",
"http://packages.northscale.com/latestbuilds/")
build.url = build.url.replace("enterprise", "community")
build.name = build.name.replace("enterprise", "community")
downloaded = remote_client.download_build(build)
self.assertTrue(downloaded, 'unable to download binaries :'.format(build.url))
remote_client.membase_install(build)
#TODO: we should poll the 8091 port until it is up and running
self.log.info('wait 5 seconds for membase server to start')
time.sleep(5)
start_time = time.time()
cluster_initialized = False
while time.time() < (start_time + (10 * 60)):
rest = RestConnection(serverInfo)
try:
if serverInfo.data_path:
self.log.info("setting data path to " + serverInfo.data_path)
rest.set_data_path(serverInfo.data_path)
rest.init_cluster(username=serverInfo.rest_username, password=serverInfo.rest_password)
cluster_initialized = True
break
except ServerUnavailableException:
self.log.error("error happened while initializing the cluster @ {0}".format(serverInfo.ip))
self.log.info('sleep for 5 seconds before trying again ...')
time.sleep(5)
self.assertTrue(cluster_initialized,
"error happened while initializing the cluster @ {0}".format(serverInfo.ip))
if not cluster_initialized:
self.log.error("error happened while initializing the cluster @ {0}".format(serverInfo.ip))
raise Exception("error happened while initializing the cluster @ {0}".format(serverInfo.ip))
nodeinfo = rest.get_nodes_self()
rest.init_cluster_memoryQuota(memoryQuota=nodeinfo.mcdMemoryReserved)
rest.init_cluster_memoryQuota(256)
示例4: install
# 需要导入模块: from remote.remote_util import RemoteMachineShellConnection [as 别名]
# 或者: from remote.remote_util.RemoteMachineShellConnection import membase_install [as 别名]
def install(self, params):
# log = logger.new_logger("Installer")
build = self.build_url(params)
remote_client = RemoteMachineShellConnection(params["server"])
downloaded = remote_client.download_build(build)
if not downloaded:
log.error(downloaded, 'unable to download binaries : {0}'.format(build.url))
remote_client.membase_install(build, False)
示例5: _install_and_upgrade
# 需要导入模块: from remote.remote_util import RemoteMachineShellConnection [as 别名]
# 或者: from remote.remote_util.RemoteMachineShellConnection import membase_install [as 别名]
def _install_and_upgrade(self, initial_version='1.6.5.3',
initialize_cluster=False,
create_buckets=False,
insert_data=False):
log = logger.Logger.get_logger()
input = TestInputSingleton.input
rest_settings = input.membase_settings
servers = input.servers
server = servers[0]
save_upgrade_config = False
if re.search('1.8',input.test_params['version']):
save_upgrade_config = True
is_amazon = False
if input.test_params.get('amazon',False):
is_amazon = True
remote = RemoteMachineShellConnection(server)
rest = RestConnection(server)
info = remote.extract_remote_info()
remote.membase_uninstall()
remote.couchbase_uninstall()
builds, changes = BuildQuery().get_all_builds()
older_build = BuildQuery().find_membase_release_build(deliverable_type=info.deliverable_type,
os_architecture=info.architecture_type,
build_version=initial_version,
product='membase-server-enterprise', is_amazon=is_amazon)
remote.execute_command('/etc/init.d/membase-server stop')
remote.download_build(older_build)
#now let's install ?
remote.membase_install(older_build)
RestHelper(rest).is_ns_server_running(testconstants.NS_SERVER_TIMEOUT)
rest.init_cluster_port(rest_settings.rest_username, rest_settings.rest_password)
bucket_data = {}
if initialize_cluster:
rest.init_cluster_memoryQuota(memoryQuota=rest.get_nodes_self().mcdMemoryReserved)
if create_buckets:
_create_load_multiple_bucket(self, server, bucket_data, howmany=2)
version = input.test_params['version']
appropriate_build = _get_build(servers[0], version, is_amazon=is_amazon)
self.assertTrue(appropriate_build.url, msg="unable to find build {0}".format(version))
remote.download_build(appropriate_build)
remote.membase_upgrade(appropriate_build, save_upgrade_config=save_upgrade_config)
remote.disconnect()
RestHelper(rest).is_ns_server_running(testconstants.NS_SERVER_TIMEOUT)
pools_info = rest.get_pools_info()
rest.init_cluster_port(rest_settings.rest_username, rest_settings.rest_password)
time.sleep(TIMEOUT_SECS)
#verify admin_creds still set
self.assertTrue(pools_info['implementationVersion'], appropriate_build.product_version)
if initialize_cluster:
#TODO: how can i verify that the cluster init config is preserved
if create_buckets:
self.assertTrue(BucketOperationHelper.wait_for_bucket_creation('bucket-0', rest),
msg="bucket 'default' does not exist..")
if insert_data:
buckets = rest.get_buckets()
for bucket in buckets:
BucketOperationHelper.keys_exist_or_assert(bucket_data[bucket.name]["inserted_keys"],
server,
bucket.name, self)