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


Python StandalonePrestoInstaller.install方法代码示例

本文整理汇总了Python中tests.product.standalone.presto_installer.StandalonePrestoInstaller.install方法的典型用法代码示例。如果您正苦于以下问题:Python StandalonePrestoInstaller.install方法的具体用法?Python StandalonePrestoInstaller.install怎么用?Python StandalonePrestoInstaller.install使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tests.product.standalone.presto_installer.StandalonePrestoInstaller的用法示例。


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

示例1: test_connector_add_lost_host

# 需要导入模块: from tests.product.standalone.presto_installer import StandalonePrestoInstaller [as 别名]
# 或者: from tests.product.standalone.presto_installer.StandalonePrestoInstaller import install [as 别名]
    def test_connector_add_lost_host(self):
        installer = StandalonePrestoInstaller(self)
        self.setup_cluster(self.PA_ONLY_CLUSTER)
        self.upload_topology()
        installer.install()
        self.run_prestoadmin('connector remove tpch')

        self.cluster.stop_host(
            self.cluster.slaves[0])
        self.cluster.write_content_to_host(
            'connector.name=tpch',
            os.path.join(constants.CONNECTORS_DIR, 'tpch.properties'),
            self.cluster.master
        )
        output = self.run_prestoadmin('connector add tpch')
        for host in self.cluster.all_internal_hosts():
            deploying_message = 'Deploying tpch.properties connector ' \
                                'configurations on: %s'
            self.assertTrue(deploying_message % host in output,
                            'expected %s \n actual %s'
                            % (deploying_message % host, output))
        self.assertRegexpMatches(
            output,
            self.down_node_connection_error(self.cluster.internal_slaves[0])
        )
        self.assertEqual(len(output.splitlines()),
                         len(self.cluster.all_hosts()) +
                         self.len_down_node_error)
        self.run_prestoadmin('server start')

        for host in [self.cluster.master,
                     self.cluster.slaves[1],
                     self.cluster.slaves[2]]:
            self.assert_has_default_connector(host)
        self._assert_connectors_loaded([['system'], ['tpch']])
开发者ID:tddisser,项目名称:presto-admin,代码行数:37,代码来源:test_connectors.py

示例2: test_install_twice

# 需要导入模块: from tests.product.standalone.presto_installer import StandalonePrestoInstaller [as 别名]
# 或者: from tests.product.standalone.presto_installer.StandalonePrestoInstaller import install [as 别名]
    def test_install_twice(self):
        installer = StandalonePrestoInstaller(self)
        self.upload_topology()
        cmd_output = installer.install()
        expected = self.format_err_msgs_with_internal_hosts(installed_all_hosts_output)

        actual = cmd_output.splitlines()
        self.assertRegexpMatchesLineByLine(actual, expected)

        for container in self.cluster.all_hosts():
            installer.assert_installed(self, container)
            self.assert_has_default_config(container)
            self.assert_has_default_connector(container)

        output = installer.install(pa_raise_error=False)

        self.default_keywords.update(installer.get_keywords())

        with open(os.path.join(LOCAL_RESOURCES_DIR, 'install_twice.txt'),
                  'r') as f:
            expected = f.read()
        expected = self.escape_for_regex(
            self.replace_keywords(expected))

        self.assertRegexpMatchesLineByLine(output.splitlines(),
                                           expected.splitlines())
        for container in self.cluster.all_hosts():
            installer.assert_installed(self, container)
            self.assert_has_default_config(container)
            self.assert_has_default_connector(container)
开发者ID:Teradata,项目名称:presto-admin,代码行数:32,代码来源:test_server_install.py

示例3: test_catalog_add_lost_host

