当前位置: 首页>>代码示例>>Python>>正文


Python settings.ClusterSpec类代码示例

本文整理汇总了Python中perfrunner.settings.ClusterSpec的典型用法代码示例。如果您正苦于以下问题:Python ClusterSpec类的具体用法?Python ClusterSpec怎么用?Python ClusterSpec使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ClusterSpec类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: main

def main():
    usage = '%prog -c cluster -v version [-t toy]'

    parser = OptionParser(usage)

    parser.add_option('-c', dest='cluster_spec_fname',
                      help='path to cluster specification file',
                      metavar='cluster.spec')
    parser.add_option('-e', dest='cluster_edition', default='enterprise',
                      help='the cluster edition (community or enterprise)')
    parser.add_option('-v', dest='version',
                      help='build version', metavar='2.0.0-1976')
    parser.add_option('-t', dest='toy',
                      help='optional toy build ID', metavar='couchstore')
    parser.add_option('--url', dest='url', default=None,
                      help='The http URL to a Couchbase RPM that should be'
                      ' installed. This overrides the URL to be installed.')
    parser.add_option('--verbose', dest='verbose', action='store_true',
                      help='enable verbose logging')

    options, args = parser.parse_args()

    if not (options.cluster_spec_fname and options.version) and not options.url:
        parser.error(
            'Missing mandatory parameter. Either specify both cluster'
            ' spec and version, or specify just the URL to be installed')

    if options.cluster_edition not in ['community', 'enterprise']:
        parser.error('Cluster edition must be either community or enterprise')

    cluster_spec = ClusterSpec()
    cluster_spec.parse(options.cluster_spec_fname, args)

    installer = CouchbaseInstaller(cluster_spec, options)
    installer.install()
开发者ID:sriganes,项目名称:perfrunner,代码行数:35,代码来源:install.py

示例2: main

def main():
    options, args = get_options()
    override = args and (arg.split('.') for arg in ' '.join(args).split(','))

    cluster_spec = ClusterSpec()
    cluster_spec.parse(options.cluster_spec_fname)
    test_config = TestConfig()
    test_config.parse(options.test_config_fname, override)

    cm = ClusterManager(cluster_spec, test_config)

    # Individual nodes
    cm.restart_with_alternative_num_vbuckets()
    cm.restart_with_alternative_num_cpus()
    cm.configure_internal_settings()
    cm.set_data_path()
    cm.set_auth()
    cm.set_mem_quota()
    cm.disable_moxi()

    time.sleep(30)  # crutch

    # Cluster
    if cm.group_number > 1:
        cm.create_server_groups()
    cm.add_nodes()
    cm.create_buckets()
    cm.restart_with_alternative_bucket_options()
    cm.wait_until_warmed_up()
    cm.configure_auto_compaction()
    cm.enable_auto_failover()
    cm.change_watermarks()
    cm.tweak_memory()
    cm.remote.disable_wan()
    cm.start_cbq_engine()
开发者ID:lichenyang2,项目名称:perfrunner,代码行数:35,代码来源:cluster.py

示例3: main

def main():
    usage = '%prog -c cluster -v version [-t toy]'

    parser = OptionParser(usage)

    parser.add_option('-c', dest='cluster_spec_fname',
                      help='path to cluster specification file',
                      metavar='cluster.spec')
    parser.add_option('-v', dest='version',
                      help='build version', metavar='2.0.0-1976')
    parser.add_option('-t', dest='toy',
                      help='optional toy build ID', metavar='couchstore')
    parser.add_option('--verbose', dest='verbose', action='store_true',
                      help='enable verbose logging')

    options, _ = parser.parse_args()

    if not options.cluster_spec_fname or not options.version:
        parser.error('Missing mandatory parameter')

    cluster_spec = ClusterSpec()
    cluster_spec.parse(options.cluster_spec_fname)

    installer = CouchbaseInstaller(cluster_spec, options)
    installer.install()
开发者ID:abhi-bit,项目名称:perfrunner,代码行数:25,代码来源:install.py

示例4: main

