AMBARI-19887 : Add AMS and Grafana to PERF cluster. (avijayan) (cherry picked from commit a45b521372c70b5d4b50d3376350dad8353fa47a)
Change-Id: Ib69554ba3352b530d23b06cbd0ea043930d54ec9 Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/6e2a2855 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/6e2a2855 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/6e2a2855 Branch: refs/heads/branch-feature-BUG-74026 Commit: 6e2a2855615b1ad44d799f20a44fe1e27b6572dd Parents: 8cfbd7b Author: Aravindan Vijayan <[email protected]> Authored: Tue Feb 7 10:16:21 2017 -0800 Committer: Zuul <[email protected]> Committed: Tue Feb 7 15:56:55 2017 -0800 ---------------------------------------------------------------------- .../functions/get_not_managed_resources.py | 19 ++-- .../system/impl/AmbariMetricSinkImpl.java | 44 +++++++-- .../PERF/1.0/hooks/before-ANY/scripts/hook.py | 7 ++ .../PERF/1.0/hooks/before-ANY/scripts/params.py | 42 +++++++++ .../before-ANY/scripts/shared_initialization.py | 94 ++++++++++++++++++++ .../PERF/1.0/hooks/before-START/scripts/hook.py | 1 + .../AMBARI_METRICS/configuration/ams-site.xml | 36 ++++++++ .../1.0/services/AMBARI_METRICS/metainfo.xml | 26 ++++++ .../PERF/1.0/services/FAKEZOOKEEPER/alerts.json | 4 +- .../1.0/services/FAKEZOOKEEPER/kerberos.json | 4 +- .../1.0/services/FAKEZOOKEEPER/metainfo.xml | 7 +- .../package/scripts/zookeeper_client.py | 2 +- .../package/scripts/zookeeper_server.py | 2 +- .../stacks/PERF/1.0/services/stack_advisor.py | 37 ++++++++ 14 files changed, 298 insertions(+), 27 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/6e2a2855/ambari-common/src/main/python/resource_management/libraries/functions/get_not_managed_resources.py ---------------------------------------------------------------------- diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/get_not_managed_resources.py b/ambari-common/src/main/python/resource_management/libraries/functions/get_not_managed_resources.py index 5f8bc67..4af636b 100644 --- a/ambari-common/src/main/python/resource_management/libraries/functions/get_not_managed_resources.py +++ b/ambari-common/src/main/python/resource_management/libraries/functions/get_not_managed_resources.py @@ -34,17 +34,18 @@ def get_not_managed_resources(): """ config = Script.get_config() not_managed_hdfs_path_list = json.loads(config['hostLevelParams']['not_managed_hdfs_path_list'])[:] - managed_hdfs_resource_property_names = config['configurations']['cluster-env']['managed_hdfs_resource_property_names'] - managed_hdfs_resource_property_list = filter(None, [property.strip() for property in managed_hdfs_resource_property_names.split(',')]) + if 'managed_hdfs_resource_property_names' in config['configurations']['cluster-env']: + managed_hdfs_resource_property_names = config['configurations']['cluster-env']['managed_hdfs_resource_property_names'] + managed_hdfs_resource_property_list = filter(None, [property.strip() for property in managed_hdfs_resource_property_names.split(',')]) - for property_name in managed_hdfs_resource_property_list: - property_value = default('/configurations/' + property_name, None) + for property_name in managed_hdfs_resource_property_list: + property_value = default('/configurations/' + property_name, None) - if property_value == None: - Logger.warning(("Property {0} from cluster-env/managed_hdfs_resource_property_names not found in configurations. " + if property_value == None: + Logger.warning(("Property {0} from cluster-env/managed_hdfs_resource_property_names not found in configurations. " "Management of this DFS resource will not be forced.").format(property_name)) - else: - while property_value in not_managed_hdfs_path_list: - not_managed_hdfs_path_list.remove(property_value) + else: + while property_value in not_managed_hdfs_path_list: + not_managed_hdfs_path_list.remove(property_value) return not_managed_hdfs_path_list \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/6e2a2855/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/AmbariMetricSinkImpl.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/AmbariMetricSinkImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/AmbariMetricSinkImpl.java index 58d36c3..275ad16 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/AmbariMetricSinkImpl.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/AmbariMetricSinkImpl.java @@ -43,6 +43,8 @@ import org.apache.ambari.server.metrics.system.SingleMetric; import org.apache.ambari.server.security.authorization.internal.InternalAuthenticationToken; import org.apache.ambari.server.state.Cluster; import org.apache.ambari.server.state.Clusters; +import org.apache.ambari.server.state.Config; +import org.apache.ambari.server.state.ConfigHelper; import org.apache.ambari.server.state.Service; import org.apache.ambari.server.state.ServiceComponent; import org.apache.ambari.server.state.ServiceComponentHost; @@ -99,6 +101,28 @@ public class AmbariMetricSinkImpl extends AbstractTimelineMetricsSink implements Cluster c = kv.getValue(); Resource.Type type = Resource.Type.ServiceConfigVersion; + //If Metrics Collector VIP settings are configured, use that. + boolean vipHostConfigPresent = false; + boolean vipPortConfigPresent = false; + Config clusterEnv = c.getDesiredConfigByType(ConfigHelper.CLUSTER_ENV); + if (clusterEnv != null) { + Map<String, String> configs = clusterEnv.getProperties(); + + String metricsCollectorVipHost = configs.get("metrics_collector_vip_host"); + if (StringUtils.isNotEmpty(metricsCollectorVipHost)) { + LOG.info("Setting Metrics Collector Vip Host : " + metricsCollectorVipHost); + collectorHosts.add(metricsCollectorVipHost); + vipHostConfigPresent = true; + } + + String metricsCollectorVipPort = configs.get("metrics_collector_vip_port"); + if (StringUtils.isNotEmpty(metricsCollectorVipPort)) { + LOG.info("Setting Metrics Collector Vip Port : " + metricsCollectorVipPort); + port = metricsCollectorVipPort; + vipPortConfigPresent = true; + } + } + Set<String> propertyIds = new HashSet<String>(); propertyIds.add(ServiceConfigVersionResourceProvider.SERVICE_CONFIG_VERSION_CONFIGURATIONS_PROPERTY_ID); @@ -116,14 +140,16 @@ public class AmbariMetricSinkImpl extends AbstractTimelineMetricsSink implements ambariManagementController); try { - //get collector host(s) - Service service = c.getService(ambariMetricsServiceName); - if (service != null) { - for (String component : service.getServiceComponents().keySet()) { - ServiceComponent sc = service.getServiceComponents().get(component); - for (ServiceComponentHost serviceComponentHost : sc.getServiceComponentHosts().values()) { - if (serviceComponentHost.getServiceComponentName().equals("METRICS_COLLECTOR")) { - collectorHosts.add(serviceComponentHost.getHostName()); + if ( !vipHostConfigPresent ) { + //get collector host(s) + Service service = c.getService(ambariMetricsServiceName); + if (service != null) { + for (String component : service.getServiceComponents().keySet()) { + ServiceComponent sc = service.getServiceComponents().get(component); + for (ServiceComponentHost serviceComponentHost : sc.getServiceComponentHosts().values()) { + if (serviceComponentHost.getServiceComponentName().equals("METRICS_COLLECTOR")) { + collectorHosts.add(serviceComponentHost.getHostName()); + } } } } @@ -140,7 +166,7 @@ public class AmbariMetricSinkImpl extends AbstractTimelineMetricsSink implements if (config != null && config.get("type").equals("ams-site")) { TreeMap<Object, Object> properties = (TreeMap<Object, Object>) config.get("properties"); String timelineWebappAddress = (String) properties.get("timeline.metrics.service.webapp.address"); - if (StringUtils.isNotEmpty(timelineWebappAddress) && timelineWebappAddress.contains(":")) { + if (!vipPortConfigPresent && StringUtils.isNotEmpty(timelineWebappAddress) && timelineWebappAddress.contains(":")) { port = timelineWebappAddress.split(":")[1]; } String httpPolicy = (String) properties.get("timeline.metrics.service.http.policy"); http://git-wip-us.apache.org/repos/asf/ambari/blob/6e2a2855/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-ANY/scripts/hook.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-ANY/scripts/hook.py b/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-ANY/scripts/hook.py index 90e0266..ef409e2 100644 --- a/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-ANY/scripts/hook.py +++ b/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-ANY/scripts/hook.py @@ -18,11 +18,18 @@ limitations under the License. """ from resource_management.libraries.script import Hook +from shared_initialization import * class BeforeAnyHook(Hook): def hook(self, env): print "Before Any Hook" + import params + env.set_params(params) + + #For AMS. + setup_users() + setup_java() if __name__ == "__main__": BeforeAnyHook().execute() http://git-wip-us.apache.org/repos/asf/ambari/blob/6e2a2855/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-ANY/scripts/params.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-ANY/scripts/params.py b/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-ANY/scripts/params.py new file mode 100644 index 0000000..dee9d07 --- /dev/null +++ b/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-ANY/scripts/params.py @@ -0,0 +1,42 @@ +""" +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +""" +import collections +import ambari_simplejson as json +from resource_management.libraries.script import Script +from resource_management.libraries.functions import default +from resource_management.libraries.functions.expect import expect +from ambari_commons.constants import AMBARI_SUDO_BINARY + +config = Script.get_config() +tmp_dir = Script.get_tmp_dir() + +group_list = json.loads(config['hostLevelParams']['group_list']) +user_list = json.loads(config['hostLevelParams']['user_list']) + +user_group = config['configurations']['cluster-env']['user_group'] +user_to_gid_dict = collections.defaultdict(lambda:user_group) +user_to_groups_dict = collections.defaultdict(lambda:[user_group]) + +jdk_name = default("/hostLevelParams/jdk_name", None) +java_home = config['hostLevelParams']['java_home'] +artifact_dir = format("{tmp_dir}/AMBARI-artifacts/") +jdk_location = config['hostLevelParams']['jdk_location'] +java_version = expect("/hostLevelParams/java_version", int) + +sudo = AMBARI_SUDO_BINARY \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/6e2a2855/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-ANY/scripts/shared_initialization.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-ANY/scripts/shared_initialization.py b/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-ANY/scripts/shared_initialization.py new file mode 100644 index 0000000..7dc1a48 --- /dev/null +++ b/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-ANY/scripts/shared_initialization.py @@ -0,0 +1,94 @@ +""" +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +""" + +import os +import tempfile +from resource_management import * + +def setup_users(): + """ + Creates users before cluster installation + """ + import params + + for group in params.group_list: + Group(group, + ) + + for user in params.user_list: + User(user, + gid=params.user_to_gid_dict[user], + groups=params.user_to_groups_dict[user], + fetch_nonlocal_groups=False + ) + +def setup_java(): + """ + Installs jdk using specific params, that comes from ambari-server + """ + import params + + java_exec = format("{java_home}/bin/java") + + if not os.path.isfile(java_exec): + if not params.jdk_name: # if custom jdk is used. + raise Fail(format("Unable to access {java_exec}. Confirm you have copied jdk to this host.")) + + jdk_curl_target = format("{tmp_dir}/{jdk_name}") + java_dir = os.path.dirname(params.java_home) + + Directory(params.artifact_dir, + create_parents = True, + ) + + File(jdk_curl_target, + content = DownloadSource(format("{jdk_location}/{jdk_name}")), + not_if = format("test -f {jdk_curl_target}") + ) + + tmp_java_dir = tempfile.mkdtemp(prefix="jdk_tmp_", dir=params.tmp_dir) + + try: + if params.jdk_name.endswith(".bin"): + chmod_cmd = ("chmod", "+x", jdk_curl_target) + install_cmd = format("cd {tmp_java_dir} && echo A | {jdk_curl_target} -noregister && {sudo} cp -rp {tmp_java_dir}/* {java_dir}") + elif params.jdk_name.endswith(".gz"): + chmod_cmd = ("chmod","a+x", java_dir) + install_cmd = format("cd {tmp_java_dir} && tar -xf {jdk_curl_target} && {sudo} cp -rp {tmp_java_dir}/* {java_dir}") + + Directory(java_dir + ) + + Execute(chmod_cmd, + sudo = True, + ) + + Execute(install_cmd, + ) + + finally: + Directory(tmp_java_dir, action="delete") + + File(format("{java_home}/bin/java"), + mode=0755, + cd_access="a", + ) + Execute(('chmod', '-R', '755', params.java_home), + sudo = True, + ) http://git-wip-us.apache.org/repos/asf/ambari/blob/6e2a2855/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-START/scripts/hook.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-START/scripts/hook.py b/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-START/scripts/hook.py index c5600a3..cc24233 100644 --- a/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-START/scripts/hook.py +++ b/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-START/scripts/hook.py @@ -22,6 +22,7 @@ from resource_management.libraries.script import Hook class BeforeStartHook(Hook): def hook(self, env): + self.run_custom_hook('before-ANY') print "Before Start Hook" if __name__ == "__main__": http://git-wip-us.apache.org/repos/asf/ambari/blob/6e2a2855/ambari-server/src/main/resources/stacks/PERF/1.0/services/AMBARI_METRICS/configuration/ams-site.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/AMBARI_METRICS/configuration/ams-site.xml b/ambari-server/src/main/resources/stacks/PERF/1.0/services/AMBARI_METRICS/configuration/ams-site.xml new file mode 100644 index 0000000..1dc66ea --- /dev/null +++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/AMBARI_METRICS/configuration/ams-site.xml @@ -0,0 +1,36 @@ +<?xml version="1.0"?> +<?xml-stylesheet type="text/xsl" href="configuration.xsl"?> +<!-- +/** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +--> +<configuration> + <property> + <name>cluster.zookeeper.quorum</name> + <value>{{zookeeper_quorum_hosts}}</value> + <description>Comma separated list of servers in the cluster ZooKeeper Quorum. + </description> + <on-ambari-upgrade add="true"/> + </property> + <property> + <name>cluster.zookeeper.property.clientPort</name> + <value>{{zookeeper_clientPort}}</value> + <on-ambari-upgrade add="true"/> + </property> +</configuration> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/6e2a2855/ambari-server/src/main/resources/stacks/PERF/1.0/services/AMBARI_METRICS/metainfo.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/AMBARI_METRICS/metainfo.xml b/ambari-server/src/main/resources/stacks/PERF/1.0/services/AMBARI_METRICS/metainfo.xml new file mode 100644 index 0000000..03a5ab5 --- /dev/null +++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/AMBARI_METRICS/metainfo.xml @@ -0,0 +1,26 @@ +<?xml version="1.0"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<metainfo> + <schemaVersion>2.0</schemaVersion> + <services> + <service> + <name>AMBARI_METRICS</name> + <extends>common-services/AMBARI_METRICS/0.1.0</extends> + </service> + </services> +</metainfo> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/6e2a2855/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEZOOKEEPER/alerts.json ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEZOOKEEPER/alerts.json b/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEZOOKEEPER/alerts.json index c30a53b1..b9c8976 100644 --- a/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEZOOKEEPER/alerts.json +++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEZOOKEEPER/alerts.json @@ -1,7 +1,7 @@ { - "FAKEZOOKEEPER": { + "ZOOKEEPER": { - "FAKEZOOKEEPER_SERVER": [ + "ZOOKEEPER_SERVER": [ { "name": "zookeeper_server_process", "label": "Zookeeper server Process", http://git-wip-us.apache.org/repos/asf/ambari/blob/6e2a2855/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEZOOKEEPER/kerberos.json ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEZOOKEEPER/kerberos.json b/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEZOOKEEPER/kerberos.json index c8c55b7..0a64ea5 100644 --- a/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEZOOKEEPER/kerberos.json +++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEZOOKEEPER/kerberos.json @@ -1,7 +1,7 @@ { "services": [ { - "name": "FAKEZOOKEEPER", + "name": "ZOOKEEPER", "identities": [ { "name": "/smokeuser" @@ -9,7 +9,7 @@ ], "components": [ { - "name": "FAKEZOOKEEPER_SERVER", + "name": "ZOOKEEPER_SERVER", "identities": [ { "name": "zookeeper_zk", http://git-wip-us.apache.org/repos/asf/ambari/blob/6e2a2855/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEZOOKEEPER/metainfo.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEZOOKEEPER/metainfo.xml b/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEZOOKEEPER/metainfo.xml index 366ff6e..38bc3c2 100644 --- a/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEZOOKEEPER/metainfo.xml +++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEZOOKEEPER/metainfo.xml @@ -19,7 +19,8 @@ <schemaVersion>2.0</schemaVersion> <services> <service> - <name>FAKEZOOKEEPER</name> + <!-- Note : Service and Component Names are original (not fake) to facilitate AMS dependency on Zk. No Zk Install is done --> + <name>ZOOKEEPER</name> <version>3.4.6.2.3</version> <displayName>FAKEZOOKEEPER</displayName> <comment>Centralized service which provides highly reliable distributed coordination</comment> @@ -27,7 +28,7 @@ <!-- Overwrite the commandScript for each of the components. --> <components> <component> - <name>FAKEZOOKEEPER_SERVER</name> + <name>ZOOKEEPER_SERVER</name> <displayName>FAKEZooKeeper Server</displayName> <category>MASTER</category> <cardinality>1+</cardinality> @@ -40,7 +41,7 @@ </component> <component> - <name>FAKEZOOKEEPER_CLIENT</name> + <name>ZOOKEEPER_CLIENT</name> <displayName>FAKEZooKeeper Client</displayName> <category>CLIENT</category> <cardinality>1+</cardinality> http://git-wip-us.apache.org/repos/asf/ambari/blob/6e2a2855/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEZOOKEEPER/package/scripts/zookeeper_client.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEZOOKEEPER/package/scripts/zookeeper_client.py b/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEZOOKEEPER/package/scripts/zookeeper_client.py index 78cee4d..25b2409 100644 --- a/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEZOOKEEPER/package/scripts/zookeeper_client.py +++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEZOOKEEPER/package/scripts/zookeeper_client.py @@ -32,7 +32,7 @@ class ZookeeperClient(Dummy): def __init__(self): super(ZookeeperClient, self).__init__() - self.component_name = "FAKEZOOKEEPER_CLIENT" + self.component_name = "ZOOKEEPER_CLIENT" if __name__ == "__main__": ZookeeperClient().execute() http://git-wip-us.apache.org/repos/asf/ambari/blob/6e2a2855/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEZOOKEEPER/package/scripts/zookeeper_server.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEZOOKEEPER/package/scripts/zookeeper_server.py b/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEZOOKEEPER/package/scripts/zookeeper_server.py index 4373205..6ab88bb 100644 --- a/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEZOOKEEPER/package/scripts/zookeeper_server.py +++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEZOOKEEPER/package/scripts/zookeeper_server.py @@ -32,7 +32,7 @@ class ZookeeperServer(Dummy): def __init__(self): super(ZookeeperServer, self).__init__() - self.component_name = "FAKEZOOKEEPER_SERVER" + self.component_name = "ZOOKEEPER_SERVER" self.principal_conf_name = "zookeeper-env" self.principal_name = "zookeeper_principal_name" self.keytab_conf_name = "zookeeper-env" http://git-wip-us.apache.org/repos/asf/ambari/blob/6e2a2855/ambari-server/src/main/resources/stacks/PERF/1.0/services/stack_advisor.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/PERF/1.0/services/stack_advisor.py new file mode 100644 index 0000000..43d417e --- /dev/null +++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/stack_advisor.py @@ -0,0 +1,37 @@ +#!/usr/bin/env ambari-python-wrap +""" +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +# Python Imports + +# Local Imports +from resource_management.core.logger import Logger +from stack_advisor import DefaultStackAdvisor + + +class PERF10StackAdvisor(DefaultStackAdvisor): + + def __init__(self): + super(PERF10StackAdvisor, self).__init__() + Logger.initialize_logger() + + def getServiceConfigurationRecommenderDict(self): + return {} + + def getServiceConfigurationValidators(self): + return {} \ No newline at end of file