# 需要导入模块: from tests.product.standalone.presto_installer import StandalonePrestoInstaller [as 别名]
# 或者: from tests.product.standalone.presto_installer.StandalonePrestoInstaller import install [as 别名]
    def test_catalog_add_lost_host(self):
        installer = StandalonePrestoInstaller(self)
        self.setup_cluster(NoHadoopBareImageProvider(), STANDALONE_PA_CLUSTER)
        self.upload_topology()
        installer.install()
        self.run_prestoadmin('catalog remove tpch')

        self.cluster.stop_host(
            self.cluster.slaves[0])
        self.cluster.write_content_to_host(
            'connector.name=tpch',
            os.path.join(get_catalog_directory(), 'tpch.properties'),
            self.cluster.master
        )
        output = self.run_prestoadmin('catalog add tpch', raise_error=False)
        for host in self.cluster.all_internal_hosts():
            deploying_message = 'Deploying tpch.properties catalog configurations on: %s'
            self.assertTrue(deploying_message % host in output,
                            'expected %s \n actual %s'
                            % (deploying_message % host, output))
        self.assertRegexpMatches(
            output,
            self.down_node_connection_error(self.cluster.internal_slaves[0])
        )
        self.assertEqual(len(output.splitlines()),
                         len(self.cluster.all_hosts()) +
                         self.len_down_node_error)
        self.run_prestoadmin('server start', raise_error=False)

        for host in [self.cluster.master,
                     self.cluster.slaves[1],
                     self.cluster.slaves[2]]:
            self.assert_has_default_catalog(host)
        self._assert_catalogs_loaded([['system'], ['tpch']])
开发者ID:prestodb,项目名称:presto-admin,代码行数:36,代码来源:test_catalog.py

示例4: test_system_info_pa_separate_node

# 需要导入模块: from tests.product.standalone.presto_installer import StandalonePrestoInstaller [as 别名]
# 或者: from tests.product.standalone.presto_installer.StandalonePrestoInstaller import install [as 别名]
 def test_system_info_pa_separate_node(self):
     installer = StandalonePrestoInstaller(self)
     self.setup_cluster(NoHadoopBareImageProvider(), self.PA_ONLY_CLUSTER)
     topology = {"coordinator": "slave1",
                 "workers": ["slave2", "slave3"]}
     self.upload_topology(topology=topology)
     installer.install(coordinator='slave1')
     self.test_basic_system_info(
         coordinator=self.cluster.internal_slaves[0],
         hosts=self.cluster.slaves)
开发者ID:duanshuaimin,项目名称:presto-admin,代码行数:12,代码来源:test_collect.py

示例5: test_start_stop_restart_worker_down

# 需要导入模块: from tests.product.standalone.presto_installer import StandalonePrestoInstaller [as 别名]
# 或者: from tests.product.standalone.presto_installer.StandalonePrestoInstaller import install [as 别名]
 def test_start_stop_restart_worker_down(self):
     installer = StandalonePrestoInstaller(self)
     self.setup_cluster(NoHadoopBareImageProvider(), self.PA_ONLY_CLUSTER)
     topology = {"coordinator": "slave1",
                 "workers": ["master", "slave2", "slave3"]}
     self.upload_topology(topology=topology)
     installer.install(coordinator='slave1')
     self.assert_start_stop_restart_down_node(
         self.cluster.slaves[0],
         self.cluster.internal_slaves[0])
开发者ID:nanaessuman,项目名称:presto-admin,代码行数:12,代码来源:test_control.py

示例6: test_system_info_pa_separate_node

# 需要导入模块: from tests.product.standalone.presto_installer import StandalonePrestoInstaller [as 别名]
# 或者: from tests.product.standalone.presto_installer.StandalonePrestoInstaller import install [as 别名]
 def test_system_info_pa_separate_node(self):
     installer = StandalonePrestoInstaller(self)
     self.setup_cluster(NoHadoopBareImageProvider(), STANDALONE_PA_CLUSTER)
     topology = {"coordinator": "slave1",
                 "workers": ["slave2", "slave3"]}
     self.upload_topology(topology=topology)
     installer.install(coordinator='slave1')
     self.run_prestoadmin('server start')
     actual = self.run_prestoadmin('collect system_info')
     self._test_basic_system_info(
         actual,
         coordinator=self.cluster.internal_slaves[0],
         hosts=self.cluster.slaves)