def main():
    usage = '%prog -c cluster -t test_config -v version'

    parser = OptionParser(usage)

    parser.add_option('-c', dest='cluster_spec_fname',
                      help='path to cluster specification file',
                      metavar='ClusterSpecFilePath')
    parser.add_option('-t', dest='test_config_fname',
                      help='path to test config file',
                      metavar='TestConfigFilePath')
    parser.add_option('-v', dest='version',
                      help='build version', metavar='Version')

    options, _ = parser.parse_args()
    if not options.cluster_spec_fname or not options.test_config_fname \
            or not options.version:
        parser.error('Missing mandatory parameter')

    cluster_spec = ClusterSpec()
    cluster_spec.parse(options.cluster_spec_fname)

    test_config = TestConfig()
    test_config.parse(options.test_config_fname)

    installer = GatewayInstaller(cluster_spec, test_config, options)
    installer.install()
开发者ID:lichenyang2,项目名称:perfrunner,代码行数:27,代码来源:install_gw.py

示例5: main

def main():
    usage = '%prog -c cluster -v version'

    parser = OptionParser(usage)

    parser.add_option('-c', dest='cluster_spec_fname',
                      help='the path to a cluster specification file',
                      metavar='cluster.spec')
    parser.add_option('-e', dest='cluster_edition', default='enterprise',
                      help='the cluster edition (community or enterprise)')
    parser.add_option('-v', dest='version',
                      help='the build version', metavar='2.0.0-1976')
    parser.add_option('--url', dest='url', default=None,
                      help='the HTTP URL to a package that should be installed.')
    parser.add_option('--verbose', dest='verbose', action='store_true',
                      help='enable verbose logging')

    options, args = parser.parse_args()

    if options.cluster_edition not in ['community', 'enterprise']:
        # changed to default to enterprise, with no error:
        options.cluster_edition = 'enterprise'

    if not (options.cluster_spec_fname and options.version) and not options.url:
        parser.error('Missing mandatory parameter. Either pecify both cluster '
                     'spec and version, or specify the URL to be installed.')

    cluster_spec = ClusterSpec()
    cluster_spec.parse(options.cluster_spec_fname, args)

    installer = CouchbaseInstaller(cluster_spec, options)
    installer.install()
开发者ID:mahesh152,项目名称:perfrunner,代码行数:32,代码来源:install.py

示例6: main

def main():
    usage = '%prog -c cluster -t test_config -v version'

    parser = OptionParser(usage)

    parser.add_option('-c', dest='cluster_spec_fname',
                      help='path to cluster specification file',
                      metavar='ClusterSpecFilePath')
    parser.add_option('-t', dest='test_config_fname',
                      help='path to test config file',
                      metavar='TestConfigFilePath')
    parser.add_option('-v', dest='version',
                      help='build version', metavar='Version')
    parser.add_option('--verbose', dest='verbose', action='store_true',
                      help='enable verbose logging')

    options, args = parser.parse_args()
    override = args and [arg.split('.') for arg in ' '.join(args).split(',')]

    if not options.cluster_spec_fname or not options.test_config_fname \
            or not options.version:
        parser.error('Missing mandatory parameter')

    cluster_spec = ClusterSpec()
    cluster_spec.parse(options.cluster_spec_fname)

    test_config = TestConfig()
    test_config.parse(options.test_config_fname, override)

    installer = GatewayInstaller(cluster_spec, test_config, options)
    installer.install()
开发者ID:abhi-bit,项目名称:perfrunner,代码行数:31,代码来源:install_gw.py

示例7: main