开发者ID:prestodb,项目名称:presto-admin,代码行数:15,代码来源:test_collect.py

示例7: test_connection_to_coord_lost

# 需要导入模块: from tests.product.standalone.presto_installer import StandalonePrestoInstaller [as 别名]
# 或者: from tests.product.standalone.presto_installer.StandalonePrestoInstaller import install [as 别名]
    def test_connection_to_coord_lost(self):
        installer = StandalonePrestoInstaller(self)
        down_node = self.cluster.internal_slaves[0]
        topology = {"coordinator": down_node,
                    "workers": [self.cluster.internal_master,
                                self.cluster.internal_slaves[1],
                                self.cluster.internal_slaves[2]]}
        self.upload_topology(topology=topology)
        self.cluster.stop_host(
            self.cluster.slaves[0])

        actual_out = installer.install(
            coordinator=down_node, pa_raise_error=False)

        self.assertRegexpMatches(
            actual_out,
            self.down_node_connection_error(down_node)
        )

        for host in [self.cluster.master,
                     self.cluster.slaves[1],
                     self.cluster.slaves[2]]:
            self.assert_common_configs(host)
            self.assert_file_content(
                host,
                '/etc/presto/config.properties',
                self.default_workers_config_with_slave1_
            )
开发者ID:Teradata,项目名称:presto-admin,代码行数:30,代码来源:test_server_install.py

示例8: test_install_when_connector_json_exists

# 需要导入模块: from tests.product.standalone.presto_installer import StandalonePrestoInstaller [as 别名]
# 或者: from tests.product.standalone.presto_installer.StandalonePrestoInstaller import install [as 别名]
    def test_install_when_connector_json_exists(self):
        installer = StandalonePrestoInstaller(self, dummy=True)
        topology = {"coordinator": "master",
                    "workers": ["slave1"]}
        self.upload_topology(topology)
        self.cluster.write_content_to_host(
            'connector.name=jmx',
            os.path.join(constants.CONNECTORS_DIR, 'jmx.properties'),
            self.cluster.master
        )

        cmd_output = installer.install()
        expected = ['Deploying rpm on master...',
                    'Deploying rpm on slave1...',
                    'Package deployed successfully on: slave1',
                    'Package installed successfully on: slave1',
                    'Package deployed successfully on: master',
                    'Package installed successfully on: master',
                    'Deploying configuration on: master',
                    'Deploying jmx.properties, tpch.properties '
                    'connector configurations on: master ',
                    'Deploying configuration on: slave1',
                    'Deploying jmx.properties, tpch.properties '
                    'connector configurations on: slave1 ']

        actual = cmd_output.splitlines()
        self.assertEqual(sorted(expected), sorted(actual))

        for container in [self.cluster.master,
                          self.cluster.slaves[0]]:
            installer.assert_installed(self, container)
            self.assert_has_default_config(container)
            self.assert_has_default_connector(container)
            self.assert_has_jmx_connector(container)
开发者ID:nanaessuman,项目名称:presto-admin,代码行数:36,代码来源:test_server_install.py

示例9: test_server_starts_java8_in_bin_java

# 需要导入模块: from tests.product.standalone.presto_installer import StandalonePrestoInstaller [as 别名]
# 或者: from tests.product.standalone.presto_installer.StandalonePrestoInstaller import install [as 别名]
    def test_server_starts_java8_in_bin_java(self):
        installer = StandalonePrestoInstaller(self)
        for container in self.cluster.all_hosts():
            self.cluster.exec_cmd_on_host(container,
                                          'mv /usr/java/jdk1.8.0_40 /usr')
            self.cluster.exec_cmd_on_host(container,
                                          'ln -s /usr/jdk1.8.0_40/bin/java '
                                          '/bin/java')
        self.upload_topology()

        installer.install()

        # starts successfully with java8_home set
        output = self.run_prestoadmin('server start')
        self.assertFalse(
            'Warning: No value found for JAVA8_HOME. Default Java will be '
            'used.' in output)
开发者ID:mango77881,项目名称:presto-admin,代码行数:19,代码来源:test_rpm.py

示例10: test_query_info_pa_separate_node

# 需要导入模块: from tests.product.standalone.presto_installer import StandalonePrestoInstaller [as 别名]
# 或者: from tests.product.standalone.presto_installer.StandalonePrestoInstaller import install [as 别名]
    def test_query_info_pa_separate_node(self):
        installer = StandalonePrestoInstaller(self)
        self.setup_cluster(NoHadoopBareImageProvider, STANDALONE_PA_CLUSTER)
        topology = {"coordinator": "slave1",
                    "workers": ["slave2", "slave3"]}
        self.upload_topology(topology=topology)
        installer.install(coordinator='slave1')
        self.run_prestoadmin('server start')
        sql_to_run = 'SELECT * FROM system.runtime.nodes WHERE 1234 = 1234'
        query_id = self.retry(
            lambda: self.get_query_id(sql_to_run, host=self.cluster.slaves[0]))

        actual = self.run_prestoadmin('collect query_info ' + query_id)
        query_info_file_name = path.join(TMP_PRESTO_DEBUG, 'query_info_' + query_id + '.json')

        expected = 'Gathered query information in file: ' + query_info_file_name + '\n'
        self.assert_path_exists(self.cluster.master, query_info_file_name)
        self.assertEqual(actual, expected)
开发者ID:Teradata,项目名称:presto-admin,代码行数:20,代码来源:test_collect.py

示例11: test_server_starts_java8_in_bin_java

# 需要导入模块: from tests.product.standalone.presto_installer import StandalonePrestoInstaller [as 别名]
# 或者: from tests.product.standalone.presto_installer.StandalonePrestoInstaller import install [as 别名]
    def test_server_starts_java8_in_bin_java(self):
        installer = StandalonePrestoInstaller(self)

        with relocate_jdk_directory(self.cluster, '/usr') as new_java_home:
            java_bin = os.path.join(new_java_home, 'bin', 'java')

            for container in self.cluster.all_hosts():
                self.cluster.exec_cmd_on_host(
                    container, 'ln -s %s /bin/java' % (java_bin,))

            self.upload_topology()

            installer.install()

            # starts successfully with java8_home set
            output = self.run_prestoadmin('server start')
            self.assertFalse(
                'Warning: No value found for JAVA8_HOME. Default Java will be '
                'used.' in output)
开发者ID:Teradata,项目名称:presto-admin,代码行数:21,代码来源:test_rpm.py

示例12: test_install_when_topology_has_ips