def main():
    usage = '%prog -v version -c cluster-spec'
    parser = OptionParser(usage)
    parser.add_option('-v', '--version', dest='version')
    parser.add_option('-c', dest='cluster_spec_fname',
                      help='path to cluster specification file',
                      metavar='cluster.spec')
    parser.add_option('--verbose', dest='verbose', action='store_true',
                      help='enable verbose logging')
    parser.add_option('-o', dest='toy',
                      help='optional toy build ID', metavar='couchstore')

    parser.add_option('-t', dest='test_config_fname',
                      help='path to test configuration file',
                      metavar='my_test.test')

    parser.add_option('-e', '--edition', dest='cluster_edition', default='enterprise',
                      help='the cluster edition (community or enterprise)')
    parser.add_option('--url', dest='url', default=None,
                      help='The http URL to a Couchbase RPM that should be'
                           ' installed.  This overrides the URL to be installed.')
    options, args = parser.parse_args()
    cluster_spec = ClusterSpec()
    cluster_spec.parse(options.cluster_spec_fname, args)

    test_config = TestConfig()
    test_config.parse(options.test_config_fname, args)

    cm = ClusterManager(cluster_spec, test_config, options.verbose)

    installer = CouchbaseInstaller(cluster_spec, options)
    if True:
        installer.install()
        if cm.remote:
            cm.tune_logging()
            cm.restart_with_sfwi()
            cm.restart_with_alternative_num_vbuckets()
            cm.restart_with_alternative_num_cpus()
            cm.restart_with_tcmalloc_aggressive_decommit()
            cm.disable_moxi()
        cm.configure_internal_settings()
        cm.set_data_path()
        cm.set_services()
        cm.set_mem_quota()
        cm.set_index_mem_quota()
        cm.set_auth()
        time.sleep(30)
        """host = cluster_spec.yield_masters().next()"""
    host_ip = cluster_spec.yield_masters().next().split(':')[0]
    URL = 'http://' + host_ip + ':8093'
    logger.info('logging the URL: {}'.format(URL))
    conn = urllib3.connection_from_url(URL)
    rest = RestHelper(cluster_spec)
    airline_result = do_airline_benchmarks(conn, rest, host_ip, installer.remote, cluster_spec)
    beer_result = do_beer_queries(conn, rest, host_ip, installer.remote)
    print 'beer_result is', beer_result

    sys.exit(not (airline_result and beer_result))
开发者ID:mikewied,项目名称:perfrunner,代码行数:58,代码来源:query_benchmark.py

示例8: main

def main():
    args = get_args()

    cluster_spec = ClusterSpec()
    cluster_spec.parse(args.cluster)

    remote = RemoteHelper(cluster_spec, args.verbose)
    remote.get_manifest()
    projects = parse_manifest()
    fetch(projects)
开发者ID:couchbase,项目名称:perfrunner,代码行数:10,代码来源:go_dependencies.py

示例9: main

def main():
    args = get_args()

    cluster_spec = ClusterSpec()
    cluster_spec.parse(fname=args.cluster)

    installer = CouchbaseInstaller(cluster_spec, args)
    installer.install()

    if args.local_copy:
        installer.download()
开发者ID:couchbase,项目名称:perfrunner,代码行数:11,代码来源:install.py

示例10: main

def main():
    args = get_args()

    cluster_spec = ClusterSpec()
    cluster_spec.parse(args.cluster_spec_fname)

    remote = RemoteHelper(cluster_spec, verbose=False)

    logger.info('Recovering system state')
    for host, version in remote.get_system_backup_version().items():
        remote.start_system_state_recovery(host, version)
开发者ID:couchbase,项目名称:perfrunner,代码行数:11,代码来源:recovery.py

示例11: main

def main():
    options, args = get_options()

    cluster_spec = ClusterSpec()
    cluster_spec.parse(options.cluster_spec_fname, args)

    remote = RemoteHelper(cluster_spec, test_config=None, verbose=False)

    logger.info('Recovering system state')
    for host, version in remote.get_system_backup_version().items():
        remote.start_system_state_recovery(host, version)
开发者ID:mahesh152,项目名称:perfrunner,代码行数:11,代码来源:recovery.py

示例12: main

def main():
    options, args = get_options()

    cluster_spec = ClusterSpec()
    cluster_spec.parse(options.cluster_spec_fname, args)

    remote = RemoteHelper(cluster_spec, test_config=None, verbose=False)

    remote.collect_info()
    for hostname in cluster_spec.yield_hostnames():
        for fname in glob.glob('{}/*.zip'.format(hostname)):
            shutil.move(fname, '{}.zip'.format(hostname))
开发者ID:mahesh152,项目名称:perfrunner,代码行数:12,代码来源:debug.py

示例13: main