# 需要导入模块: from tests.product.standalone.presto_installer import StandalonePrestoInstaller [as 别名]
# 或者: from tests.product.standalone.presto_installer.StandalonePrestoInstaller import install [as 别名]
    def test_install_when_topology_has_ips(self):
        installer = StandalonePrestoInstaller(self)
        ips = self.cluster.get_ip_address_dict()
        topology = {"coordinator": ips[self.cluster.master],
                    "workers": [ips[self.cluster.slaves[0]]]}
        self.upload_topology(topology)
        self.cluster.write_content_to_host(
            'connector.name=jmx',
            os.path.join(constants.CONNECTORS_DIR, 'jmx.properties'),
            self.cluster.master
        )

        cmd_output = installer.install().splitlines()
        expected = [
            r'Deploying rpm on %s...' % ips[self.cluster.master],
            r'Deploying rpm on %s...' % ips[self.cluster.slaves[0]],
            r'Package deployed successfully on: ' + ips[
                self.cluster.master],
            r'Package installed successfully on: ' + ips[
                self.cluster.master],
            r'Package deployed successfully on: ' +
            ips[self.cluster.slaves[0]],
            r'Package installed successfully on: ' +
            ips[self.cluster.slaves[0]],
            r'Deploying configuration on: ' +
            ips[self.cluster.master],
            r'Deploying jmx.properties, tpch.properties '
            r'connector configurations on: ' +
            ips[self.cluster.master] + r' ',
            r'Deploying configuration on: ' +
            ips[self.cluster.slaves[0]],
            r'Deploying jmx.properties, tpch.properties '
            r'connector configurations on: ' +
            ips[self.cluster.slaves[0]] + r' ',
            r'Using rpm_specifier as a local path',
            r'Fetching local presto rpm at path: .*',
            r'Found existing rpm at: .*']

        cmd_output.sort()
        expected.sort()
        self.assertRegexpMatchesLineByLine(cmd_output, expected)

        self.assert_installed_with_regex_configs(
            self.cluster.master,
            [self.cluster.slaves[0]])
        for container in [self.cluster.master,
                          self.cluster.slaves[0]]:
            self.assert_has_jmx_connector(container)
开发者ID:dadohp,项目名称:presto-admin,代码行数:50,代码来源:test_server_install.py

示例13: test_install_fails_java8_not_found

# 需要导入模块: from tests.product.standalone.presto_installer import StandalonePrestoInstaller [as 别名]
# 或者: from tests.product.standalone.presto_installer.StandalonePrestoInstaller import install [as 别名]
    def test_install_fails_java8_not_found(self):
        installer = StandalonePrestoInstaller(self)
        with relocate_jdk_directory(self.cluster, '/usr'):
            self.upload_topology()
            cmd_output = installer.install(pa_raise_error=False)
            actual = cmd_output.splitlines()
            num_failures = 0
            for line in enumerate(actual):
                if str(line).find('Error: Required Java version'
                                  ' could not be found') != -1:
                    num_failures += 1

            self.assertEqual(4, num_failures)

            for container in self.cluster.all_hosts():
                installer.assert_uninstalled(container)
开发者ID:Teradata,项目名称:presto-admin,代码行数:18,代码来源:test_rpm.py

示例14: test_install

# 需要导入模块: from tests.product.standalone.presto_installer import StandalonePrestoInstaller [as 别名]
# 或者: from tests.product.standalone.presto_installer.StandalonePrestoInstaller import install [as 别名]
    def test_install(self, installer=None):
        if installer is None:
            installer = StandalonePrestoInstaller(self)

        self.upload_topology()

        cmd_output = installer.install()
        expected = installed_all_hosts_output

        actual = cmd_output.splitlines()
        self.assertEqual(sorted(expected), sorted(actual))

        for container in self.cluster.all_hosts():
            installer.assert_installed(self, container)
            self.assert_has_default_config(container)
            self.assert_has_default_connector(container)
开发者ID:nanaessuman,项目名称:presto-admin,代码行数:18,代码来源:test_server_install.py

示例15: test_install_ext_host_is_pa_master

# 需要导入模块: from tests.product.standalone.presto_installer import StandalonePrestoInstaller [as 别名]
# 或者: from tests.product.standalone.presto_installer.StandalonePrestoInstaller import install [as 别名]
    def test_install_ext_host_is_pa_master(self):
        installer = StandalonePrestoInstaller(self)
        topology = {"coordinator": "slave1",
                    "workers": ["slave2", "slave3"]}
        self.upload_topology(topology)

        cmd_output = installer.install(coordinator='slave1')
        expected = install_with_ext_host_pa_master_out

        actual = cmd_output.splitlines()
        self.assertRegexpMatchesLineByLine(actual, expected)

        self.assert_installed_with_configs(
            self.cluster.slaves[0],
            [self.cluster.slaves[1],
             self.cluster.slaves[2]])
开发者ID:Teradata,项目名称:presto-admin,代码行数:18,代码来源:test_server_install.py


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