def main():
    options, args = get_options()

    cluster_spec = ClusterSpec()
    cluster_spec.parse(options.cluster_spec_fname, args)
    test_config = TestConfig()
    test_config.parse(options.test_config_fname, args)

    cm = ClusterManager(cluster_spec, test_config, options.verbose)

    # Individual nodes
    if cm.remote:
        cm.tune_logging()
        cm.restart_with_sfwi()
        cm.restart_with_alternative_num_vbuckets()
        cm.restart_with_alternative_num_cpus()
        cm.restart_with_tcmalloc_aggressive_decommit()
        cm.disable_moxi()
    cm.configure_internal_settings()
    cm.configure_xdcr_settings()
    time.sleep(10)  # dkao: crutch
    cm.set_data_path()
    cm.set_services()
    cm.set_mem_quota()
    cm.set_index_mem_quota()
    cm.set_fts_index_mem_quota()
    cm.set_auth()

    time.sleep(30)  # crutch

    # Cluster
    if cm.group_number > 1:
        cm.create_server_groups()
    cm.add_nodes()
    if cm.test_config.cluster.num_buckets:
        cm.create_buckets()
    if cm.test_config.cluster.emptybuckets:
        cm.create_buckets(empty_buckets=True)
    if cm.remote:
        cm.restart_with_alternative_bucket_options()
    cm.wait_until_warmed_up()
    cm.wait_until_healthy()
    cm.configure_auto_compaction()
    cm.enable_auto_failover()
    cm.change_watermarks()
    if cm.remote:
        cm.set_index_settings()
        cm.change_dcp_io_threads()
        time.sleep(60)
        cm.set_query_settings()
        cm.tweak_memory()
        cm.remote.disable_wan()
        cm.start_cbq_engine()
开发者ID:bharath-gp,项目名称:perfrunner,代码行数:53,代码来源:cluster.py

示例14: main

def main():
    args = get_args()

    cluster_spec = ClusterSpec()
    cluster_spec.parse(args.cluster_spec_fname, override=args.override)
    test_config = TestConfig()
    test_config.parse(args.test_config_fname, override=args.override)

    cm = ClusterManager(cluster_spec, test_config, args.verbose)

    # Individual nodes
    cm.disable_wan()
    cm.clear_login_history()
    cm.tune_memory_settings()
    cm.throttle_cpu()
    cm.enable_ipv6()
    cm.tune_logging()
    cm.restart_with_alternative_num_vbuckets()
    cm.flush_iptables()

    cm.configure_internal_settings()
    cm.set_data_path()
    cm.set_index_path()
    cm.set_analytics_path()
    cm.set_mem_quotas()
    cm.set_services()
    cm.rename()
    cm.set_auth()
    cm.configure_xdcr_settings()

    # Cluster
    cm.add_nodes()
    cm.rebalance()
    cm.enable_auto_failover()
    cm.configure_auto_compaction()
    cm.enable_audit()

    if cm.test_config.cluster.num_buckets:
        cm.create_buckets()
        cm.create_eventing_buckets()
        cm.create_eventing_metadata_bucket()
        cm.add_rbac_users()

    cm.restart_with_alternative_bucket_options()
    cm.set_index_settings()
    cm.set_query_settings()
    cm.set_x509_certificates()
    cm.wait_until_healthy()
    cm.wait_until_warmed_up()

    cm.tweak_memory()
开发者ID:couchbase,项目名称:perfrunner,代码行数:51,代码来源:cluster.py

示例15: main

def main():
    options, args = get_options()

    cluster_spec = ClusterSpec()
    cluster_spec.parse(options.cluster_spec_fname, args)
    test_config = TestConfig()
    test_config.parse(options.test_config_fname, args)

    test_module = test_config.test_case.test_module
    test_class = test_config.test_case.test_class
    exec('from {} import {}'.format(test_module, test_class))

    with eval(test_class)(cluster_spec, test_config, options.verbose) as test:
        test.run()
开发者ID:mahesh152,项目名称:perfrunner,代码行数:14,代码来源:__main__.py


注:本文中的perfrunner.settings.ClusterSpec类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。