You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by jl...@apache.org on 2014/12/19 06:27:10 UTC

[1/6] ambari git commit: AMBARI-8782: Common Services: Refactor HDP-2.2 AMS, KAFKA, KNOX, SLIDER services (Jayush Luniya)

Repository: ambari
Updated Branches:
  refs/heads/trunk 9e22e1731 -> ef7fe6b5c


http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/configuration/users-ldif.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/configuration/users-ldif.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/configuration/users-ldif.xml
deleted file mode 100644
index ace4858..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/configuration/users-ldif.xml
+++ /dev/null
@@ -1,135 +0,0 @@
-<?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 supports_final="false" supports_adding_forbidden="true">
-
-    <property>
-        <name>content</name>
-        <value>
-# 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.
-
-version: 1
-
-# Please replace with site specific values
-dn: dc=hadoop,dc=apache,dc=org
-objectclass: organization
-objectclass: dcObject
-o: Hadoop
-dc: hadoop
-
-# Entry for a sample people container
-# Please replace with site specific values
-dn: ou=people,dc=hadoop,dc=apache,dc=org
-objectclass:top
-objectclass:organizationalUnit
-ou: people
-
-# Entry for a sample end user
-# Please replace with site specific values
-dn: uid=guest,ou=people,dc=hadoop,dc=apache,dc=org
-objectclass:top
-objectclass:person
-objectclass:organizationalPerson
-objectclass:inetOrgPerson
-cn: Guest
-sn: User
-uid: guest
-userPassword:guest-password
-
-# entry for sample user admin
-dn: uid=admin,ou=people,dc=hadoop,dc=apache,dc=org
-objectclass:top
-objectclass:person
-objectclass:organizationalPerson
-objectclass:inetOrgPerson
-cn: Admin
-sn: Admin
-uid: admin
-userPassword:admin-password
-
-# entry for sample user sam
-dn: uid=sam,ou=people,dc=hadoop,dc=apache,dc=org
-objectclass:top
-objectclass:person
-objectclass:organizationalPerson
-objectclass:inetOrgPerson
-cn: sam
-sn: sam
-uid: sam
-userPassword:sam-password
-
-# entry for sample user tom
-dn: uid=tom,ou=people,dc=hadoop,dc=apache,dc=org
-objectclass:top
-objectclass:person
-objectclass:organizationalPerson
-objectclass:inetOrgPerson
-cn: tom
-sn: tom
-uid: tom
-userPassword:tom-password
-
-# create FIRST Level groups branch
-dn: ou=groups,dc=hadoop,dc=apache,dc=org
-objectclass:top
-objectclass:organizationalUnit
-ou: groups
-description: generic groups branch
-
-# create the analyst group under groups
-dn: cn=analyst,ou=groups,dc=hadoop,dc=apache,dc=org
-objectclass:top
-objectclass: groupofnames
-cn: analyst
-description:analyst  group
-member: uid=sam,ou=people,dc=hadoop,dc=apache,dc=org
-member: uid=tom,ou=people,dc=hadoop,dc=apache,dc=org
-
-
-# create the scientist group under groups
-dn: cn=scientist,ou=groups,dc=hadoop,dc=apache,dc=org
-objectclass:top
-objectclass: groupofnames
-cn: scientist
-description: scientist group
-member: uid=sam,ou=people,dc=hadoop,dc=apache,dc=org
-
-        </value>
-        <description>
-            content for users-ldif file for the demo LDAP that comes with Knox.
-        </description>
-    </property>
-</configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/metainfo.xml
index cf118ba..e3adf17 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/metainfo.xml
@@ -20,68 +20,7 @@
   <services>
     <service>
       <name>KNOX</name>
-      <displayName>Knox</displayName>
-      <comment>Provides a single point of authentication and access for Apache Hadoop services in a cluster</comment>
-      <version>0.5.0.2.2</version>
-      <components>
-        <component>
-          <name>KNOX_GATEWAY</name>
-          <displayName>Knox Gateway</displayName>
-          <category>MASTER</category>
-          <cardinality>1+</cardinality>
-          <commandScript>
-            <script>scripts/knox_gateway.py</script>
-            <scriptType>PYTHON</scriptType>
-            <timeout>600</timeout>
-          </commandScript>
-            <customCommands>
-                <customCommand>
-                    <name>STARTDEMOLDAP</name>
-                    <commandScript>
-                        <script>scripts/demo_ldap.py</script>
-                        <scriptType>PYTHON</scriptType>
-                        <timeout>600</timeout>
-                    </commandScript>
-                </customCommand>
-                <customCommand>
-                    <name>STOPDEMOLDAP</name>
-                    <commandScript>
-                        <script>scripts/demo_ldap.py</script>
-                        <scriptType>PYTHON</scriptType>
-                        <timeout>600</timeout>
-                    </commandScript>
-                </customCommand>
-            </customCommands>
-        </component>
-      </components>
-      <osSpecifics>
-        <osSpecific>
-          <osFamily>redhat5,redhat6,suse11</osFamily>
-          <packages>
-            <package>
-              <name>knox_2_2_*</name>
-            </package>
-          </packages>
-        </osSpecific>
-        <osSpecific>
-          <osFamily>ubuntu12</osFamily>
-          <packages>
-            <package>
-              <name>knox-2-2-.*</name>
-            </package>
-          </packages>
-        </osSpecific>
-      </osSpecifics>
-      <commandScript>
-        <script>scripts/service_check.py</script>
-        <scriptType>PYTHON</scriptType>
-        <timeout>300</timeout>
-      </commandScript>
-      <configuration-dependencies>
-        <config-type>gateway-site</config-type>
-        <config-type>gateway-log4j</config-type>
-        <config-type>topology</config-type>
-      </configuration-dependencies>
+      <extends>common-services/KNOX/0.5.0.2.2</extends>
     </service>
   </services>
 </metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/package/files/validateKnoxStatus.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/package/files/validateKnoxStatus.py b/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/package/files/validateKnoxStatus.py
deleted file mode 100644
index 257abfb..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/package/files/validateKnoxStatus.py
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/usr/bin/env python
-"""
-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 optparse
-import socket
-
-#
-# Main.
-#
-def main():
-  parser = optparse.OptionParser(usage="usage: %prog [options]")
-  parser.add_option("-p", "--port", dest="port", help="Port for Knox process")
-  parser.add_option("-n", "--hostname", dest="hostname", help="Hostname of Knox Gateway component")
-
-  (options, args) = parser.parse_args()
-  timeout_seconds = 5
-  try:
-    s = socket.create_connection((options.hostname, int(options.port)),timeout=timeout_seconds)
-    print "Successfully connected to %s on port %s" % (options.hostname, options.port)
-    s.close()
-  except socket.error, e:
-    print "Connection to %s on port %s failed: %s" % (options.hostname, options.port, e)
-    exit(1)
-
-if __name__ == "__main__":
-  main()
-

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/package/scripts/knox.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/package/scripts/knox.py b/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/package/scripts/knox.py
deleted file mode 100644
index 7d7d20c..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/package/scripts/knox.py
+++ /dev/null
@@ -1,85 +0,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.
-
-"""
-
-from resource_management import *
-
-
-def knox():
-    import params
-
-    Directory(params.knox_conf_dir,
-              owner = params.knox_user,
-              group = params.knox_group,
-              recursive = True
-    )
-
-
-    XmlConfig("gateway-site.xml",
-              conf_dir=params.knox_conf_dir,
-              configurations=params.config['configurations']['gateway-site'],
-              configuration_attributes=params.config['configuration_attributes']['gateway-site'],
-              owner=params.knox_user,
-              group=params.knox_group,
-    )
-
-    File(format("{params.knox_conf_dir}/gateway-log4j.properties"),
-         mode=0644,
-         group=params.knox_group,
-         owner=params.knox_user,
-         content=params.gateway_log4j
-    )
-
-    File(format("{params.knox_conf_dir}/topologies/default.xml"),
-         group=params.knox_group,
-         owner=params.knox_user,
-         content=InlineTemplate(params.topology_template)
-    )
-    if params.security_enabled:
-      TemplateConfig( format("{knox_conf_dir}/krb5JAASLogin.conf"),
-                      owner = params.knox_user,
-                      template_tag = None
-      )
-
-    dirs_to_chown = (params.knox_data_dir, params.knox_logs_dir, params.knox_logs_dir, params.knox_pid_dir, params.knox_conf_dir)
-    cmd = ('chown','-R',format('{knox_user}:{knox_group}'))+dirs_to_chown
-    Execute(cmd,
-            sudo = True,
-    )
-    
-    #File([params.knox_data_dir, params.knox_logs_dir, params.knox_logs_dir, params.knox_pid_dir, params.knox_conf_dir],
-    #     owner = params.knox_user,
-    #     group = params.knox_group
-    #)
-
-    cmd = format('{knox_client_bin} create-master --master {knox_master_secret!p}')
-    master_secret_exist = as_user(format('test -f {knox_master_secret_path}'), params.knox_user)
-    
-    Execute(cmd,
-            user=params.knox_user,
-            environment={'JAVA_HOME': params.java_home},
-            not_if=master_secret_exist,
-    )
-
-    cmd = format('{knox_client_bin} create-cert --hostname {knox_host_name_in_cluster}')
-    Execute(cmd,
-            user=params.knox_user,
-            environment={'JAVA_HOME': params.java_home},
-            not_if=master_secret_exist,
-    )
-

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/package/scripts/knox_gateway.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/package/scripts/knox_gateway.py b/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/package/scripts/knox_gateway.py
deleted file mode 100644
index f578926..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/package/scripts/knox_gateway.py
+++ /dev/null
@@ -1,103 +0,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.
-
-"""
-
-from resource_management import *
-import sys
-
-from knox import knox
-from ldap import ldap
-
-class KnoxGateway(Script):
-  def install(self, env):
-    self.install_packages(env)
-    import params
-    env.set_params(params)
-    
-    File(format('{knox_conf_dir}/topologies/sandbox.xml'),
-         action = "delete",
-    )
-
-  def configure(self, env):
-    import params
-    env.set_params(params)
-    knox()
-    ldap()
-
-  def start(self, env):
-    import params
-    env.set_params(params)
-    self.configure(env)
-    daemon_cmd = format('{knox_bin} start')
-    no_op_test = format('ls {knox_pid_file} >/dev/null 2>&1 && ps -p `cat {knox_pid_file}` >/dev/null 2>&1')
-    Execute(daemon_cmd,
-            user=params.knox_user,
-            environment={'JAVA_HOME': params.java_home},
-            not_if=no_op_test
-    )
-
-  def stop(self, env):
-    import params
-    env.set_params(params)
-    self.configure(env)
-    daemon_cmd = format('{knox_bin} stop')
-    Execute(daemon_cmd,
-            environment={'JAVA_HOME': params.java_home},
-            user=params.knox_user,
-    )
-    Execute (format("rm -f {knox_pid_file}"))
-
-
-  def status(self, env):
-    import status_params
-    env.set_params(status_params)
-    check_process_status(status_params.knox_pid_file)
-
-
-  def configureldap(self, env):
-    import params
-    env.set_params(params)
-    ldap()
-
-  def startdemoldap(self, env):
-    import params
-    env.set_params(params)
-    self.configureldap(env)
-    daemon_cmd = format('{ldap_bin} start')
-    no_op_test = format('ls {ldap_pid_file} >/dev/null 2>&1 && ps -p `cat {ldap_pid_file}` >/dev/null 2>&1')
-    Execute(daemon_cmd,
-            user=params.knox_user,
-            environment={'JAVA_HOME': params.java_home},
-            not_if=no_op_test
-    )
-
-  def stopdemoldap(self, env):
-    import params
-    env.set_params(params)
-    self.configureldap(env)
-    daemon_cmd = format('{ldap_bin} stop')
-    Execute(daemon_cmd,
-            environment={'JAVA_HOME': params.java_home},
-            user=params.knox_user,
-            )
-    Execute (format("rm -f {ldap_pid_file}"))
-
-
-
-if __name__ == "__main__":
-  KnoxGateway().execute()

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/package/scripts/ldap.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/package/scripts/ldap.py b/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/package/scripts/ldap.py
deleted file mode 100644
index 2ff8297..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/package/scripts/ldap.py
+++ /dev/null
@@ -1,39 +0,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.
-
-"""
-
-from resource_management import *
-
-
-def ldap():
-    import params
-
-    File(format("{params.knox_conf_dir}/ldap-log4j.properties"),
-         mode=0644,
-         group=params.knox_group,
-         owner=params.knox_user,
-         content=params.ldap_log4j
-    )
-
-    File(format("{params.knox_conf_dir}/users.ldif"),
-         mode=0644,
-         group=params.knox_group,
-         owner=params.knox_user,
-         content=params.users_ldif
-    )
-

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/package/scripts/params.py b/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/package/scripts/params.py
deleted file mode 100644
index 2327a66..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/package/scripts/params.py
+++ /dev/null
@@ -1,139 +0,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.
-
-Ambari Agent
-
-"""
-
-from resource_management.libraries.functions.version import format_hdp_stack_version, compare_versions
-from resource_management import *
-import status_params
-
-config = Script.get_config()
-tmp_dir = Script.get_tmp_dir()
-
-hdp_stack_version = str(config['hostLevelParams']['stack_version'])
-hdp_stack_version = format_hdp_stack_version(hdp_stack_version)
-
-if hdp_stack_version != "" and compare_versions(hdp_stack_version, '2.2') >= 0:
-  knox_bin = '/usr/hdp/current/knox-server/bin/gateway.sh'
-  ldap_bin = '/usr/hdp/current/knox-server/bin/ldap.sh'
-  knox_client_bin = '/usr/hdp/current/knox-server/bin/knoxcli.sh'
-else:
-  knox_bin = '/usr/bin/gateway'
-  ldap_bin = '/usr/lib/knox/bin/ldap.sh'
-  knox_client_bin = '/usr/lib/knox/bin/knoxcli.sh'
-
-namenode_hosts = default("/clusterHostInfo/namenode_host", None)
-if type(namenode_hosts) is list:
-    namenode_host = namenode_hosts[0]
-else:
-    namenode_host = namenode_hosts
-
-has_namenode = not namenode_host == None
-namenode_http_port = "50070"
-namenode_rpc_port = "8020"
-
-if has_namenode:
-    if 'dfs.namenode.http-address' in config['configurations']['hdfs-site']:
-        namenode_http_port = get_port_from_url(config['configurations']['hdfs-site']['dfs.namenode.http-address'])
-    if 'dfs.namenode.rpc-address' in config['configurations']['hdfs-site']:
-        namenode_rpc_port = get_port_from_url(config['configurations']['hdfs-site']['dfs.namenode.rpc-address'])
-
-rm_hosts = default("/clusterHostInfo/rm_host", None)
-if type(rm_hosts) is list:
-    rm_host = rm_hosts[0]
-else:
-    rm_host = rm_hosts
-has_rm = not rm_host == None
-
-jt_rpc_port = "8050"
-rm_port = "8080"
-
-if has_rm:
-    if 'yarn.resourcemanager.address' in config['configurations']['yarn-site']:
-        jt_rpc_port = get_port_from_url(config['configurations']['yarn-site']['yarn.resourcemanager.address'])
-
-    if 'yarn.resourcemanager.webapp.address' in config['configurations']['yarn-site']:
-        rm_port = get_port_from_url(config['configurations']['yarn-site']['yarn.resourcemanager.webapp.address'])
-
-hive_http_port = default('/configurations/hive-site/hive.server2.thrift.http.port', "10001")
-hive_http_path = default('/configurations/hive-site/hive.server2.thrift.http.path', "cliservice")
-hive_server_hosts = default("/clusterHostInfo/hive_server_host", None)
-if type(hive_server_hosts) is list:
-    hive_server_host = hive_server_hosts[0]
-else:
-    hive_server_host = hive_server_hosts
-
-templeton_port = default('/configurations/webhcat-site/templeton.port', "50111")
-webhcat_server_hosts = default("/clusterHostInfo/webhcat_server_host", None)
-if type(webhcat_server_hosts) is list:
-    webhcat_server_host = webhcat_server_hosts[0]
-else:
-    webhcat_server_host = webhcat_server_hosts
-
-hbase_master_port = default('/configurations/hbase-site/hbase.rest.port', "8080")
-hbase_master_hosts = default("/clusterHostInfo/hbase_master_hosts", None)
-if type(hbase_master_hosts) is list:
-    hbase_master_host = hbase_master_hosts[0]
-else:
-    hbase_master_host = hbase_master_hosts
-
-oozie_server_hosts = default("/clusterHostInfo/oozie_server", None)
-if type(oozie_server_hosts) is list:
-    oozie_server_host = oozie_server_hosts[0]
-else:
-    oozie_server_host = oozie_server_hosts
-
-has_oozie = not oozie_server_host == None
-oozie_server_port = "11000"
-
-if has_oozie:
-    if 'oozie.base.url' in config['configurations']['oozie-site']:
-        oozie_server_port = get_port_from_url(config['configurations']['oozie-site']['oozie.base.url'])
-
-
-# server configurations
-knox_conf_dir = '/etc/knox/conf'
-knox_data_dir = '/var/lib/knox/data'
-knox_logs_dir = '/var/log/knox'
-knox_pid_dir = status_params.knox_pid_dir
-knox_user = default("/configurations/knox-env/knox_user", "knox")
-knox_group = default("/configurations/knox-env/knox_group", "knox")
-knox_pid_file = status_params.knox_pid_file
-ldap_pid_file = status_params.ldap_pid_file
-knox_master_secret = config['configurations']['knox-env']['knox_master_secret']
-knox_master_secret_path = '/var/lib/knox/data/security/master'
-knox_cert_store_path = '/var/lib/knox/data/security/keystores/gateway.jks'
-knox_host_name = config['clusterHostInfo']['knox_gateway_hosts'][0]
-knox_host_name_in_cluster = config['hostname']
-knox_host_port = config['configurations']['gateway-site']['gateway.port']
-topology_template = config['configurations']['topology']['content']
-gateway_log4j = config['configurations']['gateway-log4j']['content']
-ldap_log4j = config['configurations']['ldap-log4j']['content']
-users_ldif = config['configurations']['users-ldif']['content']
-java_home = config['hostLevelParams']['java_home']
-security_enabled = config['configurations']['cluster-env']['security_enabled']
-smokeuser = config['configurations']['cluster-env']['smokeuser']
-smoke_user_keytab = config['configurations']['cluster-env']['smokeuser_keytab']
-kinit_path_local = functions.get_kinit_path(["/usr/bin", "/usr/kerberos/bin", "/usr/sbin"])
-if security_enabled:
-  knox_keytab_path = config['configurations']['knox-env']['knox_keytab_path']
-  _hostname_lowercase = config['hostname'].lower()
-  knox_principal_name = config['configurations']['knox-env']['knox_principal_name'].replace('_HOST',_hostname_lowercase)
-
-

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/package/scripts/service_check.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/package/scripts/service_check.py b/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/package/scripts/service_check.py
deleted file mode 100644
index 0349c24..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/package/scripts/service_check.py
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/usr/bin/env python
-"""
-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.
-
-"""
-
-from resource_management import *
-import sys
-
-class KnoxServiceCheck(Script):
-
-    def service_check(self, env):
-        import params
-        env.set_params(params)
-
-        validateKnoxFileName = "validateKnoxStatus.py"
-        validateKnoxFilePath = format("{tmp_dir}/{validateKnoxFileName}")
-        python_executable = sys.executable
-        validateStatusCmd = format("{python_executable} {validateKnoxFilePath} -p {knox_host_port} -n {knox_host_name}")
-        if params.security_enabled:
-          kinit_cmd = format("{kinit_path_local} -kt {smoke_user_keytab} {smokeuser};")
-          smoke_cmd = format("{kinit_cmd} {validateStatusCmd}")
-        else:
-          smoke_cmd = validateStatusCmd
-
-        print "Test connectivity to knox server"
-
-
-        File(validateKnoxFilePath,
-          content=StaticFile(validateKnoxFileName),
-          mode=0755
-          )
-
-        Execute(smoke_cmd,
-          tries=3,
-          try_sleep=5,
-          path='/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin',
-          user=params.smokeuser,
-          timeout=5,
-          logoutput=True
-        )
-
-if __name__ == "__main__":
-    KnoxServiceCheck().execute()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/package/scripts/status_params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/package/scripts/status_params.py b/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/package/scripts/status_params.py
deleted file mode 100644
index 880c617..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/package/scripts/status_params.py
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/usr/bin/env python
-"""
-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.
-
-"""
-
-from resource_management import *
-
-config = Script.get_config()
-
-knox_pid_dir = config['configurations']['knox-env']['knox_pid_dir']
-knox_pid_file = format("{knox_pid_dir}/gateway.pid")
-ldap_pid_file = format("{knox_pid_dir}/ldap.pid")

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/package/templates/krb5JAASLogin.conf.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/package/templates/krb5JAASLogin.conf.j2 b/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/package/templates/krb5JAASLogin.conf.j2
deleted file mode 100644
index fa3237b..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/package/templates/krb5JAASLogin.conf.j2
+++ /dev/null
@@ -1,30 +0,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.
-#}
-com.sun.security.jgss.initiate {
-com.sun.security.auth.module.Krb5LoginModule required
-renewTGT=true
-doNotPrompt=true
-useKeyTab=true
-keyTab="{{knox_keytab_path}}"
-principal="{{knox_principal_name}}"
-isInitiator=true
-storeKey=true
-useTicketCache=true
-client=true;
-};
-

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/configuration/slider-client.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/configuration/slider-client.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/configuration/slider-client.xml
deleted file mode 100644
index fdeceae..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/configuration/slider-client.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-<?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 supports_final="true">
-
-  <!--
-    <property>
-      <name>slider.security.protocol.acl</name>
-      <value>*</value>
-      <description>When security is enabled, set appropriate acl. Default value means allow everyone.</description>
-    </property>
-    -->
-
-  <!--
-     The recommended approach is to configure slider-env.sh and set HADOOP_CONF_DIR.
-     Otherwise, appropriate configurations from hdfs-site, yarn-site, can be dropped in this file
-     for Slider client to work. The following list is not an exhaustive list but the minimal config
-     needed to interact with a non-secure cluster.
-  -->
-
-  <!--
-      <property>
-        <name>yarn.resourcemanager.address</name>
-        <value>localhost:8050</value>
-        <description>The address of the applications manager interface in the RM.</description>
-      </property>
-
-      <property>
-        <name>yarn.resourcemanager.scheduler.address</name>
-        <value>localhost:8030</value>
-        <description>The address of the scheduler interface.</description>
-      </property>
-
-      <property>
-        <name>fs.defaultFS</name>
-        <value>hdfs://localhost:8020</value>
-        <description>The name of the default file system.  Either the
-          literal string "local" or a host:port for NDFS.</description>
-      </property>
-    -->
-
-</configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/configuration/slider-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/configuration/slider-env.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/configuration/slider-env.xml
deleted file mode 100644
index 80c3af1..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/configuration/slider-env.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<?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>
-  <!-- slider-env.sh -->
-  <property>
-    <name>content</name>
-    <description>This is the jinja template for slider-env.sh file</description>
-    <value>
-# Set Slider-specific environment variables here.
-
-# The only required environment variable is JAVA_HOME.  All others are
-# optional.  When running a distributed configuration it is best to
-# set JAVA_HOME in this file, so that it is correctly defined on
-# remote nodes.
-
-# The java implementation to use.  Required.
-export JAVA_HOME={{java64_home}}
-# The hadoop conf directory.  Optional as slider-client.xml can be edited to add properties.
-export HADOOP_CONF_DIR={{hadoop_conf_dir}}
-    </value>
-  </property>
-  
-</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/configuration/slider-log4j.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/configuration/slider-log4j.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/configuration/slider-log4j.xml
deleted file mode 100644
index 709867c..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/configuration/slider-log4j.xml
+++ /dev/null
@@ -1,89 +0,0 @@
-<?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 supports_final="false">
-
-  <property>
-    <name>content</name>
-    <description>Custom log4j.properties</description>
-    <value>
-# 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.
-
-
-# Define some default values that can be overridden by system properties
-log4j.rootLogger=INFO,stdout
-log4j.threshhold=ALL
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-
-# log layout skips stack-trace creation operations by avoiding line numbers and method
-log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601} [%t] %-5p %c{2} - %m%n
-
-# debug edition is much more expensive
-#log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601} [%t] %-5p %c{2} (%F:%M(%L)) - %m%n
-
-
-log4j.appender.subprocess=org.apache.log4j.ConsoleAppender
-log4j.appender.subprocess.layout=org.apache.log4j.PatternLayout
-log4j.appender.subprocess.layout.ConversionPattern=[%c{1}]: %m%n
-#log4j.logger.org.apache.slider.yarn.appmaster.SliderAppMasterer.master=INFO,subprocess
-
-# for debugging Slider
-#log4j.logger.org.apache.slider=DEBUG
-#log4j.logger.org.apache.slider=DEBUG
-
-# uncomment to debug service lifecycle issues
-#log4j.logger.org.apache.hadoop.yarn.service.launcher=DEBUG
-#log4j.logger.org.apache.hadoop.yarn.service=DEBUG
-
-# uncomment for YARN operations
-#log4j.logger.org.apache.hadoop.yarn.client=DEBUG
-
-# uncomment this to debug security problems
-#log4j.logger.org.apache.hadoop.security=DEBUG
-
-#crank back on some noise
-log4j.logger.org.apache.hadoop.util.NativeCodeLoader=ERROR
-log4j.logger.org.apache.hadoop.hdfs=WARN
-
-
-log4j.logger.org.apache.hadoop.yarn.server.nodemanager.containermanager.monitor=WARN
-log4j.logger.org.apache.hadoop.yarn.server.nodemanager.NodeStatusUpdaterImpl=WARN
-log4j.logger.org.apache.zookeeper=WARN
-    </value>
-  </property>
-
-</configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/metainfo.xml
index 6d7dffe..d0e1346 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/metainfo.xml
@@ -20,113 +20,7 @@
   <services>
     <service>
       <name>SLIDER</name>
-      <displayName>Slider</displayName>
-      <comment>A framework for deploying, managing and monitoring existing distributed applications on YARN.</comment>
-      <version>0.60.0.2.2</version>
-      <components>
-        <component>
-          <name>SLIDER</name>
-          <displayName>Slider</displayName>
-          <category>CLIENT</category>
-          <cardinality>0+</cardinality>
-          <dependencies>
-            <dependency>
-              <name>HDFS/HDFS_CLIENT</name>
-              <scope>host</scope>
-              <auto-deploy>
-                <enabled>true</enabled>
-              </auto-deploy>
-            </dependency>
-            <dependency>
-              <name>YARN/YARN_CLIENT</name>
-              <scope>host</scope>
-              <auto-deploy>
-                <enabled>true</enabled>
-              </auto-deploy>
-            </dependency>
-          </dependencies>
-          <commandScript>
-            <script>scripts/slider_client.py</script>
-            <scriptType>PYTHON</scriptType>
-            <timeout>600</timeout>
-          </commandScript>
-          <configFiles>
-            <configFile>
-              <type>xml</type>
-              <fileName>slider-client.xml</fileName>
-              <dictionaryName>slider-client</dictionaryName>
-            </configFile>
-            <configFile>
-              <type>xml</type>
-              <fileName>core-site.xml</fileName>
-              <dictionaryName>core-site</dictionaryName>
-            </configFile>
-            <configFile>
-              <type>xml</type>
-              <fileName>hdfs-site.xml</fileName>
-              <dictionaryName>hdfs-site</dictionaryName>
-            </configFile>
-            <configFile>
-              <type>xml</type>
-              <fileName>yarn-site.xml</fileName>
-              <dictionaryName>yarn-site</dictionaryName>
-            </configFile>
-            <configFile>
-              <type>env</type>
-              <fileName>slider-env.sh</fileName>
-              <dictionaryName>slider-env</dictionaryName>
-            </configFile>
-            <configFile>
-              <type>env</type>
-              <fileName>log4j.properties</fileName>
-              <dictionaryName>slider-log4j</dictionaryName>
-            </configFile>
-          </configFiles>
-        </component>
-      </components>
-      <osSpecifics>
-        <osSpecific>
-          <osFamily>redhat5,redhat6,suse11</osFamily>
-          <packages>
-            <package>
-              <name>slider_2_2_*</name>
-            </package>
-            <package>
-              <name>storm_2_2_*</name>
-            </package>
-          </packages>
-        </osSpecific>
-        <osSpecific>
-          <osFamily>ubuntu12</osFamily>
-          <packages>
-            <package>
-              <name>slider-2-2-.*</name>
-            </package>
-            <package>
-              <name>storm-2-2-.*</name>
-            </package>
-          </packages>
-        </osSpecific>
-      </osSpecifics>
-
-      <commandScript>
-        <script>scripts/service_check.py</script>
-        <scriptType>PYTHON</scriptType>
-        <timeout>300</timeout>
-      </commandScript>
-
-      <requiredServices>
-        <service>YARN</service>
-        <service>HDFS</service>
-        <service>ZOOKEEPER</service>
-      </requiredServices>
-
-      <configuration-dependencies>
-        <config-type>slider-log4j</config-type>
-        <config-type>slider-client</config-type>
-        <config-type>slider-env</config-type>
-      </configuration-dependencies>
-
+      <extends>common-services/SLIDER/0.60.0.2.2</extends>
     </service>
   </services>
 </metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/files/hbaseSmokeVerify.sh
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/files/hbaseSmokeVerify.sh b/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/files/hbaseSmokeVerify.sh
deleted file mode 100644
index 5c320c0..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/files/hbaseSmokeVerify.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/env bash
-#
-#
-# 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.
-#
-#
-conf_dir=$1
-data=$2
-hbase_cmd=$3
-echo "scan 'ambarismoketest'" | $hbase_cmd --config $conf_dir shell > /tmp/hbase_chk_verify
-cat /tmp/hbase_chk_verify
-echo "Looking for $data"
-grep -q $data /tmp/hbase_chk_verify
-if [ "$?" -ne 0 ]
-then
-  exit 1
-fi
-
-grep -q '1 row(s)' /tmp/hbase_chk_verify

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/__init__.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/__init__.py b/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/__init__.py
deleted file mode 100644
index 5561e10..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/__init__.py
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/usr/bin/env python
-"""
-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.
-
-"""

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/params.py b/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/params.py
deleted file mode 100644
index 657feba..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/params.py
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/usr/bin/env python
-"""
-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.
-
-"""
-
-from resource_management.libraries.functions.version import format_hdp_stack_version, compare_versions
-from resource_management import *
-
-# server configurations
-config = Script.get_config()
-
-hdp_stack_version = str(config['hostLevelParams']['stack_version'])
-hdp_stack_version = format_hdp_stack_version(hdp_stack_version)
-
-#hadoop params
-if hdp_stack_version != "" and compare_versions(hdp_stack_version, '2.2') >= 0:
-  slider_bin_dir = '/usr/hdp/current/slider-client/bin'
-else:
-  slider_bin_dir = "/usr/lib/slider/bin"
-
-slider_conf_dir = "/etc/slider/conf"
-hadoop_conf_dir = "/etc/hadoop/conf"
-smokeuser = config['configurations']['cluster-env']['smokeuser']
-security_enabled = config['configurations']['cluster-env']['security_enabled']
-smokeuser_keytab = config['configurations']['cluster-env']['smokeuser_keytab']
-kinit_path_local = functions.get_kinit_path(["/usr/bin", "/usr/kerberos/bin", "/usr/sbin"])
-slider_env_sh_template = config['configurations']['slider-env']['content']
-
-java64_home = config['hostLevelParams']['java_home']
-log4j_props = config['configurations']['slider-log4j']['content']
-slider_cmd = format("{slider_bin_dir}/slider")
-storm_slider_conf_dir= '/usr/hdp/current/storm-slider-client/conf'
-slider_home_dir= '/usr/hdp/current/slider-client'

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/service_check.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/service_check.py b/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/service_check.py
deleted file mode 100644
index bb54dc8..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/service_check.py
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/usr/bin/env python
-"""
-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.
-
-"""
-
-from resource_management import *
-
-
-class SliderServiceCheck(Script):
-  def service_check(self, env):
-    import params
-
-    env.set_params(params)
-
-    smokeuser_kinit_cmd = format(
-      "{kinit_path_local} -kt {smokeuser_keytab} {smokeuser};") if params.security_enabled else ""
-
-    servicecheckcmd = format("{smokeuser_kinit_cmd} {slider_cmd} list")
-
-    Execute(servicecheckcmd,
-            tries=3,
-            try_sleep=5,
-            user=params.smokeuser,
-            logoutput=True
-    )
-
-
-if __name__ == "__main__":
-  SliderServiceCheck().execute()
-  

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/slider.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/slider.py b/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/slider.py
deleted file mode 100644
index 48c534e..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/slider.py
+++ /dev/null
@@ -1,62 +0,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.
-
-Ambari Agent
-
-"""
-import os
-
-from resource_management import *
-
-
-def slider():
-  import params
-
-  Directory(params.slider_conf_dir,
-            recursive=True
-  )
-
-  slider_client_config = params.config['configurations']['slider-client'] if 'configurations' in params.config and 'slider-client' in params.config['configurations'] else {}
-
-  XmlConfig("slider-client.xml",
-            conf_dir=params.slider_conf_dir,
-            configurations=slider_client_config
-  )
-
-  File(format("{slider_conf_dir}/slider-env.sh"),
-       mode=0755,
-       content=InlineTemplate(params.slider_env_sh_template)
-  )
-
-  Directory(params.storm_slider_conf_dir,
-            recursive=True
-  )
-
-  File(format("{storm_slider_conf_dir}/storm-slider-env.sh"),
-       mode=0755,
-       content=Template('storm-slider-env.sh.j2')
-  )
-
-  if (params.log4j_props != None):
-    File(format("{params.slider_conf_dir}/log4j.properties"),
-         mode=0644,
-         content=params.log4j_props
-    )
-  elif (os.path.exists(format("{params.slider_conf_dir}/log4j.properties"))):
-    File(format("{params.slider_conf_dir}/log4j.properties"),
-         mode=0644
-    )

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/slider_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/slider_client.py b/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/slider_client.py
deleted file mode 100644
index cb22a99..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/slider_client.py
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/usr/bin/env python
-"""
-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.
-
-"""
-
-from resource_management import *
-
-from slider import slider
-
-
-class SliderClient(Script):
-  def install(self, env):
-    self.install_packages(env)
-    self.configure(env)
-
-  def configure(self, env):
-    import params
-
-    env.set_params(params)
-
-    slider()
-
-  def status(self, env):
-    raise ClientComponentHasNoStatus()
-
-
-if __name__ == "__main__":
-  SliderClient().execute()

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/templates/storm-slider-env.sh.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/templates/storm-slider-env.sh.j2 b/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/templates/storm-slider-env.sh.j2
deleted file mode 100644
index 8022a4b..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/templates/storm-slider-env.sh.j2
+++ /dev/null
@@ -1,38 +0,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.
-#}
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-#/*
-# * 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.
-# */
-export JAVA_HOME={{java64_home}}
-export SLIDER_HOME={{slider_home_dir}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/test/python/stacks/2.2/KAFKA/test_kafka_broker.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.2/KAFKA/test_kafka_broker.py b/ambari-server/src/test/python/stacks/2.2/KAFKA/test_kafka_broker.py
index 438a590..f157308 100644
--- a/ambari-server/src/test/python/stacks/2.2/KAFKA/test_kafka_broker.py
+++ b/ambari-server/src/test/python/stacks/2.2/KAFKA/test_kafka_broker.py
@@ -21,12 +21,16 @@ from stacks.utils.RMFTestCase import *
 
 
 class TestKafkaBroker(RMFTestCase):
+  COMMON_SERVICES_PACKAGE_DIR = "KAFKA/0.8.1.2.2/package"
+  STACK_VERSION = "2.2"
 
   def test_configure_default(self):
-    self.executeScript("2.2/services/KAFKA/package/scripts/kafka_broker.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/kafka_broker.py",
                          classname = "KafkaBroker",
                          command = "configure",
-                         config_file="default.json"
+                         config_file="default.json",
+                         hdp_stack_version = self.STACK_VERSION,
+                         target = RMFTestCase.TARGET_COMMON_SERVICES
     )
 
     self.assertResourceCalled('Directory', '/var/log/kafka',

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/test/python/stacks/2.2/KNOX/test_knox_gateway.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.2/KNOX/test_knox_gateway.py b/ambari-server/src/test/python/stacks/2.2/KNOX/test_knox_gateway.py
index 7dfaa83..cfea153 100644
--- a/ambari-server/src/test/python/stacks/2.2/KNOX/test_knox_gateway.py
+++ b/ambari-server/src/test/python/stacks/2.2/KNOX/test_knox_gateway.py
@@ -20,12 +20,16 @@ limitations under the License.
 from stacks.utils.RMFTestCase import *
 
 class TestKnoxGateway(RMFTestCase):
+  COMMON_SERVICES_PACKAGE_DIR = "KNOX/0.5.0.2.2/package"
+  STACK_VERSION = "2.2"
 
   def test_configure_default(self):
-    self.executeScript("2.2/services/KNOX/package/scripts/knox_gateway.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/knox_gateway.py",
                        classname = "KnoxGateway",
                        command = "configure",
-                       config_file="default.json"
+                       config_file="default.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
 
     self.assertResourceCalled('Directory', '/etc/knox/conf',

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/test/python/stacks/2.2/SLIDER/test_slider_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.2/SLIDER/test_slider_client.py b/ambari-server/src/test/python/stacks/2.2/SLIDER/test_slider_client.py
index 5b88351..28b1ac1 100644
--- a/ambari-server/src/test/python/stacks/2.2/SLIDER/test_slider_client.py
+++ b/ambari-server/src/test/python/stacks/2.2/SLIDER/test_slider_client.py
@@ -21,12 +21,17 @@ from stacks.utils.RMFTestCase import *
 
 
 class TestSliderClient(RMFTestCase):
+  COMMON_SERVICES_PACKAGE_DIR = "SLIDER/0.60.0.2.2/package"
+  STACK_VERSION = "2.2"
+
   def test_configure_default(self):
     self.maxDiff = None
-    self.executeScript("2.2/services/SLIDER/package/scripts/slider_client.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/slider_client.py",
                        classname="SliderClient",
                        command="configure",
-                       config_file="default.json"
+                       config_file="default.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
 
     self.assertResourceCalled('Directory',
@@ -66,10 +71,12 @@ class TestSliderClient(RMFTestCase):
 
   def test_svc_check_secured(self):
     self.maxDiff = None
-    self.executeScript("2.2/services/SLIDER/package/scripts/service_check.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/service_check.py",
                        classname="SliderServiceCheck",
                        command="service_check",
-                       config_file="secured.json"
+                       config_file="secured.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
 
     self.assertResourceCalled('Execute',
@@ -83,10 +90,12 @@ class TestSliderClient(RMFTestCase):
 
   def test_svc_check_default(self):
     self.maxDiff = None
-    self.executeScript("2.2/services/SLIDER/package/scripts/service_check.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/service_check.py",
                        classname="SliderServiceCheck",
                        command="service_check",
-                       config_file="default.json"
+                       config_file="default.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
 
     self.assertResourceCalled('Execute', ' /usr/lib/slider/bin/slider list',


[2/6] ambari git commit: AMBARI-8782: Common Services: Refactor HDP-2.2 AMS, KAFKA, KNOX, SLIDER services (Jayush Luniya)

Posted by jl...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/templates/hbase_grant_permissions.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/templates/hbase_grant_permissions.j2 b/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/templates/hbase_grant_permissions.j2
deleted file mode 100644
index 3378983..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/templates/hbase_grant_permissions.j2
+++ /dev/null
@@ -1,39 +0,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.
-#}
-
-#
-# 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.
-#
-#
-grant '{{smoke_test_user}}', '{{smokeuser_permissions}}'
-exit
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/templates/hbase_master_jaas.conf.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/templates/hbase_master_jaas.conf.j2 b/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/templates/hbase_master_jaas.conf.j2
deleted file mode 100644
index a93c36c..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/templates/hbase_master_jaas.conf.j2
+++ /dev/null
@@ -1,26 +0,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.
-#}
-
-Client {
-com.sun.security.auth.module.Krb5LoginModule required
-useKeyTab=true
-storeKey=true
-useTicketCache=false
-keyTab="{{master_keytab_path}}"
-principal="{{master_jaas_princ}}";
-};

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/templates/hbase_regionserver_jaas.conf.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/templates/hbase_regionserver_jaas.conf.j2 b/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/templates/hbase_regionserver_jaas.conf.j2
deleted file mode 100644
index 7097481..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/templates/hbase_regionserver_jaas.conf.j2
+++ /dev/null
@@ -1,26 +0,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.
-#}
-
-Client {
-com.sun.security.auth.module.Krb5LoginModule required
-useKeyTab=true
-storeKey=true
-useTicketCache=false
-keyTab="{{regionserver_keytab_path}}"
-principal="{{regionserver_jaas_princ}}";
-};

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/templates/metric_groups.conf.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/templates/metric_groups.conf.j2 b/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/templates/metric_groups.conf.j2
deleted file mode 100644
index aa03d19..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/templates/metric_groups.conf.j2
+++ /dev/null
@@ -1,37 +0,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.
-#}
-
-{
-   "host_metric_groups": {
-      "all": {
-         "collect_every": "10",
-         "metrics": [
-            {
-               "name": "bytes_out",
-               "value_threshold": "128"
-            }
-         ]
-      }
-   },
-   "process_metric_groups": {
-      "": {
-         "collect_every": "15",
-         "metrics": []
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/templates/metric_monitor.ini.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/templates/metric_monitor.ini.j2 b/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/templates/metric_monitor.ini.j2
deleted file mode 100644
index 5e672fc..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/templates/metric_monitor.ini.j2
+++ /dev/null
@@ -1,30 +0,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.
-#}
-
-[default]
-debug_level = INFO
-metrics_server = {{ams_collector_host_single}}:{{ams_collector_port}}
-enable_time_threshold = false
-enable_value_threshold = false
-
-[emitter]
-send_interval = 60
-
-[collector]
-collector_sleep_interval = 5
-max_queue_size = 5000

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/templates/regionservers.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/templates/regionservers.j2 b/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/templates/regionservers.j2
deleted file mode 100644
index fc6cc37..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/templates/regionservers.j2
+++ /dev/null
@@ -1,20 +0,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.
-#}
-
-{% for host in rs_hosts %}{{host}}
-{% endfor %}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/alerts.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/alerts.json b/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/alerts.json
deleted file mode 100644
index 4c9884c..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/alerts.json
+++ /dev/null
@@ -1,32 +0,0 @@
-{
-  "KAFKA": {
-    "service": [],
-    "KAFKA_BROKER": [
-      {
-        "name": "kafka_broker_process",
-        "label": "Kafka Broker Process",
-        "description": "This host-level alert is triggered if the Kafka Broker cannot be determined to be up.",
-        "interval": 1,
-        "scope": "HOST",
-        "source": {
-          "type": "PORT",
-          "uri": "{{kafka-broker/port}}",
-          "default_port": 6667,
-          "reporting": {
-            "ok": {
-              "text": "TCP OK - {0:.3f}s response on port {1}"
-            },
-            "warning": {
-              "text": "TCP OK - {0:.3f}s response on port {1}",
-              "value": 1.5
-            },
-            "critical": {
-              "text": "Connection failed: {0} to {1}:{2}",
-              "value": 5.0
-            }
-          }
-        }
-      }
-    ]
-  }
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/configuration/kafka-broker.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/configuration/kafka-broker.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/configuration/kafka-broker.xml
deleted file mode 100644
index dc1b6b4..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/configuration/kafka-broker.xml
+++ /dev/null
@@ -1,321 +0,0 @@
-<?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>log.dirs</name>
-    <value>/kafka-logs</value>
-    <description>
-      A comma-separated list of one or more directories in which Kafka data is stored.
-      Each new partition that is created will be placed in the directory which currently has the fewest partitions.
-    </description>
-  </property>
-  <property>
-    <name>port</name>
-    <value>6667</value>
-    <description>
-      The port on which the server accepts client connections.
-    </description>
-  </property>
-  <property>
-    <name>zookeeper.connect</name>
-    <value>localhost:2181</value>
-    <description>
-      Zookeeper also allows you to add a "chroot" path which will make all kafka data for this cluster appear under a particular path.
-      This is a way to setup multiple Kafka clusters or other applications on the same zookeeper cluster. To do this give a connection
-      string in the form hostname1:port1,hostname2:port2,hostname3:port3/chroot/path which would put all this cluster's data under the
-      path /chroot/path. Note that you must create this path yourself prior to starting the broker and consumers must use the
-      same connection string.
-    </description>
-  </property>
-  <property>
-    <name>message.max.bytes</name>
-    <value>1000000</value>
-    <description>
-      The maximum size of a message that the server can receive.
-      It is important that this property be in sync with the maximum fetch size your consumers use or
-      else an unruly producer will be able to publish messages too large for consumers to consume.
-    </description>
-  </property>
-  <property>
-    <name>num.network.threads</name>
-    <value>3</value>
-    <description>
-      The number of network threads that the server uses for handling network requests.
-      You probably don't need to change this.
-    </description>
-  </property>
-  <property>
-    <name>num.io.threads</name>
-    <value>8</value>
-    <description>
-      The number of I/O threads that the server uses for executing requests. You should have at least as many threads as you have disks.
-    </description>
-  </property>
-  <property>
-    <name>queued.max.requests</name>
-    <value>500</value>
-    <description>The number of requests that can be queued up for processing by the I/O threads before the network threads stop reading in new requests.</description>
-  </property>
-  <property>
-    <name>socket.send.buffer.bytes</name>
-    <value>102400</value>
-    <description>
-      The SO_SNDBUFF buffer the server prefers for socket connections.
-    </description>
-  </property>
-  <property>
-    <name>socket.receive.buffer.bytes</name>
-    <value>102400</value>
-    <description>
-      The SO_RCVBUFF buffer the server prefers for socket connections.
-    </description>
-  </property>
-  <property>
-    <name>socket.request.max.bytes</name>
-    <value>104857600</value>
-    <description>
-      The maximum request size the server will allow. This prevents the server from running out of memory and should be smaller than the Java heap size.
-    </description>
-  </property>
-  <property>
-    <name>num.partitions</name>
-    <value>1</value>
-    <description>
-       	The default number of partitions per topic.
-    </description>
-  </property>
-  <property>
-    <name>log.segment.bytes</name>
-    <value>1073741824</value>
-    <description>
-      The maximum request size the server will allow.
-      This prevents the server from running out of memory and should be smaller than the Java heap size.
-    </description>
-  </property>
-  <property>
-    <name>log.roll.hours</name>
-    <value>168</value>
-    <description>
-      This setting will force Kafka to roll a new log segment even if the log.segment.bytes size has not been reached.
-    </description>
-  </property>
-  <property>
-    <name>log.retention.bytes</name>
-    <value>-1</value>
-    <description>
-      The amount of data to retain in the log for each topic-partitions. Note that this is the limit per-partition so multiply by the number of partitions to get the total data retained for the topic. Also note that if both log.retention.hours and log.retention.bytes are both set we delete a segment when either limit is exceeded.
-    </description>
-  </property>
-  <property>
-    <name>log.retention.hours</name>
-    <value>168</value>
-    <description>
-      The number of hours to keep a log segment before it is deleted, i.e. the default data retention window for all topics. Note that if both log.retention.hours and log.retention.bytes are both set we delete a segment when either limit is exceeded.
-    </description>
-  </property>
-  <property>
-    <name>log.cleanup.interval.mins</name>
-    <value>10</value>
-    <description>The frequency in minutes that the log cleaner checks whether any log segment is eligible for deletion to meet the retention policies.
-    </description>
-  </property>
-  <property>
-    <name>log.index.size.max.bytes</name>
-    <value>10485760</value>
-    <description>
-      The maximum size in bytes we allow for the offset index for each log segment. Note that we will always pre-allocate a
-      sparse file with this much space and shrink it down when the log rolls. If the index fills up we will roll a new log segment
-      even if we haven't reached the log.segment.bytes limit.
-    </description>
-  </property>
-  <property>
-    <name>log.index.interval.bytes</name>
-    <value>4096</value>
-    <description>
-      The byte interval at which we add an entry to the offset index. When executing a fetch request the server must do a linear scan for up to this many bytes to find the correct position in the log to begin and end the fetch. So setting this value to be larger will mean larger index files (and a bit more memory usage) but less scanning. However the server will never add more than one index entry per log append (even if more than log.index.interval worth of messages are appended). In general you probably don't need to mess with this value.
-    </description>
-  </property>
-  <property>
-    <name>log.flush.interval.messages</name>
-    <value>10000</value>
-    <description>The number of messages written to a log partition before we force an fsync on the log. Setting this higher will improve performance a lot but will increase the window of data at risk in the event of a crash (though that is usually best addressed through replication). If both this setting and log.flush.interval.ms are both used the log will be flushed when either criteria is met.
-    </description>
-  </property>
-  <property>
-    <name>log.flush.scheduler.interval.ms</name>
-    <value>3000</value>
-    <description>
-      The frequency in ms that the log flusher checks whether any log is eligible to be flushed to disk.
-    </description>
-  </property>
-  <property>
-    <name>log.flush.interval.ms</name>
-    <value>3000</value>
-    <description>
-      The maximum time between fsync calls on the log. If used in conjuction with log.flush.interval.messages the log will be flushed when either criteria is met.
-    </description>
-  </property>
-  <property>
-    <name>auto.create.topics.enable</name>
-    <value>true</value>
-    <description>
-      Enable auto creation of topic on the server. If this is set to true then attempts to produce, consume, or fetch metadata for a non-existent topic will automatically create it with the default replication factor and number of partitions.
-    </description>
-  </property>
-  <property>
-    <name>controller.socket.timeout.ms</name>
-    <value>30000</value>
-    <property>The socket timeout for commands from the partition management controller to the replicas.</property>
-  </property>
-  <property>
-    <name>controller.message.queue.size</name>
-    <value>10</value>
-    <description>The buffer size for controller-to-broker-channels</description>
-  </property>
-  <property>
-    <name>default.replication.factor</name>
-    <value>1</value>
-    <description>The default replication factor for automatically created topics.</description>
-  </property>
-  <property>
-    <name>replica.lag.time.max.ms</name>
-    <value>10000</value>
-    <description>If a follower hasn't sent any fetch requests for this window of time, the leader will remove the follower from ISR (in-sync replicas) and treat it as dead.</description>
-  </property>
-  <property>
-    <name>replica.lag.max.messages</name>
-    <value>4000</value>
-    <description>
-      If a replica falls more than this many messages behind the leader, the leader will remove the follower from ISR and treat it as dead.
-    </description>
-  </property>
-  <property>
-    <name>replica.socket.timeout.ms</name>
-    <value>30000</value>
-    <description>The socket timeout for network requests to the leader for replicating data.</description>
-  </property>
-  <property>
-    <name>replica.socket.receive.buffer.bytes</name>
-    <value>65536</value>
-    <description>The socket receive buffer for network requests to the leader for replicating data.</description>
-  </property>
-  <property>
-    <name>replica.fetch.max.bytes</name>
-    <value>1048576</value>
-    <description>The number of byes of messages to attempt to fetch for each partition in the fetch requests the replicas send to the leader.</description>
-  </property>
-  <property>
-    <name>replica.fetch.wait.max.ms</name>
-    <value>500</value>
-    <description>The maximum amount of time to wait time for data to arrive on the leader in the fetch requests sent by the replicas to the leader.</description>
-  </property>
-  <property>
-    <name>replica.fetch.min.bytes</name>
-    <value>1</value>
-    <description>Minimum bytes expected for each fetch response for the fetch requests from the replica to the leader. If not enough bytes, wait up to replica.fetch.wait.max.ms for this many bytes to arrive.
-    </description>
-  </property>
-  <property>
-    <name>num.replica.fetchers</name>
-    <value>1</value>
-    <description>
-      Number of threads used to replicate messages from leaders. Increasing this value can increase the degree of I/O parallelism in the follower broker.
-    </description>
-  </property>
-  <property>
-    <name>replica.high.watermark.checkpoint.interval.ms</name>
-    <value>5000</value>
-    <description>The frequency with which each replica saves its high watermark to disk to handle recovery.</description>
-  </property>
-  <property>
-    <name>fetch.purgatory.purge.interval.requests</name>
-    <value>10000</value>
-    <description>The purge interval (in number of requests) of the fetch request purgatory.</description>
-  </property>
-  <property>
-    <name>producer.purgatory.purge.interval.requests</name>
-    <value>10000</value>
-    <description>The purge interval (in number of requests) of the producer request purgatory.</description>
-  </property>
-  <property>
-    <name>zookeeper.session.timeout.ms</name>
-    <value>6000</value>
-    <description>Zookeeper session timeout. If the server fails to heartbeat to zookeeper within this period of time it is considered dead. If you set this too low the server may be falsely considered dead; if you set it too high it may take too long to recognize a truly dead server.</description>
-  </property>
-  <property>
-    <name>zookeeper.connection.timeout.ms</name>
-    <value>6000</value>
-    <description>The maximum amount of time that the client waits to establish a connection to zookeeper.</description>
-  </property>
-  <property>
-    <name>zookeeper.sync.time.ms</name>
-    <value>2000</value>
-    <description>How far a ZK follower can be behind a ZK leader.</description>
-  </property>
-  <property>
-    <name>controlled.shutdown.enable</name>
-    <value>false</value>
-    <description>Enable controlled shutdown of the broker. If enabled, the broker will move all leaders on it to some other brokers before shutting itself down. This reduces the unavailability window during shutdown.</description>
-  </property>
-  <property>
-    <name>controlled.shutdown.max.retries</name>
-    <value>3</value>
-    <description>Number of retries to complete the controlled shutdown successfully before executing an unclean shutdown.</description>
-  </property>
-  <property>
-    <name>controlled.shutdown.retry.backoff.ms</name>
-    <value>5000</value>
-    <description>
-      Backoff time between shutdown retries.
-    </description>
-  </property>
-  <property>
-    <name>kafka.metrics.reporters</name>
-    <value>kafka.ganglia.KafkaGangliaMetricsReporter</value>
-    <description>
-      kafka ganglia metrics reporter
-    </description>
-  </property>
-  <property>
-    <name>kafka.ganglia.metrics.reporter.enabled</name>
-    <value>true</value>
-    <description>
-      kafka ganglia metrics reporter enable
-    </description>
-  </property>
-  <property>
-    <name>kafka.ganglia.metrics.host</name>
-    <value>localhost</value>
-    <description> Ganglia host </description>
-  </property>
-  <property>
-    <name>kafka.ganglia.metrics.port</name>
-    <value>8671</value>
-    <description> Ganglia port </description>
-  </property>
-  <property>
-    <name>kafka.ganglia.metrics.group</name>
-    <value>kafka</value>
-    <description>Ganglia group name </description>
-  </property>
-</configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/configuration/kafka-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/configuration/kafka-env.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/configuration/kafka-env.xml
deleted file mode 100644
index 7ad4396..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/configuration/kafka-env.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-<?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>kafka_user</name>
-    <value>kafka</value>
-    <property-type>USER</property-type>
-    <description></description>
-  </property>
-  <property>
-    <name>kafka_log_dir</name>
-    <value>/var/log/kafka</value>
-    <description></description>
-  </property>
-  <property>
-    <name>kafka_pid_dir</name>
-    <value>/var/run/kafka</value>
-    <description></description>
-  </property>
-
-  <!-- kafka-env.sh -->
-  <property>
-    <name>content</name>
-    <description>This is the jinja template for kafka-env.sh file</description>
-    <value>
-#!/bin/bash
-
-# Set KAFKA specific environment variables here.
-
-# The java implementation to use.
-export JAVA_HOME={{java64_home}}
-export PATH=$PATH:$JAVA_HOME/bin
-    </value>
-  </property>
-</configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/configuration/kafka-log4j.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/configuration/kafka-log4j.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/configuration/kafka-log4j.xml
deleted file mode 100644
index 901859e..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/configuration/kafka-log4j.xml
+++ /dev/null
@@ -1,116 +0,0 @@
-<?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 supports_final="false">
-
-  <property>
-    <name>content</name>
-    <description>Custom log4j.properties</description>
-    <value>
-#
-#
-# 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.
-#
-#
-#
-kafka.logs.dir=logs
-
-log4j.rootLogger=INFO, stdout
-
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=[%d] %p %m (%c)%n
-
-log4j.appender.kafkaAppender=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.kafkaAppender.DatePattern='.'yyyy-MM-dd-HH
-log4j.appender.kafkaAppender.File=${kafka.logs.dir}/server.log
-log4j.appender.kafkaAppender.layout=org.apache.log4j.PatternLayout
-log4j.appender.kafkaAppender.layout.ConversionPattern=[%d] %p %m (%c)%n
-
-log4j.appender.stateChangeAppender=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.stateChangeAppender.DatePattern='.'yyyy-MM-dd-HH
-log4j.appender.stateChangeAppender.File=${kafka.logs.dir}/state-change.log
-log4j.appender.stateChangeAppender.layout=org.apache.log4j.PatternLayout
-log4j.appender.stateChangeAppender.layout.ConversionPattern=[%d] %p %m (%c)%n
-
-log4j.appender.requestAppender=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.requestAppender.DatePattern='.'yyyy-MM-dd-HH
-log4j.appender.requestAppender.File=${kafka.logs.dir}/kafka-request.log
-log4j.appender.requestAppender.layout=org.apache.log4j.PatternLayout
-log4j.appender.requestAppender.layout.ConversionPattern=[%d] %p %m (%c)%n
-
-log4j.appender.cleanerAppender=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.cleanerAppender.DatePattern='.'yyyy-MM-dd-HH
-log4j.appender.cleanerAppender.File=${kafka.logs.dir}/log-cleaner.log
-log4j.appender.cleanerAppender.layout=org.apache.log4j.PatternLayout
-log4j.appender.cleanerAppender.layout.ConversionPattern=[%d] %p %m (%c)%n
-
-log4j.appender.controllerAppender=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.controllerAppender.DatePattern='.'yyyy-MM-dd-HH
-log4j.appender.controllerAppender.File=${kafka.logs.dir}/controller.log
-log4j.appender.controllerAppender.layout=org.apache.log4j.PatternLayout
-log4j.appender.controllerAppender.layout.ConversionPattern=[%d] %p %m (%c)%n
-
-# Turn on all our debugging info
-#log4j.logger.kafka.producer.async.DefaultEventHandler=DEBUG, kafkaAppender
-#log4j.logger.kafka.client.ClientUtils=DEBUG, kafkaAppender
-#log4j.logger.kafka.perf=DEBUG, kafkaAppender
-#log4j.logger.kafka.perf.ProducerPerformance$ProducerThread=DEBUG, kafkaAppender
-#log4j.logger.org.I0Itec.zkclient.ZkClient=DEBUG
-log4j.logger.kafka=INFO, kafkaAppender
-log4j.logger.kafka.network.RequestChannel$=WARN, requestAppender
-log4j.additivity.kafka.network.RequestChannel$=false
-
-#log4j.logger.kafka.network.Processor=TRACE, requestAppender
-#log4j.logger.kafka.server.KafkaApis=TRACE, requestAppender
-#log4j.additivity.kafka.server.KafkaApis=false
-log4j.logger.kafka.request.logger=WARN, requestAppender
-log4j.additivity.kafka.request.logger=false
-
-log4j.logger.kafka.controller=TRACE, controllerAppender
-log4j.additivity.kafka.controller=false
-
-log4j.logger.kafka.log.LogCleaner=INFO, cleanerAppender
-log4j.additivity.kafka.log.LogCleaner=false
-
-log4j.logger.state.change.logger=TRACE, stateChangeAppender
-log4j.additivity.state.change.logger=false
-
-   </value>
-  </property>
-
-</configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/metainfo.xml
index 8e7aa64..24e4ac8 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/metainfo.xml
@@ -20,63 +20,7 @@
   <services>
     <service>
       <name>KAFKA</name>
-      <displayName>Kafka</displayName>
-      <comment>A high-throughput distributed messaging system</comment>
-      <version>0.8.1.2.2</version>
-      <components>
-        <component>
-          <name>KAFKA_BROKER</name>
-          <displayName>Kafka Broker</displayName>
-          <category>MASTER</category>
-          <cardinality>1+</cardinality>
-          <dependencies>
-            <dependency>
-              <name>ZOOKEEPER/ZOOKEEPER_SERVER</name>
-              <scope>cluster</scope>
-              <auto-deploy>
-                <enabled>true</enabled>
-              </auto-deploy>
-            </dependency>
-          </dependencies>
-          <commandScript>
-            <script>scripts/kafka_broker.py</script>
-            <scriptType>PYTHON</scriptType>
-            <timeout>600</timeout>
-          </commandScript>
-        </component>
-      </components>
-      <osSpecifics>
-        <osSpecific>
-          <osFamily>redhat5,redhat6,suse11</osFamily>
-          <packages>
-            <package>
-              <name>kafka_2_2_*</name>
-            </package>
-          </packages>
-        </osSpecific>
-        <osSpecific>
-          <osFamily>ubuntu12</osFamily>
-          <packages>
-            <package>
-              <name>kafka-2-2-.*</name>
-            </package>
-          </packages>
-        </osSpecific>
-      </osSpecifics>
-      <commandScript>
-        <script>scripts/service_check.py</script>
-        <scriptType>PYTHON</scriptType>
-        <timeout>300</timeout>
-      </commandScript>
-      <requiredServices>
-        <service>ZOOKEEPER</service>
-      </requiredServices>
-      <configuration-dependencies>
-        <config-type>kafka-broker</config-type>
-        <config-type>kafka-env</config-type>
-        <config-type>kafka-log4j</config-type>
-      </configuration-dependencies>
-      <restartRequiredAfterChange>true</restartRequiredAfterChange>
+      <extends>common-services/KAFKA/0.8.1.2.2</extends>
     </service>
   </services>
 </metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/metrics.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/metrics.json b/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/metrics.json
deleted file mode 100644
index 826c0e8..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/metrics.json
+++ /dev/null
@@ -1,262 +0,0 @@
-{
-  "KAFKA_BROKER": {
-    "Component": [
-      {
-        "type": "ganglia",
-        "metrics": {
-          "metrics/jvm/uptime":{
-            "metric":"jvm.uptime",
-            "pointInTime":true,
-            "temporal":true
-          },
-          "metrics/jvm/heap_usage":{
-            "metric":"jvm.heap_usage",
-            "pointInTime":true,
-            "temporal":true
-          },
-          "metrics/jvm/non_heap_usage":{
-            "metric":"jvm.non_heap_usage",
-            "pointInTime":true,
-            "temporal":true
-          },
-          "metrics/jvm/thread-states/runnable":{
-            "metric":"jvm.thread-states.runnable",
-            "pointInTime":true,
-            "temporal":true
-          },
-          "metrics/jvm/thread-states/blocked":{
-            "metric":"jvm.thread-states.blocked",
-            "pointInTime":true,
-            "temporal":true
-          },
-          "metrics/jvm/thread-states/timed_waiting":{
-            "metric":"jvm.thread-states.timed_waiting",
-            "pointInTime":true,
-            "temporal":true
-          },
-          "metrics/jvm/thread-states/terminated":{
-            "metric":"jvm.thread-states.terminated",
-            "pointInTime":true,
-            "temporal":true
-          },
-          "metrics/jvm/thread_count":{
-            "metric":"jvm.thread_count",
-            "pointInTime":true,
-            "temporal":true
-          },
-          "metrics/jvm/daemon_thread_count":{
-            "metric":"jvm.daemon_thread_count",
-            "pointInTime":true,
-            "temporal":true
-          },
-          "metrics/kafka/server/BrokerTopicMetrics/AllTopicsMessagesInPerSec/1MinuteRate": {
-            "metric": "kafka.server.BrokerTopicMetrics.AllTopicsMessagesInPerSec.1MinuteRate",
-            "pointInTime": true,
-            "temporal": true
-          },
-          "metrics/kafka/server/BrokerTopicMetrics/AllTopicsMessagesInPerSec/5MinuteRate": {
-            "metric": "kafka.server.BrokerTopicMetrics.AllTopicsMessagesInPerSec.5MinuteRate",
-            "pointInTime": false,
-            "temporal": true
-          },
-          "metrics/kafka/server/BrokerTopicMetrics/AllTopicsMessagesInPerSec/15MinuteRate": {
-            "metric": "kafka.server.BrokerTopicMetrics.AllTopicsMessagesInPerSec.15MinuteRate",
-            "pointInTime": false,
-            "temporal": true
-          },
-          "metrics/kafka/server/BrokerTopicMetrics/AllTopicsMessagesInPerSec/meanRate": {
-            "metric": "kafka.server.BrokerTopicMetrics/AllTopicsMessagesInPerSec/meanRate",
-            "pointInTime": true,
-            "temporal": true
-          },
-          "metrics/kafka/server/BrokerTopicMetrics/AllTopicsMessagesInPerSec/count": {
-            "metric": "kafka.server.BrokerTopicMetrics/AllTopicsMessagesInPerSec.counte",
-            "pointInTime": true,
-            "temporal": true
-          },
-          "metrics/kafka/server/BrokerTopicMetrics/AllTopicsBytesInPerSec/1MinuteRate": {
-            "metric": "kafka.server.BrokerTopicMetrics.AllTopicsBytesInPerSec.1MinuteRate",
-            "pointInTime": true,
-            "temporal": true
-          },
-          "metrics/kafka/server/BrokerTopicMetrics/AllTopicsBytesInPerSec/5MinuteRate": {
-            "metric": "kafka.server.BrokerTopicMetrics.AllTopicsBytesInPerSec.5MinuteRate",
-            "pointInTime": true,
-            "temporal": true
-          },
-          "metrics/kafka/server/BrokerTopicMetrics/AllTopicsBytesInPerSec/15MinuteRate": {
-            "metric": "kafka.server.BrokerTopicMetrics.AllTopicsBytesInPerSec.15MinuteRate",
-            "pointInTime": true,
-            "temporal": true
-          },
-          "metrics/kafka/server/BrokerTopicMetrics/AllTopicsBytesInPerSec/meanRate": {
-            "metric": "kafka.server.BrokerTopicMetrics.AllTopicsBytesInPerSec.meanRate",
-            "pointInTime": true,
-            "temporal": true
-          },
-          "metrics/kafka/server/BrokerTopicMetrics/AllTopicsBytesInPerSec/count": {
-            "metric": "kafka.server.BrokerTopicMetrics.AllTopicsBytesInPerSec.count",
-            "pointInTime": true,
-            "temporal": true
-          },
-          "metrics/kafka/server/BrokerTopicMetrics/AllTopicsBytesOutPerSec/1MinuteRate": {
-            "metric": "kafka.server.BrokerTopicMetrics.AllTopicsBytesOutPerSec.1MinuteRate",
-            "pointInTime": true,
-            "temporal": true
-          },
-          "metrics/kafka/server/BrokerTopicMetrics/AllTopicsBytesOutPerSec/5MinuteRate": {
-            "metric": "kafka.server.BrokerTopicMetrics.AllTopicsBytesOutPerSec.5MinuteRate",
-            "pointInTime": true,
-            "temporal": true
-          },
-          "metrics/kafka/server/BrokerTopicMetrics/AllTopicsBytesOutPerSec/15MinuteRate": {
-            "metric": "kafka.server.BrokerTopicMetrics.AllTopicsBytesOutPerSec.15MinuteRate",
-            "pointInTime": true,
-            "temporal": true
-          },
-          "metrics/kafka/server/BrokerTopicMetrics/AllTopicsBytesOutPerSec/meanRate": {
-            "metric": "kafka.server.BrokerTopicMetrics.AllTopicsBytesOutPerSec.meanRate",
-            "pointInTime": true,
-            "temporal": true
-          },
-          "metrics/kafka/server/BrokerTopicMetrics/AllTopicsBytesOutPerSec/count": {
-            "metric": "kafka.server.BrokerTopicMetrics.AllTopicsBytesOutPerSec.count",
-            "pointInTime": true,
-            "temporal": true
-          },
-          "metrics/kafka/controller/KafkaController/ActiveControllerCount": {
-            "metric": "kafka.controller.KafkaController.ActiveControllerCount",
-            "pointInTime": true,
-            "temporal": true
-          },
-          "metrics/kafka/log/LogFlushStats/LogFlushRateAndTimeMs/meanRate": {
-            "metric": "kafka.log.LogFlushStats.LogFlushRateAndTimeMs.meanRate",
-            "pointInTime": true,
-            "temporal": true
-          },
-          "metrics/kafka/log/LogFlushStats/LogFlushRateAndTimeMs/1MinuteRate": {
-            "metric": "kafka.log.LogFlushStats.LogFlushRateAndTimeMs.1MinuteRate",
-            "pointInTime": true,
-            "temporal": true
-          },
-          "metrics/kafka/log/LogFlushStats/LogFlushRateAndTimeMs/5MinuteRate": {
-            "metric": "kafka.log.LogFlushStats.LogFlushRateAndTimeMs.1MinuteRate",
-            "pointInTime": true,
-            "temporal": true
-          },
-          "metrics/kafka/log/LogFlushStats/LogFlushRateAndTimeMs/15MinuteRate": {
-            "metric": "kafka.log.LogFlushStats.LogFlushRateAndTimeMs.15MinuteRate",
-            "pointInTime": true,
-            "temporal": true
-          },
-          "metrics/kafka/log/LogFlushStats/LogFlushRateAndTimeMs/count": {
-            "metric": "kafka.log.LogFlushStats.LogFlushRateAndTimeMs.count",
-            "pointInTime": true,
-            "temporal": true
-          },
-          "metrics/kafka/controller/ControllerStats/LeaderElectionRateAndTimeMs/meanRate": {
-            "metric": "kafka.controller.ControllerStats.LeaderElectionRateAndTimeMs.meanRate",
-            "pointInTime": true,
-            "temporal": true
-          },
-          "metrics/kafka/controller/ControllerStats/LeaderElectionRateAndTimeMs/1MinuteRate": {
-            "metric": "kafka.controller.ControllerStats.LeaderElectionRateAndTimeMs.1MinuteRate",
-            "pointInTime": true,
-            "temporal": true
-          },
-          "metrics/kafka/controller/ControllerStats/LeaderElectionRateAndTimeMs/5MinuteRate": {
-            "metric": "kafka.controller.ControllerStats.LeaderElectionRateAndTimeMs.5MinuteRate",
-            "pointInTime": true,
-            "temporal": true
-          },
-          "metrics/kafka/controller/ControllerStats/LeaderElectionRateAndTimeMs/15MinuteRate": {
-            "metric": "kafka.controller.ControllerStats.LeaderElectionRateAndTimeMs.15MinuteRate",
-            "pointInTime": true,
-            "temporal": true
-          },
-          "metrics/kafka/controller/ControllerStats/LeaderElectionRateAndTimeMs/count": {
-            "metric": "kafka.controller.ControllerStats.LeaderElectionRateAndTimeMs.count",
-            "pointInTime": true,
-            "temporal": true
-          },
-          "metrics/kafka/controller/ControllerStats/UncleanLeaderElectionsPerSec/1MinuteRate": {
-            "metric": "kafka.controller.ControllerStats.UncleanLeaderElectionsPerSec.1MinuteRate",
-            "pointInTime": true,
-            "temporal": true
-          },
-          "metrics/kafka/controller/ControllerStats/UncleanLeaderElectionsPerSec/5MinuteRate": {
-            "metric": "kafka.controller.ControllerStats.UncleanLeaderElectionsPerSec.5MinuteRate",
-            "pointInTime": true,
-            "temporal": true
-          },
-          "metrics/kafka/controller/ControllerStats/UncleanLeaderElectionsPerSec/15MinuteRate": {
-            "metric": "kafka.controller.ControllerStats.UncleanLeaderElectionsPerSec.15MinuteRate",
-            "pointInTime": true,
-            "temporal": true
-          },
-          "metrics/kafka/controller/ControllerStats/OfflinePartitionsCount": {
-              "metric": "kafka.controller.ControllerStats.OfflinePartitionsCount",
-              "pointInTime" :true,
-              "temporal": true
-          },
-          "metrics/kafka/server/ReplicaManager/PartitionCount": {
-              "metric": "kafka.server.ReplicaManager.PartitionCount",
-              "pointInTime" : true,
-              "temporal": true
-          },
-          "metrics/kafka/server/ReplicaManager/LeaderCount": {
-              "metric": "kafka.server.ReplicaManager.LeaderCount",
-              "pointInTime" : true,
-              "temporal": true
-          },
-          "metrics/kafka/server/ReplicaManager/UnderReplicatedPartitions": {
-              "metric": "kafka.server.ReplicaManager.UnderReplicatedPartitions",
-              "pointInTime" :true,
-              "temporal": true
-          },
-          "metrics/kafka/server/ReplicaManager/ISRShrinksPerSec": {
-              "metric": "kafka.server.ReplicaManager.ISRShrinksPerSec",
-              "pointInTime" : true,
-              "temporal": true
-          },
-          "metrics/kafka/server/ReplicaManager/ISRExpandsPerSec": {
-              "metric": "kafka.server.ReplicaManager.ISRExpandsPerSec",
-              "pointInTime" : true,
-              "temporal": true
-          },
-
-          "metrics/kafka/server/ReplicaFetcherManager/Replica-MaxLag": {
-              "metric": "kafka.server.ReplicaFetcherManager.Replica-MaxLag",
-              "pointInTime" : true,
-              "temporal": true
-          },
-          "metrics/kafka/server/ProducerRequestPurgatory/PurgatorySize": {
-              "metric": "kafka.server.ProducerRequestPurgatory.PurgatorySize",
-              "pointInTime" : true,
-              "temporal": true
-          },
-          "metrics/kafka/server/FetchRequestPurgatory/PurgatorySize": {
-              "metric": "kafka.server.FetchRequestPurgatory.PurgatorySize",
-              "pointInTime" : true,
-              "temporal": true
-          },
-          "metrics/kafka/cluster/Partition/$1-UnderReplicated":{
-            "metric":"kafka.cluster.Partition.(\\w+)-UnderReplicated",
-            "pointInTime":true,
-            "temporal":true
-          },
-          "metrics/kafka/consumer/ConsumerFetcherManager/$1-MaxLag":{
-            "metric":"kafka.consumer.ConsumerFetcherManager.(\\w+)-MaxLag",
-            "pointInTime":true,
-            "temporal":true
-          },
-          "metrics/kafka/consumer/ConsumerFetcherManager/$1-MinFetch":{
-            "metric":"kafka.consumer.ConsumerFetcherManager.(\\w+)-MinFetch",
-            "pointInTime":true,
-            "temporal":true
-          }
-        }
-      }
-    ]
-  }
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/package/scripts/kafka.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/package/scripts/kafka.py b/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/package/scripts/kafka.py
deleted file mode 100644
index c0231a8..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/package/scripts/kafka.py
+++ /dev/null
@@ -1,70 +0,0 @@
-#!/usr/bin/env python
-"""
-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.
-
-"""
-
-from resource_management import *
-from properties_config import properties_config
-import sys
-from copy import deepcopy
-
-def kafka():
-    import params
-
-    Directory([params.log_dir, params.pid_dir, params.conf_dir],
-              owner=params.kafka_user,
-              group=params.user_group,
-              recursive=True
-          )
-    brokerid = str(sorted(params.kafka_hosts).index(params.hostname))
-    kafka_server_config = mutable_config_dict(params.config['configurations']['kafka-broker'])
-    kafka_server_config['broker.id'] = brokerid
-    kafka_server_config['host.name'] = params.hostname
-    kafka_data_dir = kafka_server_config['log.dirs']
-    Directory(filter(None,kafka_data_dir.split(",")),
-              owner=params.kafka_user,
-              group=params.user_group,
-              recursive=True)
-
-    conf_dir = params.conf_dir
-    properties_config("server.properties",
-                      conf_dir=params.conf_dir,
-                      configurations=kafka_server_config,
-                      owner=params.kafka_user,
-                      group=params.user_group,
-                      brokerid=brokerid)
-
-    File(format("{conf_dir}/kafka-env.sh"),
-          owner=params.kafka_user,
-          content=InlineTemplate(params.kafka_env_sh_template)
-     )
-
-    if (params.log4j_props != None):
-        File(format("{conf_dir}/log4j.properties"),
-             mode=0644,
-             group=params.user_group,
-             owner=params.kafka_user,
-             content=params.log4j_props
-         )
-
-
-def mutable_config_dict(kafka_broker_config):
-    kafka_server_config = {}
-    for key, value in kafka_broker_config.iteritems():
-        kafka_server_config[key] = value
-    return kafka_server_config

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/package/scripts/kafka_broker.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/package/scripts/kafka_broker.py b/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/package/scripts/kafka_broker.py
deleted file mode 100644
index c79ebb9..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/package/scripts/kafka_broker.py
+++ /dev/null
@@ -1,63 +0,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.
-
-"""
-
-from resource_management import *
-import sys
-
-from kafka import kafka
-
-class KafkaBroker(Script):
-  def install(self, env):
-    self.install_packages(env)
-    self.configure(env)
-
-  def configure(self, env):
-    import params
-    env.set_params(params)
-    kafka()
-
-  def start(self, env):
-    import params
-    env.set_params(params)
-    self.configure(env)
-    daemon_cmd = format('source {params.conf_dir}/kafka-env.sh ; {params.kafka_bin} start')
-    no_op_test = format('ls {params.pid_file} >/dev/null 2>&1 && ps -p `cat {params.pid_file}` >/dev/null 2>&1')
-    Execute(daemon_cmd,
-            user=params.kafka_user,
-            not_if=no_op_test
-    )
-
-  def stop(self, env):
-    import params
-    env.set_params(params)
-    self.configure(env)
-    daemon_cmd = format('source {params.conf_dir}/kafka-env.sh; {params.kafka_bin} stop')
-    Execute(daemon_cmd,
-            user=params.kafka_user,
-    )
-    Execute (format("rm -f {params.pid_file}"))
-
-
-  def status(self, env):
-    import status_params
-    env.set_params(status_params)
-    check_process_status(status_params.kafka_pid_file)
-
-if __name__ == "__main__":
-  KafkaBroker().execute()

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/package/scripts/params.py b/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/package/scripts/params.py
deleted file mode 100644
index dc98526..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/package/scripts/params.py
+++ /dev/null
@@ -1,57 +0,0 @@
-#!/usr/bin/env python
-"""
-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.
-
-"""
-
-from resource_management.libraries.functions.version import format_hdp_stack_version, compare_versions
-from resource_management import *
-import status_params
-
-# server configurations
-config = Script.get_config()
-
-hdp_stack_version = str(config['hostLevelParams']['stack_version'])
-hdp_stack_version = format_hdp_stack_version(hdp_stack_version)
-
-if hdp_stack_version != "" and compare_versions(hdp_stack_version, '2.2') >= 0:
-    kafka_home = '/usr/hdp/current/kafka-broker/'
-    kafka_bin = kafka_home+'bin/kafka'
-else:
-    kafka_home = '/usr/lib/kafka/'
-    kafka_bin = kafka_home+'/bin/kafka'
-
-
-conf_dir = "/etc/kafka/conf"
-kafka_user = config['configurations']['kafka-env']['kafka_user']
-log_dir = config['configurations']['kafka-env']['kafka_log_dir']
-pid_dir = status_params.kafka_pid_dir
-pid_file = pid_dir+"/kafka.pid"
-hostname = config['hostname']
-user_group = config['configurations']['cluster-env']['user_group']
-java64_home = config['hostLevelParams']['java_home']
-kafka_env_sh_template = config['configurations']['kafka-env']['content']
-kafka_hosts = config['clusterHostInfo']['kafka_broker_hosts']
-kafka_hosts.sort()
-
-zookeeper_hosts = config['clusterHostInfo']['zookeeper_hosts']
-zookeeper_hosts.sort()
-
-if (('kafka-log4j' in config['configurations']) and ('content' in config['configurations']['kafka-log4j'])):
-    log4j_props = config['configurations']['kafka-log4j']['content']
-else:
-    log4j_props = None

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/package/scripts/properties_config.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/package/scripts/properties_config.py b/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/package/scripts/properties_config.py
deleted file mode 100644
index 56bab2c..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/package/scripts/properties_config.py
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/usr/bin/env python
-"""
-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 re
-from resource_management import *
-
-def properties_inline_template(configurations):
-  return source.InlineTemplate('''{% for key, value in configurations_dict.items() %}{{ key }}={{ value }}
-{% endfor %}''', configurations_dict=configurations)
-
-def properties_config(filename, configurations = None, conf_dir = None,
-                      mode = None, owner = None, group = None, brokerid = None):
-    config_content = properties_inline_template(configurations)
-    File (format("{conf_dir}/{filename}"), content = config_content, owner = owner,
-          group = group, mode = mode)

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/package/scripts/service_check.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/package/scripts/service_check.py b/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/package/scripts/service_check.py
deleted file mode 100644
index c2b4bc1..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/package/scripts/service_check.py
+++ /dev/null
@@ -1,65 +0,0 @@
-#!/usr/bin/env python
-"""
-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.
-
-"""
-from __future__ import print_function
-from resource_management import *
-import  sys,subprocess,os
-
-class ServiceCheck(Script):
-    def service_check(self, env):
-        import params
-        env.set_params(params)
-        kafka_config=self.read_kafka_config(params.conf_dir)
-        self.set_env(params.conf_dir)
-        create_topic_cmd_created_output = "Created topic \"ambari_kafka_service_check\"."
-        create_topic_cmd_exists_output = "Topic \"ambari_kafka_service_check\" already exists."
-	print("Running kafka create topic command", file=sys.stdout)
-        create_topic_cmd = [params.kafka_home+'/bin/kafka-topics.sh', '--zookeeper '+kafka_config['zookeeper.connect'],
-                            '--create --topic ambari_kafka_service_check', '--partitions 1 --replication-factor 1']
-	print(" ".join(create_topic_cmd), file=sys.stdout)
-        create_topic_process = subprocess.Popen(create_topic_cmd,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
-        out, err = create_topic_process.communicate()
-        if out.find(create_topic_cmd_created_output) != -1:
-	    print(out, file=sys.stdout)
-            sys.exit(0)
-        elif out.find(create_topic_cmd_exists_output) != -1:
-            print("Topic ambari_kafka_service_check exists", file=sys.stdout)
-            sys.exit(0)
-        else:
-	    print(out, file=sys.stderr)
-            sys.exit(1)
-
-    def read_kafka_config(self,kafka_conf_dir):
-        conf_file = open(kafka_conf_dir+"/server.properties","r")
-        kafka_config = {}
-        for line in conf_file:
-            key,value = line.split("=")
-            kafka_config[key] = value.replace("\n","")
-        return kafka_config
-
-    def set_env(self, kafka_conf_dir):
-        command = ['bash', '-c', 'source '+kafka_conf_dir+'/kafka-env.sh && env']
-        proc = subprocess.Popen(command, stdout = subprocess.PIPE)
-        for line in proc.stdout:
-            (key, _, value) = line.partition("=")
-            os.environ[key] = value.replace("\n","")
-        proc.communicate()
-
-if __name__ == "__main__":
-    ServiceCheck().execute()

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/package/scripts/status_params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/package/scripts/status_params.py b/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/package/scripts/status_params.py
deleted file mode 100644
index fcb0816..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/package/scripts/status_params.py
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/usr/bin/env python
-"""
-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.
-
-"""
-
-from resource_management import *
-
-config = Script.get_config()
-
-kafka_pid_dir = config['configurations']['kafka-env']['kafka_pid_dir']
-kafka_pid_file = format("{kafka_pid_dir}/kafka.pid")

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/alerts.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/alerts.json b/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/alerts.json
deleted file mode 100644
index e063da7..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/alerts.json
+++ /dev/null
@@ -1,32 +0,0 @@
-{
-  "KNOX": {
-    "service": [],
-    "KNOX_GATEWAY": [
-      {
-        "name": "knox_gateway_process",
-        "label": "Know Gateway Process",
-        "description": "This host-level alert is triggered if the Knox Gateway cannot be determined to be up.",
-        "interval": 1,
-        "scope": "HOST",
-        "source": {
-          "type": "PORT",
-          "uri": "{{gateway-site/gateway.port}}",
-          "default_port": 8443,
-          "reporting": {
-            "ok": {
-              "text": "TCP OK - {0:.3f}s response on port {1}"
-            },
-            "warning": {
-              "text": "TCP OK - {0:.3f}s response on port {1}",
-              "value": 1.5
-            },
-            "critical": {
-              "text": "Connection failed: {0} to {1}:{2}",
-              "value": 5.0
-            }
-          }
-        }
-      }
-    ]
-  }
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/configuration/gateway-log4j.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/configuration/gateway-log4j.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/configuration/gateway-log4j.xml
deleted file mode 100644
index 370f786..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/configuration/gateway-log4j.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-<?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 supports_final="false">
-
-  <property>
-    <name>content</name>
-    <value>
-
-      # 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.
-
-      app.log.dir=${launcher.dir}/../logs
-      app.log.file=${launcher.name}.log
-      app.audit.file=${launcher.name}-audit.log
-
-      log4j.rootLogger=ERROR, drfa
-
-      log4j.logger.org.apache.hadoop.gateway=INFO
-      #log4j.logger.org.apache.hadoop.gateway=DEBUG
-
-      #log4j.logger.org.eclipse.jetty=DEBUG
-      #log4j.logger.org.apache.shiro=DEBUG
-      #log4j.logger.org.apache.http=DEBUG
-      #log4j.logger.org.apache.http.client=DEBUG
-      #log4j.logger.org.apache.http.headers=DEBUG
-      #log4j.logger.org.apache.http.wire=DEBUG
-
-      log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-      log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-      log4j.appender.stdout.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{2}: %m%n
-
-      log4j.appender.drfa=org.apache.log4j.DailyRollingFileAppender
-      log4j.appender.drfa.File=${app.log.dir}/${app.log.file}
-      log4j.appender.drfa.DatePattern=.yyyy-MM-dd
-      log4j.appender.drfa.layout=org.apache.log4j.PatternLayout
-      log4j.appender.drfa.layout.ConversionPattern=%d{ISO8601} %-5p %c{2} (%F:%M(%L)) - %m%n
-
-      log4j.logger.audit=INFO, auditfile
-      log4j.appender.auditfile=org.apache.log4j.DailyRollingFileAppender
-      log4j.appender.auditfile.File=${app.log.dir}/${app.audit.file}
-      log4j.appender.auditfile.Append = true
-      log4j.appender.auditfile.DatePattern = '.'yyyy-MM-dd
-      log4j.appender.auditfile.layout = org.apache.hadoop.gateway.audit.log4j.layout.AuditLayout
-
-    </value>
-    <description>
-      content for log4j.properties file for Knox.
-    </description>
-  </property>
-</configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/configuration/gateway-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/configuration/gateway-site.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/configuration/gateway-site.xml
deleted file mode 100644
index 4d4c4ed..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/configuration/gateway-site.xml
+++ /dev/null
@@ -1,72 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-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.
--->
-
-<!-- The default settings for Knox. -->
-<!-- Edit gateway-site.xml to change settings for your local -->
-<!-- install. -->
-
-<configuration supports_final="false">
-
-    <property>
-        <name>gateway.port</name>
-        <value>8443</value>
-        <description>The HTTP port for the Gateway.</description>
-    </property>
-
-    <property>
-        <name>gateway.path</name>
-        <value>gateway</value>
-        <description>The default context path for the gateway.</description>
-    </property>
-
-    <property>
-        <name>gateway.gateway.conf.dir</name>
-        <value>deployments</value>
-        <description>The directory within GATEWAY_HOME that contains gateway topology files and deployments.</description>
-    </property>
-
-    <property>
-        <name>gateway.hadoop.kerberos.secured</name>
-        <value>false</value>
-        <description>Boolean flag indicating whether the Hadoop cluster protected by Gateway is secured with Kerberos</description>
-    </property>
-
-    <property>
-        <name>java.security.krb5.conf</name>
-        <value>/etc/knox/conf/krb5.conf</value>
-        <description>Absolute path to krb5.conf file</description>
-    </property>
-
-    <property>
-        <name>java.security.auth.login.config</name>
-        <value>/etc/knox/conf/krb5JAASLogin.conf</value>
-        <description>Absolute path to JASS login config file</description>
-    </property>
-
-    <property>
-        <name>sun.security.krb5.debug</name>
-        <value>true</value>
-        <description>Boolean flag indicating whether to enable debug messages for krb5 authentication</description>
-    </property>
-
-</configuration>
-
-
-
-

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/configuration/knox-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/configuration/knox-env.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/configuration/knox-env.xml
deleted file mode 100644
index 871d0c0..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/configuration/knox-env.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<?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 supports_final="true">
-    <!-- knox-env.sh -->
-
-    <property require-input="true">
-        <name>knox_master_secret</name>
-        <value></value>
-        <property-type>PASSWORD</property-type>
-        <description>password to use as the master secret</description>
-    </property>
-
-    <property>
-        <name>knox_user</name>
-        <value>knox</value>
-        <property-type>USER</property-type>
-        <description>Knox Username.</description>
-    </property>
-
-    <property>
-        <name>knox_group</name>
-        <value>knox</value>
-        <property-type>GROUP</property-type>
-        <description>Knox Group.</description>
-    </property>
-
-    <property>
-        <name>knox_pid_dir</name>
-        <value>/var/run/knox</value>
-        <description>Knox PID dir.</description>
-    </property>
-
-</configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/configuration/ldap-log4j.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/configuration/ldap-log4j.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/configuration/ldap-log4j.xml
deleted file mode 100644
index a0cf658..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/configuration/ldap-log4j.xml
+++ /dev/null
@@ -1,66 +0,0 @@
-<?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 supports_final="false">
-
-  <property>
-    <name>content</name>
-    <value>
-        # 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.
-
-        app.log.dir=${launcher.dir}/../logs
-        app.log.file=${launcher.name}.log
-
-        log4j.rootLogger=ERROR, drfa
-        log4j.logger.org.apache.directory.server.ldap.LdapServer=INFO
-        log4j.logger.org.apache.directory=WARN
-
-        log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-        log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-        log4j.appender.stdout.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{2}: %m%n
-
-        log4j.appender.drfa=org.apache.log4j.DailyRollingFileAppender
-        log4j.appender.drfa.File=${app.log.dir}/${app.log.file}
-        log4j.appender.drfa.DatePattern=.yyyy-MM-dd
-        log4j.appender.drfa.layout=org.apache.log4j.PatternLayout
-        log4j.appender.drfa.layout.ConversionPattern=%d{ISO8601} %-5p %c{2} (%F:%M(%L)) - %m%n
-
-    </value>
-    <description>
-      content for log4j.properties file for the demo LDAP that comes with Knox.
-    </description>
-  </property>
-</configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/configuration/topology.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/configuration/topology.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/configuration/topology.xml
deleted file mode 100644
index db16a21..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/configuration/topology.xml
+++ /dev/null
@@ -1,116 +0,0 @@
-<?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 supports_final="false" supports_adding_forbidden="true">
-    <!-- topology file -->
-
-    <property>
-    <name>content</name>
-    <value>
-        &lt;topology&gt;
-
-            &lt;gateway&gt;
-
-                &lt;provider&gt;
-                    &lt;role&gt;authentication&lt;/role&gt;
-                    &lt;name&gt;ShiroProvider&lt;/name&gt;
-                    &lt;enabled&gt;true&lt;/enabled&gt;
-                    &lt;param&gt;
-                        &lt;name&gt;sessionTimeout&lt;/name&gt;
-                        &lt;value&gt;30&lt;/value&gt;
-                    &lt;/param&gt;
-                    &lt;param&gt;
-                        &lt;name&gt;main.ldapRealm&lt;/name&gt;
-                        &lt;value&gt;org.apache.hadoop.gateway.shirorealm.KnoxLdapRealm&lt;/value&gt;
-                    &lt;/param&gt;
-                    &lt;param&gt;
-                        &lt;name&gt;main.ldapRealm.userDnTemplate&lt;/name&gt;
-                        &lt;value&gt;uid={0},ou=people,dc=hadoop,dc=apache,dc=org&lt;/value&gt;
-                    &lt;/param&gt;
-                    &lt;param&gt;
-                        &lt;name&gt;main.ldapRealm.contextFactory.url&lt;/name&gt;
-                        &lt;value&gt;ldap://{{knox_host_name}}:33389&lt;/value&gt;
-                    &lt;/param&gt;
-                    &lt;param&gt;
-                        &lt;name&gt;main.ldapRealm.contextFactory.authenticationMechanism&lt;/name&gt;
-                        &lt;value&gt;simple&lt;/value&gt;
-                    &lt;/param&gt;
-                    &lt;param&gt;
-                        &lt;name&gt;urls./**&lt;/name&gt;
-                        &lt;value&gt;authcBasic&lt;/value&gt;
-                    &lt;/param&gt;
-                &lt;/provider&gt;
-
-                &lt;provider&gt;
-                    &lt;role&gt;identity-assertion&lt;/role&gt;
-                    &lt;name&gt;Default&lt;/name&gt;
-                    &lt;enabled&gt;true&lt;/enabled&gt;
-                &lt;/provider&gt;
-
-            &lt;/gateway&gt;
-
-            &lt;service&gt;
-                &lt;role&gt;NAMENODE&lt;/role&gt;
-                &lt;url&gt;hdfs://{{namenode_host}}:{{namenode_rpc_port}}&lt;/url&gt;
-            &lt;/service&gt;
-
-            &lt;service&gt;
-                &lt;role&gt;JOBTRACKER&lt;/role&gt;
-                &lt;url&gt;rpc://{{rm_host}}:{{jt_rpc_port}}&lt;/url&gt;
-            &lt;/service&gt;
-
-            &lt;service&gt;
-                &lt;role&gt;WEBHDFS&lt;/role&gt;
-                &lt;url&gt;http://{{namenode_host}}:{{namenode_http_port}}/webhdfs&lt;/url&gt;
-            &lt;/service&gt;
-
-            &lt;service&gt;
-                &lt;role&gt;WEBHCAT&lt;/role&gt;
-                &lt;url&gt;http://{{webhcat_server_host}}:{{templeton_port}}/templeton&lt;/url&gt;
-            &lt;/service&gt;
-
-            &lt;service&gt;
-                &lt;role&gt;OOZIE&lt;/role&gt;
-                &lt;url&gt;http://{{oozie_server_host}}:{{oozie_server_port}}/oozie&lt;/url&gt;
-            &lt;/service&gt;
-
-            &lt;service&gt;
-                &lt;role&gt;WEBHBASE&lt;/role&gt;
-                &lt;url&gt;http://{{hbase_master_host}}:{{hbase_master_port}}&lt;/url&gt;
-            &lt;/service&gt;
-
-            &lt;service&gt;
-                &lt;role&gt;HIVE&lt;/role&gt;
-                &lt;url&gt;http://{{hive_server_host}}:{{hive_http_port}}/{{hive_http_path}}&lt;/url&gt;
-            &lt;/service&gt;
-
-            &lt;service&gt;
-                &lt;role&gt;RESOURCEMANAGER&lt;/role&gt;
-                &lt;url&gt;http://{{rm_host}}:{{rm_port}}/ws&lt;/url&gt;
-            &lt;/service&gt;
-        &lt;/topology&gt;
-    </value>
-    <description>
-        The configuration specifies the Hadoop cluster services Knox will provide access to.
-    </description>
-    </property>
-</configuration>


[6/6] ambari git commit: AMBARI-8782: Common Services: Refactor HDP-2.2 AMS, KAFKA, KNOX, SLIDER services (Jayush Luniya)

Posted by jl...@apache.org.
AMBARI-8782: Common Services: Refactor HDP-2.2 AMS, KAFKA, KNOX, SLIDER services (Jayush Luniya)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ef7fe6b5
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ef7fe6b5
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ef7fe6b5

Branch: refs/heads/trunk
Commit: ef7fe6b5cefa87042083deaa484bf7bd773b9ec7
Parents: 9e22e17
Author: Jayush Luniya <jl...@hortonworks.com>
Authored: Thu Dec 18 21:26:54 2014 -0800
Committer: Jayush Luniya <jl...@hortonworks.com>
Committed: Thu Dec 18 21:26:54 2014 -0800

----------------------------------------------------------------------
 .../common-services/AMS/0.1.0/alerts.json       | 155 +++++++++
 .../AMS/0.1.0/configuration/ams-env.xml         |  41 +++
 .../AMS/0.1.0/configuration/ams-hbase-env.xml   | 137 ++++++++
 .../AMS/0.1.0/configuration/ams-hbase-log4j.xml | 143 +++++++++
 .../0.1.0/configuration/ams-hbase-policy.xml    |  53 +++
 .../AMS/0.1.0/configuration/ams-hbase-site.xml  | 268 ++++++++++++++++
 .../AMS/0.1.0/configuration/ams-log4j.xml       |  59 ++++
 .../AMS/0.1.0/configuration/ams-site.xml        | 221 +++++++++++++
 .../common-services/AMS/0.1.0/metainfo.xml      | 104 ++++++
 .../files/alert_ambari_metrics_monitor.py       |  80 +++++
 .../AMS/0.1.0/package/files/hbaseSmokeVerify.sh |  34 ++
 .../AMS/0.1.0/package/scripts/__init__.py       |  19 ++
 .../AMS/0.1.0/package/scripts/ams.py            |  89 +++++
 .../AMS/0.1.0/package/scripts/ams_service.py    |  72 +++++
 .../AMS/0.1.0/package/scripts/functions.py      |  40 +++
 .../AMS/0.1.0/package/scripts/hbase.py          | 123 +++++++
 .../AMS/0.1.0/package/scripts/hbase_master.py   |  70 ++++
 .../0.1.0/package/scripts/hbase_regionserver.py |  66 ++++
 .../AMS/0.1.0/package/scripts/hbase_service.py  |  51 +++
 .../0.1.0/package/scripts/metric_collector.py   |  63 ++++
 .../AMS/0.1.0/package/scripts/metric_monitor.py |  61 ++++
 .../AMS/0.1.0/package/scripts/params.py         | 174 ++++++++++
 .../AMS/0.1.0/package/scripts/service_check.py  |  19 ++
 .../AMS/0.1.0/package/scripts/status_params.py  |  30 ++
 .../hadoop-metrics2-hbase.properties.j2         |  56 ++++
 .../package/templates/hbase_client_jaas.conf.j2 |  23 ++
 .../templates/hbase_grant_permissions.j2        |  39 +++
 .../package/templates/hbase_master_jaas.conf.j2 |  26 ++
 .../templates/hbase_regionserver_jaas.conf.j2   |  26 ++
 .../package/templates/metric_groups.conf.j2     |  37 +++
 .../package/templates/metric_monitor.ini.j2     |  30 ++
 .../0.1.0/package/templates/regionservers.j2    |  20 ++
 .../common-services/KAFKA/0.8.1.2.2/alerts.json |  32 ++
 .../0.8.1.2.2/configuration/kafka-broker.xml    | 321 +++++++++++++++++++
 .../KAFKA/0.8.1.2.2/configuration/kafka-env.xml |  55 ++++
 .../0.8.1.2.2/configuration/kafka-log4j.xml     | 116 +++++++
 .../KAFKA/0.8.1.2.2/metainfo.xml                |  82 +++++
 .../KAFKA/0.8.1.2.2/metrics.json                | 262 +++++++++++++++
 .../KAFKA/0.8.1.2.2/package/scripts/kafka.py    |  70 ++++
 .../0.8.1.2.2/package/scripts/kafka_broker.py   |  63 ++++
 .../KAFKA/0.8.1.2.2/package/scripts/params.py   |  57 ++++
 .../package/scripts/properties_config.py        |  32 ++
 .../0.8.1.2.2/package/scripts/service_check.py  |  65 ++++
 .../0.8.1.2.2/package/scripts/status_params.py  |  26 ++
 .../common-services/KNOX/0.5.0.2.2/alerts.json  |  32 ++
 .../0.5.0.2.2/configuration/gateway-log4j.xml   |  83 +++++
 .../0.5.0.2.2/configuration/gateway-site.xml    |  72 +++++
 .../KNOX/0.5.0.2.2/configuration/knox-env.xml   |  53 +++
 .../KNOX/0.5.0.2.2/configuration/ldap-log4j.xml |  66 ++++
 .../KNOX/0.5.0.2.2/configuration/topology.xml   | 116 +++++++
 .../KNOX/0.5.0.2.2/configuration/users-ldif.xml | 135 ++++++++
 .../common-services/KNOX/0.5.0.2.2/metainfo.xml |  87 +++++
 .../package/files/validateKnoxStatus.py         |  43 +++
 .../KNOX/0.5.0.2.2/package/scripts/knox.py      |  85 +++++
 .../0.5.0.2.2/package/scripts/knox_gateway.py   | 103 ++++++
 .../KNOX/0.5.0.2.2/package/scripts/ldap.py      |  39 +++
 .../KNOX/0.5.0.2.2/package/scripts/params.py    | 139 ++++++++
 .../0.5.0.2.2/package/scripts/service_check.py  |  58 ++++
 .../0.5.0.2.2/package/scripts/status_params.py  |  27 ++
 .../package/templates/krb5JAASLogin.conf.j2     |  30 ++
 .../0.60.0.2.2/configuration/slider-client.xml  |  60 ++++
 .../0.60.0.2.2/configuration/slider-env.xml     |  43 +++
 .../0.60.0.2.2/configuration/slider-log4j.xml   |  89 +++++
 .../SLIDER/0.60.0.2.2/metainfo.xml              | 132 ++++++++
 .../package/files/hbaseSmokeVerify.sh           |  34 ++
 .../0.60.0.2.2/package/scripts/__init__.py      |  19 ++
 .../SLIDER/0.60.0.2.2/package/scripts/params.py |  48 +++
 .../0.60.0.2.2/package/scripts/service_check.py |  45 +++
 .../SLIDER/0.60.0.2.2/package/scripts/slider.py |  62 ++++
 .../0.60.0.2.2/package/scripts/slider_client.py |  43 +++
 .../package/templates/storm-slider-env.sh.j2    |  38 +++
 .../stacks/HDP/2.2/services/AMS/alerts.json     | 155 ---------
 .../2.2/services/AMS/configuration/ams-env.xml  |  41 ---
 .../AMS/configuration/ams-hbase-env.xml         | 137 --------
 .../AMS/configuration/ams-hbase-log4j.xml       | 143 ---------
 .../AMS/configuration/ams-hbase-policy.xml      |  53 ---
 .../AMS/configuration/ams-hbase-site.xml        | 268 ----------------
 .../services/AMS/configuration/ams-log4j.xml    |  59 ----
 .../2.2/services/AMS/configuration/ams-site.xml | 221 -------------
 .../stacks/HDP/2.2/services/AMS/metainfo.xml    |  80 +----
 .../files/alert_ambari_metrics_monitor.py       |  80 -----
 .../AMS/package/files/hbaseSmokeVerify.sh       |  34 --
 .../services/AMS/package/scripts/__init__.py    |  19 --
 .../HDP/2.2/services/AMS/package/scripts/ams.py |  89 -----
 .../services/AMS/package/scripts/ams_service.py |  72 -----
 .../services/AMS/package/scripts/functions.py   |  40 ---
 .../2.2/services/AMS/package/scripts/hbase.py   | 123 -------
 .../AMS/package/scripts/hbase_master.py         |  70 ----
 .../AMS/package/scripts/hbase_regionserver.py   |  66 ----
 .../AMS/package/scripts/hbase_service.py        |  51 ---
 .../AMS/package/scripts/metric_collector.py     |  63 ----
 .../AMS/package/scripts/metric_monitor.py       |  61 ----
 .../2.2/services/AMS/package/scripts/params.py  | 174 ----------
 .../AMS/package/scripts/service_check.py        |  19 --
 .../AMS/package/scripts/status_params.py        |  30 --
 .../hadoop-metrics2-hbase.properties.j2         |  56 ----
 .../package/templates/hbase_client_jaas.conf.j2 |  23 --
 .../templates/hbase_grant_permissions.j2        |  39 ---
 .../package/templates/hbase_master_jaas.conf.j2 |  26 --
 .../templates/hbase_regionserver_jaas.conf.j2   |  26 --
 .../AMS/package/templates/metric_groups.conf.j2 |  37 ---
 .../AMS/package/templates/metric_monitor.ini.j2 |  30 --
 .../AMS/package/templates/regionservers.j2      |  20 --
 .../stacks/HDP/2.2/services/KAFKA/alerts.json   |  32 --
 .../KAFKA/configuration/kafka-broker.xml        | 321 -------------------
 .../services/KAFKA/configuration/kafka-env.xml  |  55 ----
 .../KAFKA/configuration/kafka-log4j.xml         | 116 -------
 .../stacks/HDP/2.2/services/KAFKA/metainfo.xml  |  58 +---
 .../stacks/HDP/2.2/services/KAFKA/metrics.json  | 262 ---------------
 .../2.2/services/KAFKA/package/scripts/kafka.py |  70 ----
 .../KAFKA/package/scripts/kafka_broker.py       |  63 ----
 .../services/KAFKA/package/scripts/params.py    |  57 ----
 .../KAFKA/package/scripts/properties_config.py  |  32 --
 .../KAFKA/package/scripts/service_check.py      |  65 ----
 .../KAFKA/package/scripts/status_params.py      |  26 --
 .../stacks/HDP/2.2/services/KNOX/alerts.json    |  32 --
 .../KNOX/configuration/gateway-log4j.xml        |  83 -----
 .../KNOX/configuration/gateway-site.xml         |  72 -----
 .../services/KNOX/configuration/knox-env.xml    |  53 ---
 .../services/KNOX/configuration/ldap-log4j.xml  |  66 ----
 .../services/KNOX/configuration/topology.xml    | 116 -------
 .../services/KNOX/configuration/users-ldif.xml  | 135 --------
 .../stacks/HDP/2.2/services/KNOX/metainfo.xml   |  63 +---
 .../KNOX/package/files/validateKnoxStatus.py    |  43 ---
 .../2.2/services/KNOX/package/scripts/knox.py   |  85 -----
 .../KNOX/package/scripts/knox_gateway.py        | 103 ------
 .../2.2/services/KNOX/package/scripts/ldap.py   |  39 ---
 .../2.2/services/KNOX/package/scripts/params.py | 139 --------
 .../KNOX/package/scripts/service_check.py       |  58 ----
 .../KNOX/package/scripts/status_params.py       |  27 --
 .../package/templates/krb5JAASLogin.conf.j2     |  30 --
 .../SLIDER/configuration/slider-client.xml      |  60 ----
 .../SLIDER/configuration/slider-env.xml         |  43 ---
 .../SLIDER/configuration/slider-log4j.xml       |  89 -----
 .../stacks/HDP/2.2/services/SLIDER/metainfo.xml | 108 +------
 .../SLIDER/package/files/hbaseSmokeVerify.sh    |  34 --
 .../services/SLIDER/package/scripts/__init__.py |  19 --
 .../services/SLIDER/package/scripts/params.py   |  48 ---
 .../SLIDER/package/scripts/service_check.py     |  45 ---
 .../services/SLIDER/package/scripts/slider.py   |  62 ----
 .../SLIDER/package/scripts/slider_client.py     |  43 ---
 .../package/templates/storm-slider-env.sh.j2    |  38 ---
 .../stacks/2.2/KAFKA/test_kafka_broker.py       |   8 +-
 .../python/stacks/2.2/KNOX/test_knox_gateway.py |   8 +-
 .../stacks/2.2/SLIDER/test_slider_client.py     |  21 +-
 145 files changed, 5422 insertions(+), 5301 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/AMS/0.1.0/alerts.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMS/0.1.0/alerts.json b/ambari-server/src/main/resources/common-services/AMS/0.1.0/alerts.json
new file mode 100644
index 0000000..714b940
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/AMS/0.1.0/alerts.json
@@ -0,0 +1,155 @@
+{
+  "AMS": {
+    "service": [
+      {
+        "name": "ams_metric_monitor_process_percent",
+        "label": "Percent AMS Metric Monitors Available",
+        "interval": 1,
+        "scope": "SERVICE",
+        "enabled": true,
+        "source": {
+          "type": "AGGREGATE",
+          "alert_name": "ams_metric_monitor_process",
+          "reporting": {
+            "ok": {
+              "text": "affected: [{1}], total: [{0}]"
+            },
+            "warning": {
+              "text": "affected: [{1}], total: [{0}]",
+              "value": 0.1
+            },
+            "critical": {
+              "text": "affected: [{1}], total: [{0}]",
+              "value": 0.3
+            }
+          }
+        }
+      }
+    ],
+    "METRIC_COLLECTOR": [
+      {
+        "name": "ams_metric_collector_process",
+        "label": "AMS Metric Collector Process",
+        "interval": 1,
+        "scope": "ANY",
+        "enabled": true,
+        "source": {
+          "type": "PORT",
+          "uri": "8188",
+          "default_port": 8188,
+          "reporting": {
+            "ok": {
+              "text": "TCP OK - {0:.3f}s response on port {1}"
+            },
+            "warning": {
+              "text": "TCP OK - {0:.3f}s response on port {1}",
+              "value": 1.5
+            },
+            "critical": {
+              "text": "Connection failed: {0} to {1}:{2}",
+              "value": 5.0
+            }
+          }
+        }
+      },
+      {
+        "name": "ams_metric_collector_hbase_master_process",
+        "label": "AMS Metric Collector HBase Master Process",
+        "interval": 1,
+        "scope": "ANY",
+        "source": {
+          "type": "PORT",
+          "uri": "{{ams-hbase-site/hbase.master.info.port}}",
+          "default_port": 61310,
+          "reporting": {
+            "ok": {
+              "text": "TCP OK - {0:.3f}s response on port {1}"
+            },
+            "warning": {
+              "text": "TCP OK - {0:.3f}s response on port {1}",
+              "value": 1.5
+            },
+            "critical": {
+              "text": "Connection failed: {0} to {1}:{2}",
+              "value": 5.0
+            }
+          }
+        }
+      },
+      {
+        "name": "ams_metric_collector_hbase_master_cpu",
+        "label": "AMS Metric Collector HBase Maser CPU Utilization",
+        "interval": 5,
+        "scope": "ANY",
+        "enabled": true,
+        "source": {
+          "type": "METRIC",
+          "uri": {
+            "http": "{{ams-hbase-site/hbase.master.info.port}}",
+            "https": "{{ams-hbase-site/hbase.master.info.port}}",
+            "https_property": "{{cluster-env/security_enabled}}",
+            "https_property_value": "true",
+            "default_port": 61310
+          },
+          "reporting": {
+            "ok": {
+              "text": "{1} CPU, load {0:.1%}"
+            },
+            "warning": {
+              "text": "{1} CPU, load {0:.1%}",
+              "value": 200
+            },
+            "critical": {
+              "text": "{1} CPU, load {0:.1%}",
+              "value": 250
+            },
+            "units" : "%"
+          },
+          "jmx": {
+            "property_list": [
+              "java.lang:type=OperatingSystem/SystemCpuLoad",
+              "java.lang:type=OperatingSystem/AvailableProcessors"
+            ],
+            "value": "{0} * 100"
+          }
+        }
+      },
+      {
+        "name": "ams_metric_collector_zookeeper_server_process",
+        "label": "AMS Metric Collector ZooKeeper Server Process",
+        "interval": 1,
+        "scope": "ANY",
+        "source": {
+          "type": "PORT",
+          "uri": "{{ams-hbase-site/hbase.zookeeper.property.clientPort}}",
+          "default_port": 61181,
+          "reporting": {
+            "ok": {
+              "text": "TCP OK - {0:.3f}s response on port {1}"
+            },
+            "warning": {
+              "text": "TCP OK - {0:.3f}s response on port {1}",
+              "value": 1.5
+            },
+            "critical": {
+              "text": "Connection failed: {0} to {1}:{2}",
+              "value": 5.0
+            }
+          }
+        }
+      }
+    ],
+    "METRIC_MONITOR": [
+      {
+        "name": "ams_metric_monitor_process",
+        "label": "AMS Metric Monitor Status",
+        "interval": 1,
+        "scope": "ANY",
+        "source": {
+          "type": "SCRIPT",
+          "path": "AMS/0.1.0/package/files/alert_ambari_metrics_monitor.py"
+        }
+      }
+    ]
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/AMS/0.1.0/configuration/ams-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMS/0.1.0/configuration/ams-env.xml b/ambari-server/src/main/resources/common-services/AMS/0.1.0/configuration/ams-env.xml
new file mode 100644
index 0000000..fda1df0
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/AMS/0.1.0/configuration/ams-env.xml
@@ -0,0 +1,41 @@
+<?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>ams_user</name>
+    <value>root</value>
+    <property-type>USER</property-type>
+    <description>AMS User Name.</description>
+  </property>
+
+  <property>
+    <name>content</name>
+    <value>
+      # Set environment variables here.
+
+      # The java implementation to use. Java 1.6 required.
+      export JAVA_HOME={{java64_home}}
+
+      #TODO
+    </value>
+  </property>
+
+</configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/AMS/0.1.0/configuration/ams-hbase-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMS/0.1.0/configuration/ams-hbase-env.xml b/ambari-server/src/main/resources/common-services/AMS/0.1.0/configuration/ams-hbase-env.xml
new file mode 100644
index 0000000..7a61c60
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/AMS/0.1.0/configuration/ams-hbase-env.xml
@@ -0,0 +1,137 @@
+<?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>hbase_log_dir</name>
+    <value>/var/log/ams-hbase/</value>
+    <description>Log Directories for HBase.</description>
+  </property>
+  <property>
+    <name>hbase_pid_dir</name>
+    <value>/var/run/ams-hbase/</value>
+    <description>Pid Directory for HBase.</description>
+  </property>
+  <property>
+    <name>hbase_regionserver_heapsize</name>
+    <value>1024m</value>
+    <description>HBase RegionServer Heap Size.</description>
+  </property>
+  <property>
+    <name>hbase_regionserver_xmn_max</name>
+    <value>512m</value>
+    <description>HBase RegionServer maximum value for minimum heap size.</description>
+  </property>
+  <property>
+    <name>hbase_regionserver_xmn_ratio</name>
+    <value>0.2</value>
+    <description>HBase RegionServer minimum heap size is calculated as a percentage of max heap size.</description>
+  </property>
+  <property>
+    <name>hbase_master_heapsize</name>
+    <value>1024m</value>
+    <description>HBase Master Heap Size</description>
+  </property>
+  <property>
+    <name>hbase_user</name>
+    <value>hbase</value>
+    <property-type>USER</property-type>
+    <description>HBase User Name.</description>
+  </property>
+
+  <!-- hbase-env.sh -->
+  <property>
+    <name>content</name>
+    <description>This is the jinja template for hbase-env.sh file</description>
+    <value>
+      # Set environment variables here.
+
+      # The java implementation to use. Java 1.6 required.
+      export JAVA_HOME={{java64_home}}
+
+      # HBase Configuration directory
+      export HBASE_CONF_DIR=${HBASE_CONF_DIR:-{{hbase_conf_dir}}}
+
+      # Extra Java CLASSPATH elements. Optional.
+      export HBASE_CLASSPATH=${HBASE_CLASSPATH}
+
+      if [ -f "/usr/lib/ambari-metrics-hadoop-sink/ambari-metrics-hadoop-sink.jar" ]; then
+        export HBASE_CLASSPATH=${HBASE_CLASSPATH}:/usr/lib/ambari-metrics-hadoop-sink/ambari-metrics-hadoop-sink.jar
+      fi
+
+      # The maximum amount of heap to use, in MB. Default is 1000.
+      # export HBASE_HEAPSIZE=1000
+
+      # Extra Java runtime options.
+      # Below are what we set by default. May only work with SUN JVM.
+      # For more on why as well as other possible settings,
+      # see http://wiki.apache.org/hadoop/PerformanceTuning
+      export HBASE_OPTS="-XX:+UseConcMarkSweepGC -XX:ErrorFile={{hbase_log_dir}}/hs_err_pid%p.log"
+      export SERVER_GC_OPTS="-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:{{log_dir}}/gc.log-`date +'%Y%m%d%H%M'`"
+      # Uncomment below to enable java garbage collection logging.
+      # export HBASE_OPTS="$HBASE_OPTS -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:$HBASE_HOME/logs/gc-hbase.log"
+
+      # Uncomment and adjust to enable JMX exporting
+      # See jmxremote.password and jmxremote.access in $JRE_HOME/lib/management to configure remote password access.
+      # More details at: http://java.sun.com/javase/6/docs/technotes/guides/management/agent.html
+      #
+      # export HBASE_JMX_BASE="-Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"
+      export HBASE_MASTER_OPTS="-Xmx{{master_heapsize}}"
+      export HBASE_REGIONSERVER_OPTS="-Xmn{{regionserver_xmn_size}} -XX:CMSInitiatingOccupancyFraction=70  -Xms{{regionserver_heapsize}} -Xmx{{regionserver_heapsize}}"
+      # export HBASE_THRIFT_OPTS="$HBASE_JMX_BASE -Dcom.sun.management.jmxremote.port=10103"
+      # export HBASE_ZOOKEEPER_OPTS="$HBASE_JMX_BASE -Dcom.sun.management.jmxremote.port=10104"
+
+      # File naming hosts on which HRegionServers will run. $HBASE_HOME/conf/regionservers by default.
+      export HBASE_REGIONSERVERS=${HBASE_CONF_DIR}/regionservers
+
+      # Extra ssh options. Empty by default.
+      # export HBASE_SSH_OPTS="-o ConnectTimeout=1 -o SendEnv=HBASE_CONF_DIR"
+
+      # Where log files are stored. $HBASE_HOME/logs by default.
+      export HBASE_LOG_DIR={{hbase_log_dir}}
+
+      # A string representing this instance of hbase. $USER by default.
+      # export HBASE_IDENT_STRING=$USER
+
+      # The scheduling priority for daemon processes. See 'man nice'.
+      # export HBASE_NICENESS=10
+
+      # The directory where pid files are stored. /tmp by default.
+      export HBASE_PID_DIR={{hbase_pid_dir}}
+
+      # Seconds to sleep between slave commands. Unset by default. This
+      # can be useful in large clusters, where, e.g., slave rsyncs can
+      # otherwise arrive faster than the master can service them.
+      # export HBASE_SLAVE_SLEEP=0.1
+
+      # Tell HBase whether it should manage it's own instance of Zookeeper or not.
+      export HBASE_MANAGES_ZK=false
+
+      {% if security_enabled %}
+      export HBASE_OPTS="$HBASE_OPTS -Djava.security.auth.login.config={{client_jaas_config_file}}"
+      export HBASE_MASTER_OPTS="$HBASE_MASTER_OPTS -Djava.security.auth.login.config={{master_jaas_config_file}}"
+      export HBASE_REGIONSERVER_OPTS="$HBASE_REGIONSERVER_OPTS -Djava.security.auth.login.config={{regionserver_jaas_config_file}}"
+      {% endif %}
+    </value>
+  </property>
+
+</configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/AMS/0.1.0/configuration/ams-hbase-log4j.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMS/0.1.0/configuration/ams-hbase-log4j.xml b/ambari-server/src/main/resources/common-services/AMS/0.1.0/configuration/ams-hbase-log4j.xml
new file mode 100644
index 0000000..24ba5b7
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/AMS/0.1.0/configuration/ams-hbase-log4j.xml
@@ -0,0 +1,143 @@
+<?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 supports_final="false">
+
+  <property>
+    <name>content</name>
+    <description>Custom log4j.properties</description>
+    <value>
+      # 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.
+
+
+      # Define some default values that can be overridden by system properties
+      hbase.root.logger=INFO,console
+      hbase.security.logger=INFO,console
+      hbase.log.dir=.
+      hbase.log.file=hbase.log
+
+      # Define the root logger to the system property "hbase.root.logger".
+      log4j.rootLogger=${hbase.root.logger}
+
+      # Logging Threshold
+      log4j.threshold=ALL
+
+      #
+      # Daily Rolling File Appender
+      #
+      log4j.appender.DRFA=org.apache.log4j.DailyRollingFileAppender
+      log4j.appender.DRFA.File=${hbase.log.dir}/${hbase.log.file}
+
+      # Rollver at midnight
+      log4j.appender.DRFA.DatePattern=.yyyy-MM-dd
+
+      # 30-day backup
+      #log4j.appender.DRFA.MaxBackupIndex=30
+      log4j.appender.DRFA.layout=org.apache.log4j.PatternLayout
+
+      # Pattern format: Date LogLevel LoggerName LogMessage
+      log4j.appender.DRFA.layout.ConversionPattern=%d{ISO8601} %-5p [%t] %c{2}: %m%n
+
+      # Rolling File Appender properties
+      hbase.log.maxfilesize=256MB
+      hbase.log.maxbackupindex=20
+
+      # Rolling File Appender
+      log4j.appender.RFA=org.apache.log4j.RollingFileAppender
+      log4j.appender.RFA.File=${hbase.log.dir}/${hbase.log.file}
+
+      log4j.appender.RFA.MaxFileSize=${hbase.log.maxfilesize}
+      log4j.appender.RFA.MaxBackupIndex=${hbase.log.maxbackupindex}
+
+      log4j.appender.RFA.layout=org.apache.log4j.PatternLayout
+      log4j.appender.RFA.layout.ConversionPattern=%d{ISO8601} %-5p [%t] %c{2}: %m%n
+
+      #
+      # Security audit appender
+      #
+      hbase.security.log.file=SecurityAuth.audit
+      hbase.security.log.maxfilesize=256MB
+      hbase.security.log.maxbackupindex=20
+      log4j.appender.RFAS=org.apache.log4j.RollingFileAppender
+      log4j.appender.RFAS.File=${hbase.log.dir}/${hbase.security.log.file}
+      log4j.appender.RFAS.MaxFileSize=${hbase.security.log.maxfilesize}
+      log4j.appender.RFAS.MaxBackupIndex=${hbase.security.log.maxbackupindex}
+      log4j.appender.RFAS.layout=org.apache.log4j.PatternLayout
+      log4j.appender.RFAS.layout.ConversionPattern=%d{ISO8601} %p %c: %m%n
+      log4j.category.SecurityLogger=${hbase.security.logger}
+      log4j.additivity.SecurityLogger=false
+      #log4j.logger.SecurityLogger.org.apache.hadoop.hbase.security.access.AccessController=TRACE
+
+      #
+      # Null Appender
+      #
+      log4j.appender.NullAppender=org.apache.log4j.varia.NullAppender
+
+      #
+      # console
+      # Add "console" to rootlogger above if you want to use this
+      #
+      log4j.appender.console=org.apache.log4j.ConsoleAppender
+      log4j.appender.console.target=System.err
+      log4j.appender.console.layout=org.apache.log4j.PatternLayout
+      log4j.appender.console.layout.ConversionPattern=%d{ISO8601} %-5p [%t] %c{2}: %m%n
+
+      # Custom Logging levels
+
+      log4j.logger.org.apache.zookeeper=INFO
+      #log4j.logger.org.apache.hadoop.fs.FSNamesystem=DEBUG
+      log4j.logger.org.apache.hadoop.hbase=DEBUG
+      # Make these two classes INFO-level. Make them DEBUG to see more zk debug.
+      log4j.logger.org.apache.hadoop.hbase.zookeeper.ZKUtil=INFO
+      log4j.logger.org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher=INFO
+      #log4j.logger.org.apache.hadoop.dfs=DEBUG
+      # Set this class to log INFO only otherwise its OTT
+      # Enable this to get detailed connection error/retry logging.
+      # log4j.logger.org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation=TRACE
+
+
+      # Uncomment this line to enable tracing on _every_ RPC call (this can be a lot of output)
+      #log4j.logger.org.apache.hadoop.ipc.HBaseServer.trace=DEBUG
+
+      # Uncomment the below if you want to remove logging of client region caching'
+      # and scan of .META. messages
+      # log4j.logger.org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation=INFO
+      # log4j.logger.org.apache.hadoop.hbase.client.MetaScanner=INFO
+
+    </value>
+  </property>
+
+</configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/AMS/0.1.0/configuration/ams-hbase-policy.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMS/0.1.0/configuration/ams-hbase-policy.xml b/ambari-server/src/main/resources/common-services/AMS/0.1.0/configuration/ams-hbase-policy.xml
new file mode 100644
index 0000000..febbd44
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/AMS/0.1.0/configuration/ams-hbase-policy.xml
@@ -0,0 +1,53 @@
+<?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 supports_final="true">
+  <property>
+    <name>security.client.protocol.acl</name>
+    <value>*</value>
+    <description>ACL for HRegionInterface protocol implementations (ie.
+      clients talking to HRegionServers)
+      The ACL is a comma-separated list of user and group names. The user and
+      group list is separated by a blank. For e.g. "alice,bob users,wheel".
+      A special value of "*" means all users are allowed.</description>
+  </property>
+
+  <property>
+    <name>security.admin.protocol.acl</name>
+    <value>*</value>
+    <description>ACL for HMasterInterface protocol implementation (ie.
+      clients talking to HMaster for admin operations).
+      The ACL is a comma-separated list of user and group names. The user and
+      group list is separated by a blank. For e.g. "alice,bob users,wheel".
+      A special value of "*" means all users are allowed.</description>
+  </property>
+
+  <property>
+    <name>security.masterregion.protocol.acl</name>
+    <value>*</value>
+    <description>ACL for HMasterRegionInterface protocol implementations
+      (for HRegionServers communicating with HMaster)
+      The ACL is a comma-separated list of user and group names. The user and
+      group list is separated by a blank. For e.g. "alice,bob users,wheel".
+      A special value of "*" means all users are allowed.</description>
+  </property>
+</configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/AMS/0.1.0/configuration/ams-hbase-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMS/0.1.0/configuration/ams-hbase-site.xml b/ambari-server/src/main/resources/common-services/AMS/0.1.0/configuration/ams-hbase-site.xml
new file mode 100644
index 0000000..9d35ba2
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/AMS/0.1.0/configuration/ams-hbase-site.xml
@@ -0,0 +1,268 @@
+<?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>hbase.rootdir</name>
+    <value>file:///var/lib/ambari-metrics-collector/hbase</value>
+    <description>
+      AMS service uses HBase as default storage backend. Set the rootdir for
+      HBase to either local filesystem path if using AMS in embedded mode or
+      to a HDFS dir, example: hdfs://namenode.example.org:9000/hbase.  By
+      default HBase writes into /tmp. Change this configuration else all data
+      will be lost on machine restart.
+    </description>
+  </property>
+  <property>
+    <name>hbase.tmp.dir</name>
+    <value>/var/lib/ambari-metrics-collector/hbase-tmp</value>
+    <description>
+      Temporary directory on the local filesystem.
+      Change this setting to point to a location more permanent
+      than '/tmp' (The '/tmp' directory is often cleared on
+      machine restart).
+    </description>
+  </property>
+  <property>
+    <name>hbase.local.dir</name>
+    <value>${hbase.tmp.dir}/local</value>
+    <description>Directory on the local filesystem to be used as a local storage
+    </description>
+  </property>
+  <property>
+    <name>hbase.cluster.distributed</name>
+    <value>false</value>
+    <description>
+      The mode the cluster will be in. Possible values are false for
+      standalone mode and true for distributed mode. If false, startup will run
+      all HBase and ZooKeeper daemons together in the one JVM.
+    </description>
+  </property>
+  <property>
+    <name>hbase.master.wait.on.regionservers.mintostart</name>
+    <value>1</value>
+    <description>
+      Ensure that HBase Master waits for # many region server to start.
+    </description>
+  </property>
+  <property>
+    <name>hbase.zookeeper.quorum</name>
+    <value>localhost</value>
+    <description>Comma separated list of servers in the ZooKeeper Quorum.
+      For example, "host1.mydomain.com,host2.mydomain.com,host3.mydomain.com".
+      By default this is set to localhost for local and pseudo-distributed modes
+      of operation. For a fully-distributed setup, this should be set to a full
+      list of ZooKeeper quorum servers. If HBASE_MANAGES_ZK is set in hbase-env.sh
+      this is the list of servers which we will start/stop ZooKeeper on.
+    </description>
+  </property>
+  <property>
+    <name>hbase.master.info.bindAddress</name>
+    <value>0.0.0.0</value>
+    <description>The bind address for the HBase Master web UI</description>
+  </property>
+  <property>
+    <name>hbase.master.info.port</name>
+    <value>61310</value>
+    <description>The port for the HBase Master web UI.</description>
+  </property>
+  <property>
+    <name>hbase.regionserver.info.port</name>
+    <value>61330</value>
+    <description>The port for the HBase RegionServer web UI.</description>
+  </property>
+  <property>
+    <name>hbase.master.port</name>
+    <value>61300</value>
+    <description>The port for the HBase Master web UI.</description>
+  </property>
+  <property>
+    <name>hbase.regionserver.port</name>
+    <value>61320</value>
+    <description>The port for the HBase RegionServer web UI.</description>
+  </property>
+  <property>
+    <name>hbase.hregion.majorcompaction</name>
+    <value>0</value>
+    <description>
+      The time (in milliseconds) between 'major' compactions of all
+      HStoreFiles in a region.
+      0 to disable automated major compactions.
+    </description>
+  </property>
+  <property>
+    <name>phoenix.query.spoolThresholdBytes</name>
+    <value>12582912</value>
+    <description>
+      Threshold size in bytes after which results from parallelly executed
+      query results are spooled to disk. Default is 20 mb.
+    </description>
+  </property>
+  <property>
+    <name>hbase.zookeeper.property.dataDir</name>
+    <value>${hbase.tmp.dir}/zookeeper</value>
+    <description>
+      Property from ZooKeeper's config zoo.cfg.
+      The directory where the snapshot is stored.
+    </description>
+  </property>
+  <property>
+    <name>hbase.client.scanner.caching</name>
+    <value>10000</value>
+    <description>
+      Number of rows that will be fetched when calling next on a scanner
+      if it is not served from (local, client) memory.
+    </description>
+  </property>
+  <property>
+    <name>hfile.block.cache.size</name>
+    <value>0.3</value>
+    <description>
+      Percentage of maximum heap (-Xmx setting) to allocate to block cache
+      used by a StoreFile. Default of 0.4 means allocate 40%.
+    </description>
+  </property>
+  <property>
+    <name>hbase.regionserver.global.memstore.upperLimit</name>
+    <value>0.5</value>
+    <description>
+      Maximum size of all memstores in a region server before new
+      updates are blocked and flushes are forced. Defaults to 40% of heap
+    </description>
+  </property>
+  <property>
+    <name>hbase.regionserver.global.memstore.lowerLimit</name>
+    <value>0.4</value>
+    <description>
+      When memstores are being forced to flush to make room in
+      memory, keep flushing until we hit this mark. Defaults to 35% of heap.
+      This value equal to hbase.regionserver.global.memstore.upperLimit causes
+      the minimum possible flushing to occur when updates are blocked due to
+      memstore limiting.
+    </description>
+  </property>
+  <property>
+    <name>phoenix.groupby.maxCacheSize</name>
+    <value>307200000</value>
+    <description>
+      Size in bytes of pages cached during GROUP BY spilling. Default is 100Mb.
+    </description>
+  </property>
+  <property>
+    <name>hbase.hregion.memstore.block.multiplier</name>
+    <value>4</value>
+    <description>
+      Block updates if memstore has hbase.hregion.memstore.block.multiplier
+      times hbase.hregion.memstore.flush.size bytes. Useful preventing runaway
+      memstore during spikes in update traffic.
+    </description>
+  </property>
+  <property>
+    <name>hbase.hstore.flusher.count</name>
+    <value>2</value>
+    <description>
+      The number of flush threads. With fewer threads, the MemStore flushes
+      will be queued. With more threads, the flushes will be executed in parallel,
+      increasing the load on HDFS, and potentially causing more compactions.
+    </description>
+  </property>
+  <property>
+    <name>phoenix.query.timeoutMs</name>
+    <value>1200000</value>
+    <description>
+      Number of milliseconds after which a query will timeout on the client.
+      Default is 10 min.
+    </description>
+  </property>
+  <property>
+    <name>hbase.client.scanner.timeout.period</name>
+    <value>900000</value>
+    <description>
+      Client scanner lease period in milliseconds.
+    </description>
+  </property>
+  <property>
+    <name>hbase.regionserver.thread.compaction.large</name>
+    <value>2</value>
+    <description>
+      Configuration key for the large compaction threads.
+    </description>
+  </property>
+  <property>
+    <name>hbase.regionserver.thread.compaction.small</name>
+    <value>3</value>
+    <description>
+      Configuration key for the small compaction threads.
+    </description>
+  </property>
+  <property>
+    <name>hbase.zookeeper.property.clientPort</name>
+    <value>61181</value>
+  </property>
+  <property>
+    <name>hbase.zookeeper.peerport</name>
+    <value>61288</value>
+  </property>
+  <property>
+    <name>hbase.zookeeper.leaderport</name>
+    <value>61388</value>
+  </property>
+  <property>
+    <name>hbase.hstore.blockingStoreFiles</name>
+    <value>200</value>
+    <description>
+      If more than this number of StoreFiles exist in any one Store
+      (one StoreFile is written per flush of MemStore), updates are blocked for
+      this region until a compaction is completed, or until
+      hbase.hstore.blockingWaitTime has been exceeded.
+    </description>
+  </property>
+  <property>
+    <name>hbase.hregion.memstore.flush.size</name>
+    <value>134217728</value>
+    <description>
+      Memstore will be flushed to disk if size of the memstore exceeds this
+      number of bytes. Value is checked by a thread that runs every
+      hbase.server.thread.wakefrequency.
+    </description>
+  </property>
+  <property>
+    <name>phoenix.query.spoolThresholdBytes</name>
+    <value>12582912</value>
+  </property>
+  <property>
+    <name>hbase.snapshot.enabled</name>
+    <value>false</value>
+    <description>Enable/Disable HBase snapshots.</description>
+  </property>
+  <property>
+    <name>hbase.replication</name>
+    <value>false</value>
+    <description>Enable/Disable HBase replication.</description>
+  </property>
+  <property>
+    <name>zookeeper.session.timeout</name>
+    <value>120000</value>
+    <description>ZooKeeper session timeout in milliseconds.</description>
+  </property>
+
+</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/AMS/0.1.0/configuration/ams-log4j.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMS/0.1.0/configuration/ams-log4j.xml b/ambari-server/src/main/resources/common-services/AMS/0.1.0/configuration/ams-log4j.xml
new file mode 100644
index 0000000..3f2e148
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/AMS/0.1.0/configuration/ams-log4j.xml
@@ -0,0 +1,59 @@
+<?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 supports_final="false">
+
+  <property>
+    <name>content</name>
+    <description>Custom log4j.properties</description>
+    <value>
+      #
+      # 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.
+      #
+
+      # Define some default values that can be overridden by system properties
+      # Root logger option
+      log4j.rootLogger=INFO,file
+
+      # Direct log messages to a log file
+      log4j.appender.file=org.apache.log4j.RollingFileAppender
+      log4j.appender.file.File=/var/log/ambari-metrics-collector/ambari-metrics-collector.log
+      log4j.appender.file.MaxFileSize=80MB
+      log4j.appender.file.MaxBackupIndex=60
+      log4j.appender.file.layout=org.apache.log4j.PatternLayout
+      log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p [%t] %c{1}:%L - %m%n
+    </value>
+  </property>
+
+</configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/AMS/0.1.0/configuration/ams-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMS/0.1.0/configuration/ams-site.xml b/ambari-server/src/main/resources/common-services/AMS/0.1.0/configuration/ams-site.xml
new file mode 100644
index 0000000..f84a418
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/AMS/0.1.0/configuration/ams-site.xml
@@ -0,0 +1,221 @@
+<?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>timeline.metrics.service.operation.mode</name>
+    <value>embedded</value>
+    <description>
+      Service Operation modes:
+      1) embedded: Metrics stored on local FS, HBase in Standalone mode
+      2) distributed: HBase daemons writing to HDFS
+      3) external: External HBase storage backend
+    </description>
+  </property>
+  <property>
+    <name>timeline.metrics.aggregator.checkpoint.dir</name>
+    <value>/tmp</value>
+    <description>
+      Directory to store aggregator checkpoints. Change to a permanent
+      location so that checkpoint ar not lost.
+    </description>
+  </property>
+  <property>
+    <name>timeline.metrics.host.aggregator.hourly.interval</name>
+    <value>3600</value>
+    <description>
+      Time in seconds to sleep for the hourly resolution host based
+      aggregator. Default resolution is 1 hour.
+    </description>
+  </property>
+  <property>
+    <name>timeline.metrics.host.aggregator.minute.interval</name>
+    <value>300</value>
+    <description>
+      Time in seconds to sleep for the minute resolution host based
+      aggregator. Default resolution is 5 minutes.
+    </description>
+  </property>
+  <property>
+    <name>timeline.metrics.cluster.aggregator.hourly.interval</name>
+    <value>3600</value>
+    <description>
+      Time in seconds to sleep for the hourly resolution cluster wide
+      aggregator. Default is 1 hour.
+    </description>
+  </property>
+  <property>
+    <name>timeline.metrics.cluster.aggregator.minute.interval</name>
+    <value>120</value>
+    <description>
+      Time in seconds to sleep for the minute resolution cluster wide
+      aggregator. Default resolution is 2 minutes.
+    </description>
+  </property>
+  <property>
+    <name>timeline.metrics.host.aggregator.hourly.checkpointCutOffMultiplier</name>
+    <value>2</value>
+    <description>
+      Multiplier value * interval = Max allowed checkpoint lag. Effectively
+      if aggregator checkpoint is greater than max allowed checkpoint delay,
+      the checkpoint will be discarded by the aggregator.
+    </description>
+  </property>
+  <property>
+    <name>timeline.metrics.host.aggregator.minute.checkpointCutOffMultiplier</name>
+    <value>2</value>
+    <description>
+      Multiplier value * interval = Max allowed checkpoint lag. Effectively
+      if aggregator checkpoint is greater than max allowed checkpoint delay,
+      the checkpoint will be discarded by the aggregator.
+    </description>
+  </property>
+  <property>
+    <name>timeline.metrics.cluster.aggregator.hourly.checkpointCutOffMultiplier</name>
+    <value>2</value>
+    <description>
+      Multiplier value * interval = Max allowed checkpoint lag. Effectively
+      if aggregator checkpoint is greater than max allowed checkpoint delay,
+      the checkpoint will be discarded by the aggregator.
+    </description>
+  </property>
+  <property>
+    <name>timeline.metrics.cluster.aggregator.minute.checkpointCutOffMultiplier</name>
+    <value>2</value>
+    <description>
+      Multiplier value * interval = Max allowed checkpoint lag. Effectively
+      if aggregator checkpoint is greater than max allowed checkpoint delay,
+      the checkpoint will be discarded by the aggregator.
+    </description>
+  </property>
+  <property>
+    <name>timeline.metrics.host.aggregator.hourly.disabled</name>
+    <value>false</value>
+    <description>
+      Disable host based hourly aggregations.
+    </description>
+  </property>
+  <property>
+    <name>timeline.metrics.host.aggregator.minute.disabled</name>
+    <value>false</value>
+    <description>
+      Disable host based minute aggregations.
+    </description>
+  </property>
+  <property>
+    <name>timeline.metrics.cluster.aggregator.hourly.disabled</name>
+    <value>false</value>
+    <description>
+      Disable cluster based hourly aggregations.
+    </description>
+  </property>
+  <property>
+    <name>timeline.metrics.cluster.aggregator.minute.disabled</name>
+    <value>false</value>
+    <description>
+      Disable cluster based minute aggregations.
+    </description>
+  </property>
+  <property>
+    <name>timeline.metrics.cluster.aggregator.minute.timeslice.interval</name>
+    <value>15</value>
+    <description>
+      Lowest resolution of desired data for cluster level minute aggregates.
+    </description>
+  </property>
+  <property>
+    <name>timeline.metrics.host.aggregator.hourly.ttl</name>
+    <value>2592000</value>
+    <description>
+      Host based hourly resolution data purge interval. Default is 30 days.
+    </description>
+  </property>
+  <property>
+    <name>timeline.metrics.host.aggregator.minute.ttl</name>
+    <value>604800</value>
+    <description>
+      Host based minute resolution data purge interval. Default is 7 days.
+    </description>
+  </property>
+  <property>
+    <name>timeline.metrics.cluster.aggregator.minute.ttl</name>
+    <value>2592000</value>
+    <description>
+      Cluster wide minute resolution data purge interval. Default is 30 days.
+    </description>
+  </property>
+  <property>
+    <name>timeline.metrics.cluster.aggregator.hourly.ttl</name>
+    <value>31536000</value>
+    <description>
+      Cluster wide hourly resolution data purge interval. Default is 1 year.
+    </description>
+  </property>
+  <property>
+    <name>timeline.metrics.host.aggregator.ttl</name>
+    <value>86400</value>
+    <description>
+      1 minute resolution data purge interval. Default is 1 day.
+    </description>
+  </property>
+  <property>
+    <name>timeline.metrics.hbase.data.block.encoding</name>
+    <value>FAST_DIFF</value>
+    <description>
+      Codecs are enabled on a table by setting the DATA_BLOCK_ENCODING property.
+      Default encoding is FAST_DIFF. This can be changed only before creating
+      tables.
+    </description>
+  </property>
+  <property>
+    <name>timeline.metrics.hbase.compression.scheme</name>
+    <value>SNAPPY</value>
+    <description>
+      Compression codes need to be installed and available before setting the
+      scheme. Default compression is SNAPPY. Disable by setting to None.
+      This can be changed only before creating tables.
+    </description>
+  </property>
+  <property>
+    <name>timeline.metrics.service.default.result.limit</name>
+    <value>5760</value>
+    <description>
+      Max result limit on number of rows returned. Calculated as follows:
+      4 aggregate metrics/min * 60 * 24: Retrieve aggregate data for 1 day.
+    </description>
+  </property>
+  <property>
+    <name>timeline.metrics.service.checkpointDelay</name>
+    <value>60</value>
+    <description>
+      Time in seconds to sleep on the first run or when the checkpoint is
+      too old.
+    </description>
+  </property>
+  <property>
+    <name>timeline.metrics.service.resultset.fetchSize</name>
+    <value>2000</value>
+    <description>
+      JDBC resultset prefect size for aggregator queries.
+    </description>
+  </property>
+</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/AMS/0.1.0/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMS/0.1.0/metainfo.xml b/ambari-server/src/main/resources/common-services/AMS/0.1.0/metainfo.xml
new file mode 100644
index 0000000..51d8177
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/AMS/0.1.0/metainfo.xml
@@ -0,0 +1,104 @@
+<?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>AMS</name>
+      <displayName>AMS</displayName>
+      <version>0.1.0</version>
+      <comment>Ambari Metrics Service - Monitoring service that provides
+        storage and retrieval capability for metrics collected from services
+        &amp; hosts.
+      </comment>
+      <components>
+        <component>
+          <name>METRIC_COLLECTOR</name>
+          <displayName>Metric Collector</displayName>
+          <category>MASTER</category>
+          <cardinality>1+</cardinality>
+          <dependencies>
+            <dependency>
+              <name>ZOOKEEPER/ZOOKEEPER_SERVER</name>
+              <scope>cluster</scope>
+              <auto-deploy>
+                <enabled>true</enabled>
+              </auto-deploy>
+            </dependency>
+          </dependencies>
+          <commandScript>
+            <script>scripts/metric_collector.py</script>
+            <scriptType>PYTHON</scriptType>
+            <timeout>600</timeout>
+          </commandScript>
+        </component>
+        <component>
+          <name>METRIC_MONITOR</name>
+          <displayName>Metric Monitor</displayName>
+          <category>SLAVE</category>
+          <cardinality>ALL</cardinality>
+          <auto-deploy>
+            <enabled>true</enabled>
+          </auto-deploy>
+          <commandScript>
+            <script>scripts/metric_monitor.py</script>
+            <scriptType>PYTHON</scriptType>
+            <timeout>600</timeout>
+          </commandScript>
+        </component>
+      </components>
+
+      <osSpecifics>
+        <osSpecific>
+          <osFamily>any</osFamily>
+          <packages>
+            <package>
+              <name>ambari-metrics-collector</name>
+            </package>
+            <package>
+              <name>ambari-metrics-monitor</name>
+            </package>
+            <package>
+              <name>hadoop_2_2_*</name>
+            </package>
+          </packages>
+        </osSpecific>
+      </osSpecifics>
+
+      <commandScript>
+        <script>scripts/service_check.py</script>
+        <scriptType>PYTHON</scriptType>
+        <timeout>300</timeout>
+      </commandScript>
+
+      <requiredServices>
+        <service>ZOOKEEPER</service>
+      </requiredServices>
+
+      <configuration-dependencies>
+        <config-type>ams-site</config-type>
+        <config-type>ams-log4j</config-type>
+        <config-type>ams-hbase-policy</config-type>
+        <config-type>ams-hbase-site</config-type>
+        <config-type>ams-hbase-env</config-type>
+        <config-type>ams-hbase-log4j</config-type>
+      </configuration-dependencies>
+
+    </service>
+  </services>
+</metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/files/alert_ambari_metrics_monitor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/files/alert_ambari_metrics_monitor.py b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/files/alert_ambari_metrics_monitor.py
new file mode 100644
index 0000000..5841267
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/files/alert_ambari_metrics_monitor.py
@@ -0,0 +1,80 @@
+#!/usr/bin/env python
+
+"""
+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 socket
+
+from resource_management.libraries.functions.check_process_status import check_process_status
+from resource_management.core.exceptions import ComponentIsNotRunning
+
+RESULT_CODE_OK = 'OK'
+RESULT_CODE_CRITICAL = 'CRITICAL'
+RESULT_CODE_UNKNOWN = 'UNKNOWN'
+
+AMS_MONITOR_PID_PATH = '/var/run/ambari-metrics-monitor/ambari-metrics-monitor.pid'
+
+
+def get_tokens():
+  """
+  Returns a tuple of tokens in the format {{site/property}} that will be used
+  to build the dictionary passed into execute
+  """
+  return ()
+
+
+def is_monitor_process_live(pid_file):
+  """
+  Gets whether the AMS monitor represented by the specified file is running.
+  :param pid_file: the PID file of the monitor to check
+  :return: True if the monitor is running, False otherwise
+  """
+  live = False
+
+  try:
+    check_process_status(pid_file)
+    live = True
+  except ComponentIsNotRunning:
+    pass
+
+  return live
+
+
+def execute(parameters=None, host_name=None):
+  """
+  Returns a tuple containing the result code and a pre-formatted result label
+
+  Keyword arguments:
+  parameters (dictionary): a mapping of parameter key to value
+  host_name (string): the name of this host where the alert is running
+  """
+
+  if parameters is None:
+    return (RESULT_CODE_UNKNOWN, ['There were no parameters supplied to the script.'])
+
+  if host_name is None:
+    host_name = socket.getfqdn()
+
+  ams_monitor_process_running = is_monitor_process_live(AMS_MONITOR_PID_PATH)
+
+  alert_state = RESULT_CODE_OK if ams_monitor_process_running else RESULT_CODE_CRITICAL
+
+  alert_label = 'Ambari Monitor is running on {0}' if ams_monitor_process_running else 'Ambari Monitor is NOT running on {0}'
+  alert_label = alert_label.format(host_name)
+
+  return (alert_state, [alert_label])

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/files/hbaseSmokeVerify.sh
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/files/hbaseSmokeVerify.sh b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/files/hbaseSmokeVerify.sh
new file mode 100644
index 0000000..5c320c0
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/files/hbaseSmokeVerify.sh
@@ -0,0 +1,34 @@
+#!/usr/bin/env bash
+#
+#
+# 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.
+#
+#
+conf_dir=$1
+data=$2
+hbase_cmd=$3
+echo "scan 'ambarismoketest'" | $hbase_cmd --config $conf_dir shell > /tmp/hbase_chk_verify
+cat /tmp/hbase_chk_verify
+echo "Looking for $data"
+grep -q $data /tmp/hbase_chk_verify
+if [ "$?" -ne 0 ]
+then
+  exit 1
+fi
+
+grep -q '1 row(s)' /tmp/hbase_chk_verify

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/__init__.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/__init__.py b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/__init__.py
new file mode 100644
index 0000000..5561e10
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/__init__.py
@@ -0,0 +1,19 @@
+#!/usr/bin/env python
+"""
+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.
+
+"""

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/ams.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/ams.py b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/ams.py
new file mode 100644
index 0000000..1f09d7d
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/ams.py
@@ -0,0 +1,89 @@
+#!/usr/bin/env python
+"""
+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.
+
+"""
+
+from resource_management import *
+
+
+def ams(name=None):
+  import params
+
+  if name == 'collector':
+    Directory(params.ams_collector_conf_dir,
+              owner=params.ams_user,
+              group=params.user_group,
+              recursive=True
+    )
+
+    XmlConfig("ams-site.xml",
+              conf_dir=params.ams_collector_conf_dir,
+              configurations=params.config['configurations']['ams-site'],
+              configuration_attributes=params.config['configuration_attributes']['ams-site'],
+              owner=params.ams_user,
+              group=params.user_group
+    )
+
+    XmlConfig( "hbase-site.xml",
+               conf_dir = params.ams_collector_conf_dir,
+               configurations = params.config['configurations']['ams-hbase-site'],
+               configuration_attributes=params.config['configuration_attributes']['ams-hbase-site'],
+               owner = params.ams_user,
+               group = params.user_group
+    )
+
+    if (params.log4j_props != None):
+      File(format("{params.ams_collector_conf_dir}/log4j.properties"),
+           mode=0644,
+           group=params.user_group,
+           owner=params.ams_user,
+           content=params.log4j_props
+      )
+
+    File(format("{ams_collector_conf_dir}/ams-env.sh"),
+         owner=params.ams_user,
+         content=InlineTemplate(params.ams_env_sh_template)
+    )
+
+    pass
+
+  elif name == 'monitor':
+    Directory(params.ams_monitor_conf_dir,
+              owner=params.ams_user,
+              group=params.user_group,
+              recursive=True
+    )
+
+    TemplateConfig(
+      format("{ams_monitor_conf_dir}/metric_monitor.ini"),
+      owner=params.ams_user,
+      group=params.user_group,
+      template_tag=None
+    )
+
+    TemplateConfig(
+      format("{ams_monitor_conf_dir}/metric_groups.conf"),
+      owner=params.ams_user,
+      group=params.user_group,
+      template_tag=None
+    )
+
+    # TODO
+    pass
+
+  pass

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/ams_service.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/ams_service.py b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/ams_service.py
new file mode 100644
index 0000000..5fdd0f7
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/ams_service.py
@@ -0,0 +1,72 @@
+# !/usr/bin/env python
+"""
+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.
+
+"""
+
+from resource_management import *
+
+
+def ams_service(name='collector', action='start'):
+  import params
+
+  if name == 'collector':
+    cmd = format("{ams_collector_script} --config {ams_collector_conf_dir}")
+    pid_file = format("{ams_collector_pid_dir}/ambari-metrics-collector.pid")
+    no_op_test = format("ls {pid_file} >/dev/null 2>&1 && ps `cat {pid_file}` >/dev/null 2>&1")
+
+    if action == 'start':
+      daemon_cmd = format("{cmd} start")
+      Execute(daemon_cmd,
+              not_if=no_op_test,
+              user=params.ams_user
+      )
+
+      pass
+    elif action == 'stop':
+      daemon_cmd = format("{cmd} stop")
+      Execute(daemon_cmd,
+              user=params.ams_user
+      )
+
+      pass
+    pass
+  elif name == 'monitor':
+    cmd = format("{ams_monitor_script} --config {ams_monitor_conf_dir}")
+    pid_file = format("{ams_monitor_pid_dir}/ambari-metrics-monitor.pid")
+    no_op_test = format("ls {pid_file} >/dev/null 2>&1 && ps `cat {pid_file}` >/dev/null 2>&1")
+
+    if action == 'start':
+      daemon_cmd = format("{cmd} start")
+      Execute(daemon_cmd,
+              user=params.ams_user
+      )
+
+      pass
+    elif action == 'stop':
+
+      daemon_cmd = format("{cmd} stop")
+      Execute(daemon_cmd,
+              user=params.ams_user
+      )
+
+      pass
+    pass
+
+    #TODO
+    pass
+  pass

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/functions.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/functions.py b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/functions.py
new file mode 100644
index 0000000..a5107d6
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/functions.py
@@ -0,0 +1,40 @@
+#!/usr/bin/env python
+"""
+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 re
+import math
+import datetime
+
+from resource_management.core.shell import checked_call
+
+def calc_xmn_from_xms(heapsize_str, xmn_percent, xmn_max):
+  """
+  @param heapsize_str: str (e.g '1000m')
+  @param xmn_percent: float (e.g 0.2)
+  @param xmn_max: integer (e.g 512)
+  """
+  heapsize = int(re.search('\d+', str(heapsize_str)).group(0))
+  heapsize_unit = re.search('\D+', str(heapsize_str)).group(0)
+  xmn_val = int(math.floor(heapsize*xmn_percent))
+  xmn_val -= xmn_val % 8
+  
+  result_xmn_val = xmn_max if xmn_val > xmn_max else xmn_val
+  return str(result_xmn_val) + heapsize_unit

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/hbase.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/hbase.py b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/hbase.py
new file mode 100644
index 0000000..d861338
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/hbase.py
@@ -0,0 +1,123 @@
+#!/usr/bin/env python
+"""
+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
+
+from resource_management import *
+import sys
+
+def hbase(name=None # 'master' or 'regionserver' or 'client'
+              ):
+  import params
+
+  Directory(params.hbase_conf_dir,
+      owner = params.hbase_user,
+      group = params.user_group,
+      recursive = True
+  )
+
+  Directory (params.hbase_tmp_dir,
+             owner = params.hbase_user,
+             recursive = True
+  )
+
+  Directory (os.path.join(params.local_dir, "jars"),
+             owner = params.hbase_user,
+             group = params.user_group,
+             mode=0775,
+             recursive = True
+  )
+
+  XmlConfig("hbase-site.xml",
+            conf_dir = params.hbase_conf_dir,
+            configurations = params.config['configurations']['ams-hbase-site'],
+            configuration_attributes=params.config['configuration_attributes']['ams-hbase-site'],
+            owner = params.hbase_user,
+            group = params.user_group
+  )
+
+  if 'ams-hbase-policy' in params.config['configurations']:
+    XmlConfig("hbase-policy.xml",
+            conf_dir = params.hbase_conf_dir,
+            configurations = params.config['configurations']['ams-hbase-policy'],
+            configuration_attributes=params.config['configuration_attributes']['ams-hbase-policy'],
+            owner = params.hbase_user,
+            group = params.user_group
+    )
+  # Manually overriding ownership of file installed by hadoop package
+  else: 
+    File( format("{params.hbase_conf_dir}/hbase-policy.xml"),
+      owner = params.hbase_user,
+      group = params.user_group
+    )
+
+  File(format("{hbase_conf_dir}/hbase-env.sh"),
+       owner = params.hbase_user,
+       content=InlineTemplate(params.hbase_env_sh_template)
+  )
+
+  # Metrics properties
+  File(os.path.join(params.hbase_conf_dir, "hadoop-metrics2-hbase.properties"),
+         owner = params.hbase_user,
+         group = params.user_group,
+         content=Template("hadoop-metrics2-hbase.properties.j2")
+    )
+       
+  # hbase_TemplateConfig( params.metric_prop_file_name,
+  #   tag = 'GANGLIA-MASTER' if name == 'master' else 'GANGLIA-RS'
+  # )
+
+  hbase_TemplateConfig('regionservers')
+
+  if params.security_enabled:
+    hbase_TemplateConfig( format("hbase_{name}_jaas.conf"))
+  
+  if name != "client":
+    Directory( params.hbase_pid_dir,
+      owner = params.hbase_user,
+      recursive = True
+    )
+  
+    Directory (params.hbase_log_dir,
+      owner = params.hbase_user,
+      recursive = True
+    )
+
+  if (params.hbase_log4j_props != None):
+    File(format("{params.hbase_conf_dir}/log4j.properties"),
+         mode=0644,
+         group=params.user_group,
+         owner=params.hbase_user,
+         content=params.hbase_log4j_props
+    )
+  elif (os.path.exists(format("{params.hbase_conf_dir}/log4j.properties"))):
+    File(format("{params.hbase_conf_dir}/log4j.properties"),
+      mode=0644,
+      group=params.user_group,
+      owner=params.hbase_user
+    )
+
+
+def hbase_TemplateConfig(name, tag=None):
+  import params
+
+  TemplateConfig( format("{hbase_conf_dir}/{name}"),
+      owner = params.hbase_user,
+      template_tag = tag
+  )

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/hbase_master.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/hbase_master.py b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/hbase_master.py
new file mode 100644
index 0000000..a26254d
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/hbase_master.py
@@ -0,0 +1,70 @@
+#!/usr/bin/env python
+"""
+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 sys
+from resource_management import *
+
+from hbase import hbase
+from hbase_service import hbase_service
+from hbase_decommission import hbase_decommission
+
+         
+class HbaseMaster(Script):
+  def install(self, env):
+    self.install_packages(env)
+    
+  def configure(self, env):
+    import params
+    env.set_params(params)
+
+    hbase(name='master')
+    
+  def start(self, env):
+    import params
+    env.set_params(params)
+    self.configure(env) # for security
+
+    hbase_service( 'master',
+      action = 'start'
+    )
+    
+  def stop(self, env):
+    import params
+    env.set_params(params)
+
+    hbase_service( 'master',
+      action = 'stop'
+    )
+
+  def status(self, env):
+    import status_params
+    env.set_params(status_params)
+    pid_file = format("{pid_dir}/hbase-{hbase_user}-master.pid")
+    check_process_status(pid_file)
+
+  def decommission(self, env):
+    import params
+    env.set_params(params)
+
+    hbase_decommission(env)
+
+
+if __name__ == "__main__":
+  HbaseMaster().execute()

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/hbase_regionserver.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/hbase_regionserver.py b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/hbase_regionserver.py
new file mode 100644
index 0000000..8d66dcc
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/hbase_regionserver.py
@@ -0,0 +1,66 @@
+#!/usr/bin/env python
+"""
+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 sys
+from resource_management import *
+
+from hbase import hbase
+from hbase_service import hbase_service
+
+         
+class HbaseRegionServer(Script):
+  def install(self, env):
+    self.install_packages(env)
+    
+  def configure(self, env):
+    import params
+    env.set_params(params)
+
+    hbase(name='regionserver')
+      
+  def start(self, env):
+    import params
+    env.set_params(params)
+    self.configure(env) # for security
+
+    hbase_service( 'regionserver',
+      action = 'start'
+    )
+    
+  def stop(self, env):
+    import params
+    env.set_params(params)
+
+    hbase_service( 'regionserver',
+      action = 'stop'
+    )
+
+  def status(self, env):
+    import status_params
+    env.set_params(status_params)
+    pid_file = format("{pid_dir}/hbase-{hbase_user}-regionserver.pid")
+    check_process_status(pid_file)
+    
+  def decommission(self, env):
+    print "Decommission not yet implemented!"
+    
+
+if __name__ == "__main__":
+  HbaseRegionServer().execute()

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/hbase_service.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/hbase_service.py b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/hbase_service.py
new file mode 100644
index 0000000..f2d20d6
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/hbase_service.py
@@ -0,0 +1,51 @@
+#!/usr/bin/env python
+"""
+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.
+
+"""
+
+from resource_management import *
+
+def hbase_service(
+  name,
+  action = 'start'): # 'start' or 'stop' or 'status'
+    
+    import params
+  
+    role = name
+    cmd = format("{daemon_script} --config {hbase_conf_dir}")
+    pid_file = format("{pid_dir}/hbase-{hbase_user}-{role}.pid")
+    no_op_test = format("ls {pid_file} >/dev/null 2>&1 && ps `cat {pid_file}` >/dev/null 2>&1")
+    
+    if action == 'start':
+      daemon_cmd = format("{cmd} start {role}")
+      
+      Execute ( daemon_cmd,
+        not_if = no_op_test,
+        user = params.hbase_user
+      )
+    elif action == 'stop':
+      daemon_cmd = format("{cmd} stop {role}")
+
+      Execute ( daemon_cmd,
+        user = params.hbase_user,
+        # BUGFIX: hbase regionserver sometimes hangs when nn is in safemode
+        timeout = 30,
+        on_timeout = format("{no_op_test} && kill -9 `cat {pid_file}`")
+      )
+      
+      Execute (format("rm -f {pid_file}"))

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/metric_collector.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/metric_collector.py b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/metric_collector.py
new file mode 100644
index 0000000..ae71aa1
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/metric_collector.py
@@ -0,0 +1,63 @@
+#!/usr/bin/env python
+"""
+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.
+
+"""
+
+from resource_management import *
+from ams import ams
+from ams_service import ams_service
+from hbase import hbase
+
+class AmsCollector(Script):
+    def install(self, env):
+        self.install_packages(env)
+
+
+    def configure(self, env):
+        import params
+        env.set_params(params)
+        hbase('master')
+        hbase('regionserver')
+        ams(name='collector')
+
+    def start(self, env):
+        import params
+        env.set_params(params)
+        self.configure(env) # for security
+
+        ams_service( 'collector',
+                       action = 'start'
+        )
+
+    def stop(self, env):
+        import params
+        env.set_params(params)
+
+        ams_service( 'collector',
+                       action = 'stop'
+        )
+
+    def status(self, env):
+        import status_params
+        env.set_params(status_params)
+        pid_file = format("{ams_collector_pid_dir}/ambari-metrics-collector.pid")
+        check_process_status(pid_file)
+
+
+if __name__ == "__main__":
+    AmsCollector().execute()


[3/6] ambari git commit: AMBARI-8782: Common Services: Refactor HDP-2.2 AMS, KAFKA, KNOX, SLIDER services (Jayush Luniya)

Posted by jl...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/configuration/ams-hbase-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/configuration/ams-hbase-env.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/configuration/ams-hbase-env.xml
deleted file mode 100644
index 7a61c60..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/configuration/ams-hbase-env.xml
+++ /dev/null
@@ -1,137 +0,0 @@
-<?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>hbase_log_dir</name>
-    <value>/var/log/ams-hbase/</value>
-    <description>Log Directories for HBase.</description>
-  </property>
-  <property>
-    <name>hbase_pid_dir</name>
-    <value>/var/run/ams-hbase/</value>
-    <description>Pid Directory for HBase.</description>
-  </property>
-  <property>
-    <name>hbase_regionserver_heapsize</name>
-    <value>1024m</value>
-    <description>HBase RegionServer Heap Size.</description>
-  </property>
-  <property>
-    <name>hbase_regionserver_xmn_max</name>
-    <value>512m</value>
-    <description>HBase RegionServer maximum value for minimum heap size.</description>
-  </property>
-  <property>
-    <name>hbase_regionserver_xmn_ratio</name>
-    <value>0.2</value>
-    <description>HBase RegionServer minimum heap size is calculated as a percentage of max heap size.</description>
-  </property>
-  <property>
-    <name>hbase_master_heapsize</name>
-    <value>1024m</value>
-    <description>HBase Master Heap Size</description>
-  </property>
-  <property>
-    <name>hbase_user</name>
-    <value>hbase</value>
-    <property-type>USER</property-type>
-    <description>HBase User Name.</description>
-  </property>
-
-  <!-- hbase-env.sh -->
-  <property>
-    <name>content</name>
-    <description>This is the jinja template for hbase-env.sh file</description>
-    <value>
-      # Set environment variables here.
-
-      # The java implementation to use. Java 1.6 required.
-      export JAVA_HOME={{java64_home}}
-
-      # HBase Configuration directory
-      export HBASE_CONF_DIR=${HBASE_CONF_DIR:-{{hbase_conf_dir}}}
-
-      # Extra Java CLASSPATH elements. Optional.
-      export HBASE_CLASSPATH=${HBASE_CLASSPATH}
-
-      if [ -f "/usr/lib/ambari-metrics-hadoop-sink/ambari-metrics-hadoop-sink.jar" ]; then
-        export HBASE_CLASSPATH=${HBASE_CLASSPATH}:/usr/lib/ambari-metrics-hadoop-sink/ambari-metrics-hadoop-sink.jar
-      fi
-
-      # The maximum amount of heap to use, in MB. Default is 1000.
-      # export HBASE_HEAPSIZE=1000
-
-      # Extra Java runtime options.
-      # Below are what we set by default. May only work with SUN JVM.
-      # For more on why as well as other possible settings,
-      # see http://wiki.apache.org/hadoop/PerformanceTuning
-      export HBASE_OPTS="-XX:+UseConcMarkSweepGC -XX:ErrorFile={{hbase_log_dir}}/hs_err_pid%p.log"
-      export SERVER_GC_OPTS="-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:{{log_dir}}/gc.log-`date +'%Y%m%d%H%M'`"
-      # Uncomment below to enable java garbage collection logging.
-      # export HBASE_OPTS="$HBASE_OPTS -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:$HBASE_HOME/logs/gc-hbase.log"
-
-      # Uncomment and adjust to enable JMX exporting
-      # See jmxremote.password and jmxremote.access in $JRE_HOME/lib/management to configure remote password access.
-      # More details at: http://java.sun.com/javase/6/docs/technotes/guides/management/agent.html
-      #
-      # export HBASE_JMX_BASE="-Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"
-      export HBASE_MASTER_OPTS="-Xmx{{master_heapsize}}"
-      export HBASE_REGIONSERVER_OPTS="-Xmn{{regionserver_xmn_size}} -XX:CMSInitiatingOccupancyFraction=70  -Xms{{regionserver_heapsize}} -Xmx{{regionserver_heapsize}}"
-      # export HBASE_THRIFT_OPTS="$HBASE_JMX_BASE -Dcom.sun.management.jmxremote.port=10103"
-      # export HBASE_ZOOKEEPER_OPTS="$HBASE_JMX_BASE -Dcom.sun.management.jmxremote.port=10104"
-
-      # File naming hosts on which HRegionServers will run. $HBASE_HOME/conf/regionservers by default.
-      export HBASE_REGIONSERVERS=${HBASE_CONF_DIR}/regionservers
-
-      # Extra ssh options. Empty by default.
-      # export HBASE_SSH_OPTS="-o ConnectTimeout=1 -o SendEnv=HBASE_CONF_DIR"
-
-      # Where log files are stored. $HBASE_HOME/logs by default.
-      export HBASE_LOG_DIR={{hbase_log_dir}}
-
-      # A string representing this instance of hbase. $USER by default.
-      # export HBASE_IDENT_STRING=$USER
-
-      # The scheduling priority for daemon processes. See 'man nice'.
-      # export HBASE_NICENESS=10
-
-      # The directory where pid files are stored. /tmp by default.
-      export HBASE_PID_DIR={{hbase_pid_dir}}
-
-      # Seconds to sleep between slave commands. Unset by default. This
-      # can be useful in large clusters, where, e.g., slave rsyncs can
-      # otherwise arrive faster than the master can service them.
-      # export HBASE_SLAVE_SLEEP=0.1
-
-      # Tell HBase whether it should manage it's own instance of Zookeeper or not.
-      export HBASE_MANAGES_ZK=false
-
-      {% if security_enabled %}
-      export HBASE_OPTS="$HBASE_OPTS -Djava.security.auth.login.config={{client_jaas_config_file}}"
-      export HBASE_MASTER_OPTS="$HBASE_MASTER_OPTS -Djava.security.auth.login.config={{master_jaas_config_file}}"
-      export HBASE_REGIONSERVER_OPTS="$HBASE_REGIONSERVER_OPTS -Djava.security.auth.login.config={{regionserver_jaas_config_file}}"
-      {% endif %}
-    </value>
-  </property>
-
-</configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/configuration/ams-hbase-log4j.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/configuration/ams-hbase-log4j.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/configuration/ams-hbase-log4j.xml
deleted file mode 100644
index 24ba5b7..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/configuration/ams-hbase-log4j.xml
+++ /dev/null
@@ -1,143 +0,0 @@
-<?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 supports_final="false">
-
-  <property>
-    <name>content</name>
-    <description>Custom log4j.properties</description>
-    <value>
-      # 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.
-
-
-      # Define some default values that can be overridden by system properties
-      hbase.root.logger=INFO,console
-      hbase.security.logger=INFO,console
-      hbase.log.dir=.
-      hbase.log.file=hbase.log
-
-      # Define the root logger to the system property "hbase.root.logger".
-      log4j.rootLogger=${hbase.root.logger}
-
-      # Logging Threshold
-      log4j.threshold=ALL
-
-      #
-      # Daily Rolling File Appender
-      #
-      log4j.appender.DRFA=org.apache.log4j.DailyRollingFileAppender
-      log4j.appender.DRFA.File=${hbase.log.dir}/${hbase.log.file}
-
-      # Rollver at midnight
-      log4j.appender.DRFA.DatePattern=.yyyy-MM-dd
-
-      # 30-day backup
-      #log4j.appender.DRFA.MaxBackupIndex=30
-      log4j.appender.DRFA.layout=org.apache.log4j.PatternLayout
-
-      # Pattern format: Date LogLevel LoggerName LogMessage
-      log4j.appender.DRFA.layout.ConversionPattern=%d{ISO8601} %-5p [%t] %c{2}: %m%n
-
-      # Rolling File Appender properties
-      hbase.log.maxfilesize=256MB
-      hbase.log.maxbackupindex=20
-
-      # Rolling File Appender
-      log4j.appender.RFA=org.apache.log4j.RollingFileAppender
-      log4j.appender.RFA.File=${hbase.log.dir}/${hbase.log.file}
-
-      log4j.appender.RFA.MaxFileSize=${hbase.log.maxfilesize}
-      log4j.appender.RFA.MaxBackupIndex=${hbase.log.maxbackupindex}
-
-      log4j.appender.RFA.layout=org.apache.log4j.PatternLayout
-      log4j.appender.RFA.layout.ConversionPattern=%d{ISO8601} %-5p [%t] %c{2}: %m%n
-
-      #
-      # Security audit appender
-      #
-      hbase.security.log.file=SecurityAuth.audit
-      hbase.security.log.maxfilesize=256MB
-      hbase.security.log.maxbackupindex=20
-      log4j.appender.RFAS=org.apache.log4j.RollingFileAppender
-      log4j.appender.RFAS.File=${hbase.log.dir}/${hbase.security.log.file}
-      log4j.appender.RFAS.MaxFileSize=${hbase.security.log.maxfilesize}
-      log4j.appender.RFAS.MaxBackupIndex=${hbase.security.log.maxbackupindex}
-      log4j.appender.RFAS.layout=org.apache.log4j.PatternLayout
-      log4j.appender.RFAS.layout.ConversionPattern=%d{ISO8601} %p %c: %m%n
-      log4j.category.SecurityLogger=${hbase.security.logger}
-      log4j.additivity.SecurityLogger=false
-      #log4j.logger.SecurityLogger.org.apache.hadoop.hbase.security.access.AccessController=TRACE
-
-      #
-      # Null Appender
-      #
-      log4j.appender.NullAppender=org.apache.log4j.varia.NullAppender
-
-      #
-      # console
-      # Add "console" to rootlogger above if you want to use this
-      #
-      log4j.appender.console=org.apache.log4j.ConsoleAppender
-      log4j.appender.console.target=System.err
-      log4j.appender.console.layout=org.apache.log4j.PatternLayout
-      log4j.appender.console.layout.ConversionPattern=%d{ISO8601} %-5p [%t] %c{2}: %m%n
-
-      # Custom Logging levels
-
-      log4j.logger.org.apache.zookeeper=INFO
-      #log4j.logger.org.apache.hadoop.fs.FSNamesystem=DEBUG
-      log4j.logger.org.apache.hadoop.hbase=DEBUG
-      # Make these two classes INFO-level. Make them DEBUG to see more zk debug.
-      log4j.logger.org.apache.hadoop.hbase.zookeeper.ZKUtil=INFO
-      log4j.logger.org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher=INFO
-      #log4j.logger.org.apache.hadoop.dfs=DEBUG
-      # Set this class to log INFO only otherwise its OTT
-      # Enable this to get detailed connection error/retry logging.
-      # log4j.logger.org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation=TRACE
-
-
-      # Uncomment this line to enable tracing on _every_ RPC call (this can be a lot of output)
-      #log4j.logger.org.apache.hadoop.ipc.HBaseServer.trace=DEBUG
-
-      # Uncomment the below if you want to remove logging of client region caching'
-      # and scan of .META. messages
-      # log4j.logger.org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation=INFO
-      # log4j.logger.org.apache.hadoop.hbase.client.MetaScanner=INFO
-
-    </value>
-  </property>
-
-</configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/configuration/ams-hbase-policy.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/configuration/ams-hbase-policy.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/configuration/ams-hbase-policy.xml
deleted file mode 100644
index febbd44..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/configuration/ams-hbase-policy.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<?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 supports_final="true">
-  <property>
-    <name>security.client.protocol.acl</name>
-    <value>*</value>
-    <description>ACL for HRegionInterface protocol implementations (ie.
-      clients talking to HRegionServers)
-      The ACL is a comma-separated list of user and group names. The user and
-      group list is separated by a blank. For e.g. "alice,bob users,wheel".
-      A special value of "*" means all users are allowed.</description>
-  </property>
-
-  <property>
-    <name>security.admin.protocol.acl</name>
-    <value>*</value>
-    <description>ACL for HMasterInterface protocol implementation (ie.
-      clients talking to HMaster for admin operations).
-      The ACL is a comma-separated list of user and group names. The user and
-      group list is separated by a blank. For e.g. "alice,bob users,wheel".
-      A special value of "*" means all users are allowed.</description>
-  </property>
-
-  <property>
-    <name>security.masterregion.protocol.acl</name>
-    <value>*</value>
-    <description>ACL for HMasterRegionInterface protocol implementations
-      (for HRegionServers communicating with HMaster)
-      The ACL is a comma-separated list of user and group names. The user and
-      group list is separated by a blank. For e.g. "alice,bob users,wheel".
-      A special value of "*" means all users are allowed.</description>
-  </property>
-</configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/configuration/ams-hbase-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/configuration/ams-hbase-site.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/configuration/ams-hbase-site.xml
deleted file mode 100644
index 9d35ba2..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/configuration/ams-hbase-site.xml
+++ /dev/null
@@ -1,268 +0,0 @@
-<?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>hbase.rootdir</name>
-    <value>file:///var/lib/ambari-metrics-collector/hbase</value>
-    <description>
-      AMS service uses HBase as default storage backend. Set the rootdir for
-      HBase to either local filesystem path if using AMS in embedded mode or
-      to a HDFS dir, example: hdfs://namenode.example.org:9000/hbase.  By
-      default HBase writes into /tmp. Change this configuration else all data
-      will be lost on machine restart.
-    </description>
-  </property>
-  <property>
-    <name>hbase.tmp.dir</name>
-    <value>/var/lib/ambari-metrics-collector/hbase-tmp</value>
-    <description>
-      Temporary directory on the local filesystem.
-      Change this setting to point to a location more permanent
-      than '/tmp' (The '/tmp' directory is often cleared on
-      machine restart).
-    </description>
-  </property>
-  <property>
-    <name>hbase.local.dir</name>
-    <value>${hbase.tmp.dir}/local</value>
-    <description>Directory on the local filesystem to be used as a local storage
-    </description>
-  </property>
-  <property>
-    <name>hbase.cluster.distributed</name>
-    <value>false</value>
-    <description>
-      The mode the cluster will be in. Possible values are false for
-      standalone mode and true for distributed mode. If false, startup will run
-      all HBase and ZooKeeper daemons together in the one JVM.
-    </description>
-  </property>
-  <property>
-    <name>hbase.master.wait.on.regionservers.mintostart</name>
-    <value>1</value>
-    <description>
-      Ensure that HBase Master waits for # many region server to start.
-    </description>
-  </property>
-  <property>
-    <name>hbase.zookeeper.quorum</name>
-    <value>localhost</value>
-    <description>Comma separated list of servers in the ZooKeeper Quorum.
-      For example, "host1.mydomain.com,host2.mydomain.com,host3.mydomain.com".
-      By default this is set to localhost for local and pseudo-distributed modes
-      of operation. For a fully-distributed setup, this should be set to a full
-      list of ZooKeeper quorum servers. If HBASE_MANAGES_ZK is set in hbase-env.sh
-      this is the list of servers which we will start/stop ZooKeeper on.
-    </description>
-  </property>
-  <property>
-    <name>hbase.master.info.bindAddress</name>
-    <value>0.0.0.0</value>
-    <description>The bind address for the HBase Master web UI</description>
-  </property>
-  <property>
-    <name>hbase.master.info.port</name>
-    <value>61310</value>
-    <description>The port for the HBase Master web UI.</description>
-  </property>
-  <property>
-    <name>hbase.regionserver.info.port</name>
-    <value>61330</value>
-    <description>The port for the HBase RegionServer web UI.</description>
-  </property>
-  <property>
-    <name>hbase.master.port</name>
-    <value>61300</value>
-    <description>The port for the HBase Master web UI.</description>
-  </property>
-  <property>
-    <name>hbase.regionserver.port</name>
-    <value>61320</value>
-    <description>The port for the HBase RegionServer web UI.</description>
-  </property>
-  <property>
-    <name>hbase.hregion.majorcompaction</name>
-    <value>0</value>
-    <description>
-      The time (in milliseconds) between 'major' compactions of all
-      HStoreFiles in a region.
-      0 to disable automated major compactions.
-    </description>
-  </property>
-  <property>
-    <name>phoenix.query.spoolThresholdBytes</name>
-    <value>12582912</value>
-    <description>
-      Threshold size in bytes after which results from parallelly executed
-      query results are spooled to disk. Default is 20 mb.
-    </description>
-  </property>
-  <property>
-    <name>hbase.zookeeper.property.dataDir</name>
-    <value>${hbase.tmp.dir}/zookeeper</value>
-    <description>
-      Property from ZooKeeper's config zoo.cfg.
-      The directory where the snapshot is stored.
-    </description>
-  </property>
-  <property>
-    <name>hbase.client.scanner.caching</name>
-    <value>10000</value>
-    <description>
-      Number of rows that will be fetched when calling next on a scanner
-      if it is not served from (local, client) memory.
-    </description>
-  </property>
-  <property>
-    <name>hfile.block.cache.size</name>
-    <value>0.3</value>
-    <description>
-      Percentage of maximum heap (-Xmx setting) to allocate to block cache
-      used by a StoreFile. Default of 0.4 means allocate 40%.
-    </description>
-  </property>
-  <property>
-    <name>hbase.regionserver.global.memstore.upperLimit</name>
-    <value>0.5</value>
-    <description>
-      Maximum size of all memstores in a region server before new
-      updates are blocked and flushes are forced. Defaults to 40% of heap
-    </description>
-  </property>
-  <property>
-    <name>hbase.regionserver.global.memstore.lowerLimit</name>
-    <value>0.4</value>
-    <description>
-      When memstores are being forced to flush to make room in
-      memory, keep flushing until we hit this mark. Defaults to 35% of heap.
-      This value equal to hbase.regionserver.global.memstore.upperLimit causes
-      the minimum possible flushing to occur when updates are blocked due to
-      memstore limiting.
-    </description>
-  </property>
-  <property>
-    <name>phoenix.groupby.maxCacheSize</name>
-    <value>307200000</value>
-    <description>
-      Size in bytes of pages cached during GROUP BY spilling. Default is 100Mb.
-    </description>
-  </property>
-  <property>
-    <name>hbase.hregion.memstore.block.multiplier</name>
-    <value>4</value>
-    <description>
-      Block updates if memstore has hbase.hregion.memstore.block.multiplier
-      times hbase.hregion.memstore.flush.size bytes. Useful preventing runaway
-      memstore during spikes in update traffic.
-    </description>
-  </property>
-  <property>
-    <name>hbase.hstore.flusher.count</name>
-    <value>2</value>
-    <description>
-      The number of flush threads. With fewer threads, the MemStore flushes
-      will be queued. With more threads, the flushes will be executed in parallel,
-      increasing the load on HDFS, and potentially causing more compactions.
-    </description>
-  </property>
-  <property>
-    <name>phoenix.query.timeoutMs</name>
-    <value>1200000</value>
-    <description>
-      Number of milliseconds after which a query will timeout on the client.
-      Default is 10 min.
-    </description>
-  </property>
-  <property>
-    <name>hbase.client.scanner.timeout.period</name>
-    <value>900000</value>
-    <description>
-      Client scanner lease period in milliseconds.
-    </description>
-  </property>
-  <property>
-    <name>hbase.regionserver.thread.compaction.large</name>
-    <value>2</value>
-    <description>
-      Configuration key for the large compaction threads.
-    </description>
-  </property>
-  <property>
-    <name>hbase.regionserver.thread.compaction.small</name>
-    <value>3</value>
-    <description>
-      Configuration key for the small compaction threads.
-    </description>
-  </property>
-  <property>
-    <name>hbase.zookeeper.property.clientPort</name>
-    <value>61181</value>
-  </property>
-  <property>
-    <name>hbase.zookeeper.peerport</name>
-    <value>61288</value>
-  </property>
-  <property>
-    <name>hbase.zookeeper.leaderport</name>
-    <value>61388</value>
-  </property>
-  <property>
-    <name>hbase.hstore.blockingStoreFiles</name>
-    <value>200</value>
-    <description>
-      If more than this number of StoreFiles exist in any one Store
-      (one StoreFile is written per flush of MemStore), updates are blocked for
-      this region until a compaction is completed, or until
-      hbase.hstore.blockingWaitTime has been exceeded.
-    </description>
-  </property>
-  <property>
-    <name>hbase.hregion.memstore.flush.size</name>
-    <value>134217728</value>
-    <description>
-      Memstore will be flushed to disk if size of the memstore exceeds this
-      number of bytes. Value is checked by a thread that runs every
-      hbase.server.thread.wakefrequency.
-    </description>
-  </property>
-  <property>
-    <name>phoenix.query.spoolThresholdBytes</name>
-    <value>12582912</value>
-  </property>
-  <property>
-    <name>hbase.snapshot.enabled</name>
-    <value>false</value>
-    <description>Enable/Disable HBase snapshots.</description>
-  </property>
-  <property>
-    <name>hbase.replication</name>
-    <value>false</value>
-    <description>Enable/Disable HBase replication.</description>
-  </property>
-  <property>
-    <name>zookeeper.session.timeout</name>
-    <value>120000</value>
-    <description>ZooKeeper session timeout in milliseconds.</description>
-  </property>
-
-</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/configuration/ams-log4j.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/configuration/ams-log4j.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/configuration/ams-log4j.xml
deleted file mode 100644
index 3f2e148..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/configuration/ams-log4j.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-<?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 supports_final="false">
-
-  <property>
-    <name>content</name>
-    <description>Custom log4j.properties</description>
-    <value>
-      #
-      # 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.
-      #
-
-      # Define some default values that can be overridden by system properties
-      # Root logger option
-      log4j.rootLogger=INFO,file
-
-      # Direct log messages to a log file
-      log4j.appender.file=org.apache.log4j.RollingFileAppender
-      log4j.appender.file.File=/var/log/ambari-metrics-collector/ambari-metrics-collector.log
-      log4j.appender.file.MaxFileSize=80MB
-      log4j.appender.file.MaxBackupIndex=60
-      log4j.appender.file.layout=org.apache.log4j.PatternLayout
-      log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p [%t] %c{1}:%L - %m%n
-    </value>
-  </property>
-
-</configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/configuration/ams-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/configuration/ams-site.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/configuration/ams-site.xml
deleted file mode 100644
index f84a418..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/configuration/ams-site.xml
+++ /dev/null
@@ -1,221 +0,0 @@
-<?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>timeline.metrics.service.operation.mode</name>
-    <value>embedded</value>
-    <description>
-      Service Operation modes:
-      1) embedded: Metrics stored on local FS, HBase in Standalone mode
-      2) distributed: HBase daemons writing to HDFS
-      3) external: External HBase storage backend
-    </description>
-  </property>
-  <property>
-    <name>timeline.metrics.aggregator.checkpoint.dir</name>
-    <value>/tmp</value>
-    <description>
-      Directory to store aggregator checkpoints. Change to a permanent
-      location so that checkpoint ar not lost.
-    </description>
-  </property>
-  <property>
-    <name>timeline.metrics.host.aggregator.hourly.interval</name>
-    <value>3600</value>
-    <description>
-      Time in seconds to sleep for the hourly resolution host based
-      aggregator. Default resolution is 1 hour.
-    </description>
-  </property>
-  <property>
-    <name>timeline.metrics.host.aggregator.minute.interval</name>
-    <value>300</value>
-    <description>
-      Time in seconds to sleep for the minute resolution host based
-      aggregator. Default resolution is 5 minutes.
-    </description>
-  </property>
-  <property>
-    <name>timeline.metrics.cluster.aggregator.hourly.interval</name>
-    <value>3600</value>
-    <description>
-      Time in seconds to sleep for the hourly resolution cluster wide
-      aggregator. Default is 1 hour.
-    </description>
-  </property>
-  <property>
-    <name>timeline.metrics.cluster.aggregator.minute.interval</name>
-    <value>120</value>
-    <description>
-      Time in seconds to sleep for the minute resolution cluster wide
-      aggregator. Default resolution is 2 minutes.
-    </description>
-  </property>
-  <property>
-    <name>timeline.metrics.host.aggregator.hourly.checkpointCutOffMultiplier</name>
-    <value>2</value>
-    <description>
-      Multiplier value * interval = Max allowed checkpoint lag. Effectively
-      if aggregator checkpoint is greater than max allowed checkpoint delay,
-      the checkpoint will be discarded by the aggregator.
-    </description>
-  </property>
-  <property>
-    <name>timeline.metrics.host.aggregator.minute.checkpointCutOffMultiplier</name>
-    <value>2</value>
-    <description>
-      Multiplier value * interval = Max allowed checkpoint lag. Effectively
-      if aggregator checkpoint is greater than max allowed checkpoint delay,
-      the checkpoint will be discarded by the aggregator.
-    </description>
-  </property>
-  <property>
-    <name>timeline.metrics.cluster.aggregator.hourly.checkpointCutOffMultiplier</name>
-    <value>2</value>
-    <description>
-      Multiplier value * interval = Max allowed checkpoint lag. Effectively
-      if aggregator checkpoint is greater than max allowed checkpoint delay,
-      the checkpoint will be discarded by the aggregator.
-    </description>
-  </property>
-  <property>
-    <name>timeline.metrics.cluster.aggregator.minute.checkpointCutOffMultiplier</name>
-    <value>2</value>
-    <description>
-      Multiplier value * interval = Max allowed checkpoint lag. Effectively
-      if aggregator checkpoint is greater than max allowed checkpoint delay,
-      the checkpoint will be discarded by the aggregator.
-    </description>
-  </property>
-  <property>
-    <name>timeline.metrics.host.aggregator.hourly.disabled</name>
-    <value>false</value>
-    <description>
-      Disable host based hourly aggregations.
-    </description>
-  </property>
-  <property>
-    <name>timeline.metrics.host.aggregator.minute.disabled</name>
-    <value>false</value>
-    <description>
-      Disable host based minute aggregations.
-    </description>
-  </property>
-  <property>
-    <name>timeline.metrics.cluster.aggregator.hourly.disabled</name>
-    <value>false</value>
-    <description>
-      Disable cluster based hourly aggregations.
-    </description>
-  </property>
-  <property>
-    <name>timeline.metrics.cluster.aggregator.minute.disabled</name>
-    <value>false</value>
-    <description>
-      Disable cluster based minute aggregations.
-    </description>
-  </property>
-  <property>
-    <name>timeline.metrics.cluster.aggregator.minute.timeslice.interval</name>
-    <value>15</value>
-    <description>
-      Lowest resolution of desired data for cluster level minute aggregates.
-    </description>
-  </property>
-  <property>
-    <name>timeline.metrics.host.aggregator.hourly.ttl</name>
-    <value>2592000</value>
-    <description>
-      Host based hourly resolution data purge interval. Default is 30 days.
-    </description>
-  </property>
-  <property>
-    <name>timeline.metrics.host.aggregator.minute.ttl</name>
-    <value>604800</value>
-    <description>
-      Host based minute resolution data purge interval. Default is 7 days.
-    </description>
-  </property>
-  <property>
-    <name>timeline.metrics.cluster.aggregator.minute.ttl</name>
-    <value>2592000</value>
-    <description>
-      Cluster wide minute resolution data purge interval. Default is 30 days.
-    </description>
-  </property>
-  <property>
-    <name>timeline.metrics.cluster.aggregator.hourly.ttl</name>
-    <value>31536000</value>
-    <description>
-      Cluster wide hourly resolution data purge interval. Default is 1 year.
-    </description>
-  </property>
-  <property>
-    <name>timeline.metrics.host.aggregator.ttl</name>
-    <value>86400</value>
-    <description>
-      1 minute resolution data purge interval. Default is 1 day.
-    </description>
-  </property>
-  <property>
-    <name>timeline.metrics.hbase.data.block.encoding</name>
-    <value>FAST_DIFF</value>
-    <description>
-      Codecs are enabled on a table by setting the DATA_BLOCK_ENCODING property.
-      Default encoding is FAST_DIFF. This can be changed only before creating
-      tables.
-    </description>
-  </property>
-  <property>
-    <name>timeline.metrics.hbase.compression.scheme</name>
-    <value>SNAPPY</value>
-    <description>
-      Compression codes need to be installed and available before setting the
-      scheme. Default compression is SNAPPY. Disable by setting to None.
-      This can be changed only before creating tables.
-    </description>
-  </property>
-  <property>
-    <name>timeline.metrics.service.default.result.limit</name>
-    <value>5760</value>
-    <description>
-      Max result limit on number of rows returned. Calculated as follows:
-      4 aggregate metrics/min * 60 * 24: Retrieve aggregate data for 1 day.
-    </description>
-  </property>
-  <property>
-    <name>timeline.metrics.service.checkpointDelay</name>
-    <value>60</value>
-    <description>
-      Time in seconds to sleep on the first run or when the checkpoint is
-      too old.
-    </description>
-  </property>
-  <property>
-    <name>timeline.metrics.service.resultset.fetchSize</name>
-    <value>2000</value>
-    <description>
-      JDBC resultset prefect size for aggregator queries.
-    </description>
-  </property>
-</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/metainfo.xml
index 51d8177..f0fa469 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/metainfo.xml
@@ -20,85 +20,7 @@
   <services>
     <service>
       <name>AMS</name>
-      <displayName>AMS</displayName>
-      <version>0.1.0</version>
-      <comment>Ambari Metrics Service - Monitoring service that provides
-        storage and retrieval capability for metrics collected from services
-        &amp; hosts.
-      </comment>
-      <components>
-        <component>
-          <name>METRIC_COLLECTOR</name>
-          <displayName>Metric Collector</displayName>
-          <category>MASTER</category>
-          <cardinality>1+</cardinality>
-          <dependencies>
-            <dependency>
-              <name>ZOOKEEPER/ZOOKEEPER_SERVER</name>
-              <scope>cluster</scope>
-              <auto-deploy>
-                <enabled>true</enabled>
-              </auto-deploy>
-            </dependency>
-          </dependencies>
-          <commandScript>
-            <script>scripts/metric_collector.py</script>
-            <scriptType>PYTHON</scriptType>
-            <timeout>600</timeout>
-          </commandScript>
-        </component>
-        <component>
-          <name>METRIC_MONITOR</name>
-          <displayName>Metric Monitor</displayName>
-          <category>SLAVE</category>
-          <cardinality>ALL</cardinality>
-          <auto-deploy>
-            <enabled>true</enabled>
-          </auto-deploy>
-          <commandScript>
-            <script>scripts/metric_monitor.py</script>
-            <scriptType>PYTHON</scriptType>
-            <timeout>600</timeout>
-          </commandScript>
-        </component>
-      </components>
-
-      <osSpecifics>
-        <osSpecific>
-          <osFamily>any</osFamily>
-          <packages>
-            <package>
-              <name>ambari-metrics-collector</name>
-            </package>
-            <package>
-              <name>ambari-metrics-monitor</name>
-            </package>
-            <package>
-              <name>hadoop_2_2_*</name>
-            </package>
-          </packages>
-        </osSpecific>
-      </osSpecifics>
-
-      <commandScript>
-        <script>scripts/service_check.py</script>
-        <scriptType>PYTHON</scriptType>
-        <timeout>300</timeout>
-      </commandScript>
-
-      <requiredServices>
-        <service>ZOOKEEPER</service>
-      </requiredServices>
-
-      <configuration-dependencies>
-        <config-type>ams-site</config-type>
-        <config-type>ams-log4j</config-type>
-        <config-type>ams-hbase-policy</config-type>
-        <config-type>ams-hbase-site</config-type>
-        <config-type>ams-hbase-env</config-type>
-        <config-type>ams-hbase-log4j</config-type>
-      </configuration-dependencies>
-
+      <extends>common-services/AMS/0.1.0</extends>
     </service>
   </services>
 </metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/files/alert_ambari_metrics_monitor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/files/alert_ambari_metrics_monitor.py b/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/files/alert_ambari_metrics_monitor.py
deleted file mode 100644
index 5841267..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/files/alert_ambari_metrics_monitor.py
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/usr/bin/env python
-
-"""
-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 socket
-
-from resource_management.libraries.functions.check_process_status import check_process_status
-from resource_management.core.exceptions import ComponentIsNotRunning
-
-RESULT_CODE_OK = 'OK'
-RESULT_CODE_CRITICAL = 'CRITICAL'
-RESULT_CODE_UNKNOWN = 'UNKNOWN'
-
-AMS_MONITOR_PID_PATH = '/var/run/ambari-metrics-monitor/ambari-metrics-monitor.pid'
-
-
-def get_tokens():
-  """
-  Returns a tuple of tokens in the format {{site/property}} that will be used
-  to build the dictionary passed into execute
-  """
-  return ()
-
-
-def is_monitor_process_live(pid_file):
-  """
-  Gets whether the AMS monitor represented by the specified file is running.
-  :param pid_file: the PID file of the monitor to check
-  :return: True if the monitor is running, False otherwise
-  """
-  live = False
-
-  try:
-    check_process_status(pid_file)
-    live = True
-  except ComponentIsNotRunning:
-    pass
-
-  return live
-
-
-def execute(parameters=None, host_name=None):
-  """
-  Returns a tuple containing the result code and a pre-formatted result label
-
-  Keyword arguments:
-  parameters (dictionary): a mapping of parameter key to value
-  host_name (string): the name of this host where the alert is running
-  """
-
-  if parameters is None:
-    return (RESULT_CODE_UNKNOWN, ['There were no parameters supplied to the script.'])
-
-  if host_name is None:
-    host_name = socket.getfqdn()
-
-  ams_monitor_process_running = is_monitor_process_live(AMS_MONITOR_PID_PATH)
-
-  alert_state = RESULT_CODE_OK if ams_monitor_process_running else RESULT_CODE_CRITICAL
-
-  alert_label = 'Ambari Monitor is running on {0}' if ams_monitor_process_running else 'Ambari Monitor is NOT running on {0}'
-  alert_label = alert_label.format(host_name)
-
-  return (alert_state, [alert_label])

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/files/hbaseSmokeVerify.sh
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/files/hbaseSmokeVerify.sh b/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/files/hbaseSmokeVerify.sh
deleted file mode 100644
index 5c320c0..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/files/hbaseSmokeVerify.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/env bash
-#
-#
-# 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.
-#
-#
-conf_dir=$1
-data=$2
-hbase_cmd=$3
-echo "scan 'ambarismoketest'" | $hbase_cmd --config $conf_dir shell > /tmp/hbase_chk_verify
-cat /tmp/hbase_chk_verify
-echo "Looking for $data"
-grep -q $data /tmp/hbase_chk_verify
-if [ "$?" -ne 0 ]
-then
-  exit 1
-fi
-
-grep -q '1 row(s)' /tmp/hbase_chk_verify

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/__init__.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/__init__.py b/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/__init__.py
deleted file mode 100644
index 5561e10..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/__init__.py
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/usr/bin/env python
-"""
-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.
-
-"""

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/ams.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/ams.py b/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/ams.py
deleted file mode 100644
index 1f09d7d..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/ams.py
+++ /dev/null
@@ -1,89 +0,0 @@
-#!/usr/bin/env python
-"""
-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.
-
-"""
-
-from resource_management import *
-
-
-def ams(name=None):
-  import params
-
-  if name == 'collector':
-    Directory(params.ams_collector_conf_dir,
-              owner=params.ams_user,
-              group=params.user_group,
-              recursive=True
-    )
-
-    XmlConfig("ams-site.xml",
-              conf_dir=params.ams_collector_conf_dir,
-              configurations=params.config['configurations']['ams-site'],
-              configuration_attributes=params.config['configuration_attributes']['ams-site'],
-              owner=params.ams_user,
-              group=params.user_group
-    )
-
-    XmlConfig( "hbase-site.xml",
-               conf_dir = params.ams_collector_conf_dir,
-               configurations = params.config['configurations']['ams-hbase-site'],
-               configuration_attributes=params.config['configuration_attributes']['ams-hbase-site'],
-               owner = params.ams_user,
-               group = params.user_group
-    )
-
-    if (params.log4j_props != None):
-      File(format("{params.ams_collector_conf_dir}/log4j.properties"),
-           mode=0644,
-           group=params.user_group,
-           owner=params.ams_user,
-           content=params.log4j_props
-      )
-
-    File(format("{ams_collector_conf_dir}/ams-env.sh"),
-         owner=params.ams_user,
-         content=InlineTemplate(params.ams_env_sh_template)
-    )
-
-    pass
-
-  elif name == 'monitor':
-    Directory(params.ams_monitor_conf_dir,
-              owner=params.ams_user,
-              group=params.user_group,
-              recursive=True
-    )
-
-    TemplateConfig(
-      format("{ams_monitor_conf_dir}/metric_monitor.ini"),
-      owner=params.ams_user,
-      group=params.user_group,
-      template_tag=None
-    )
-
-    TemplateConfig(
-      format("{ams_monitor_conf_dir}/metric_groups.conf"),
-      owner=params.ams_user,
-      group=params.user_group,
-      template_tag=None
-    )
-
-    # TODO
-    pass
-
-  pass

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/ams_service.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/ams_service.py b/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/ams_service.py
deleted file mode 100644
index 5fdd0f7..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/ams_service.py
+++ /dev/null
@@ -1,72 +0,0 @@
-# !/usr/bin/env python
-"""
-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.
-
-"""
-
-from resource_management import *
-
-
-def ams_service(name='collector', action='start'):
-  import params
-
-  if name == 'collector':
-    cmd = format("{ams_collector_script} --config {ams_collector_conf_dir}")
-    pid_file = format("{ams_collector_pid_dir}/ambari-metrics-collector.pid")
-    no_op_test = format("ls {pid_file} >/dev/null 2>&1 && ps `cat {pid_file}` >/dev/null 2>&1")
-
-    if action == 'start':
-      daemon_cmd = format("{cmd} start")
-      Execute(daemon_cmd,
-              not_if=no_op_test,
-              user=params.ams_user
-      )
-
-      pass
-    elif action == 'stop':
-      daemon_cmd = format("{cmd} stop")
-      Execute(daemon_cmd,
-              user=params.ams_user
-      )
-
-      pass
-    pass
-  elif name == 'monitor':
-    cmd = format("{ams_monitor_script} --config {ams_monitor_conf_dir}")
-    pid_file = format("{ams_monitor_pid_dir}/ambari-metrics-monitor.pid")
-    no_op_test = format("ls {pid_file} >/dev/null 2>&1 && ps `cat {pid_file}` >/dev/null 2>&1")
-
-    if action == 'start':
-      daemon_cmd = format("{cmd} start")
-      Execute(daemon_cmd,
-              user=params.ams_user
-      )
-
-      pass
-    elif action == 'stop':
-
-      daemon_cmd = format("{cmd} stop")
-      Execute(daemon_cmd,
-              user=params.ams_user
-      )
-
-      pass
-    pass
-
-    #TODO
-    pass
-  pass

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/functions.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/functions.py b/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/functions.py
deleted file mode 100644
index a5107d6..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/functions.py
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/usr/bin/env python
-"""
-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 re
-import math
-import datetime
-
-from resource_management.core.shell import checked_call
-
-def calc_xmn_from_xms(heapsize_str, xmn_percent, xmn_max):
-  """
-  @param heapsize_str: str (e.g '1000m')
-  @param xmn_percent: float (e.g 0.2)
-  @param xmn_max: integer (e.g 512)
-  """
-  heapsize = int(re.search('\d+', str(heapsize_str)).group(0))
-  heapsize_unit = re.search('\D+', str(heapsize_str)).group(0)
-  xmn_val = int(math.floor(heapsize*xmn_percent))
-  xmn_val -= xmn_val % 8
-  
-  result_xmn_val = xmn_max if xmn_val > xmn_max else xmn_val
-  return str(result_xmn_val) + heapsize_unit

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/hbase.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/hbase.py b/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/hbase.py
deleted file mode 100644
index d861338..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/hbase.py
+++ /dev/null
@@ -1,123 +0,0 @@
-#!/usr/bin/env python
-"""
-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
-
-from resource_management import *
-import sys
-
-def hbase(name=None # 'master' or 'regionserver' or 'client'
-              ):
-  import params
-
-  Directory(params.hbase_conf_dir,
-      owner = params.hbase_user,
-      group = params.user_group,
-      recursive = True
-  )
-
-  Directory (params.hbase_tmp_dir,
-             owner = params.hbase_user,
-             recursive = True
-  )
-
-  Directory (os.path.join(params.local_dir, "jars"),
-             owner = params.hbase_user,
-             group = params.user_group,
-             mode=0775,
-             recursive = True
-  )
-
-  XmlConfig("hbase-site.xml",
-            conf_dir = params.hbase_conf_dir,
-            configurations = params.config['configurations']['ams-hbase-site'],
-            configuration_attributes=params.config['configuration_attributes']['ams-hbase-site'],
-            owner = params.hbase_user,
-            group = params.user_group
-  )
-
-  if 'ams-hbase-policy' in params.config['configurations']:
-    XmlConfig("hbase-policy.xml",
-            conf_dir = params.hbase_conf_dir,
-            configurations = params.config['configurations']['ams-hbase-policy'],
-            configuration_attributes=params.config['configuration_attributes']['ams-hbase-policy'],
-            owner = params.hbase_user,
-            group = params.user_group
-    )
-  # Manually overriding ownership of file installed by hadoop package
-  else: 
-    File( format("{params.hbase_conf_dir}/hbase-policy.xml"),
-      owner = params.hbase_user,
-      group = params.user_group
-    )
-
-  File(format("{hbase_conf_dir}/hbase-env.sh"),
-       owner = params.hbase_user,
-       content=InlineTemplate(params.hbase_env_sh_template)
-  )
-
-  # Metrics properties
-  File(os.path.join(params.hbase_conf_dir, "hadoop-metrics2-hbase.properties"),
-         owner = params.hbase_user,
-         group = params.user_group,
-         content=Template("hadoop-metrics2-hbase.properties.j2")
-    )
-       
-  # hbase_TemplateConfig( params.metric_prop_file_name,
-  #   tag = 'GANGLIA-MASTER' if name == 'master' else 'GANGLIA-RS'
-  # )
-
-  hbase_TemplateConfig('regionservers')
-
-  if params.security_enabled:
-    hbase_TemplateConfig( format("hbase_{name}_jaas.conf"))
-  
-  if name != "client":
-    Directory( params.hbase_pid_dir,
-      owner = params.hbase_user,
-      recursive = True
-    )
-  
-    Directory (params.hbase_log_dir,
-      owner = params.hbase_user,
-      recursive = True
-    )
-
-  if (params.hbase_log4j_props != None):
-    File(format("{params.hbase_conf_dir}/log4j.properties"),
-         mode=0644,
-         group=params.user_group,
-         owner=params.hbase_user,
-         content=params.hbase_log4j_props
-    )
-  elif (os.path.exists(format("{params.hbase_conf_dir}/log4j.properties"))):
-    File(format("{params.hbase_conf_dir}/log4j.properties"),
-      mode=0644,
-      group=params.user_group,
-      owner=params.hbase_user
-    )
-
-
-def hbase_TemplateConfig(name, tag=None):
-  import params
-
-  TemplateConfig( format("{hbase_conf_dir}/{name}"),
-      owner = params.hbase_user,
-      template_tag = tag
-  )

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/hbase_master.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/hbase_master.py b/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/hbase_master.py
deleted file mode 100644
index a26254d..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/hbase_master.py
+++ /dev/null
@@ -1,70 +0,0 @@
-#!/usr/bin/env python
-"""
-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 sys
-from resource_management import *
-
-from hbase import hbase
-from hbase_service import hbase_service
-from hbase_decommission import hbase_decommission
-
-         
-class HbaseMaster(Script):
-  def install(self, env):
-    self.install_packages(env)
-    
-  def configure(self, env):
-    import params
-    env.set_params(params)
-
-    hbase(name='master')
-    
-  def start(self, env):
-    import params
-    env.set_params(params)
-    self.configure(env) # for security
-
-    hbase_service( 'master',
-      action = 'start'
-    )
-    
-  def stop(self, env):
-    import params
-    env.set_params(params)
-
-    hbase_service( 'master',
-      action = 'stop'
-    )
-
-  def status(self, env):
-    import status_params
-    env.set_params(status_params)
-    pid_file = format("{pid_dir}/hbase-{hbase_user}-master.pid")
-    check_process_status(pid_file)
-
-  def decommission(self, env):
-    import params
-    env.set_params(params)
-
-    hbase_decommission(env)
-
-
-if __name__ == "__main__":
-  HbaseMaster().execute()

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/hbase_regionserver.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/hbase_regionserver.py b/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/hbase_regionserver.py
deleted file mode 100644
index 8d66dcc..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/hbase_regionserver.py
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/usr/bin/env python
-"""
-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 sys
-from resource_management import *
-
-from hbase import hbase
-from hbase_service import hbase_service
-
-         
-class HbaseRegionServer(Script):
-  def install(self, env):
-    self.install_packages(env)
-    
-  def configure(self, env):
-    import params
-    env.set_params(params)
-
-    hbase(name='regionserver')
-      
-  def start(self, env):
-    import params
-    env.set_params(params)
-    self.configure(env) # for security
-
-    hbase_service( 'regionserver',
-      action = 'start'
-    )
-    
-  def stop(self, env):
-    import params
-    env.set_params(params)
-
-    hbase_service( 'regionserver',
-      action = 'stop'
-    )
-
-  def status(self, env):
-    import status_params
-    env.set_params(status_params)
-    pid_file = format("{pid_dir}/hbase-{hbase_user}-regionserver.pid")
-    check_process_status(pid_file)
-    
-  def decommission(self, env):
-    print "Decommission not yet implemented!"
-    
-
-if __name__ == "__main__":
-  HbaseRegionServer().execute()

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/hbase_service.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/hbase_service.py b/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/hbase_service.py
deleted file mode 100644
index f2d20d6..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/hbase_service.py
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/usr/bin/env python
-"""
-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.
-
-"""
-
-from resource_management import *
-
-def hbase_service(
-  name,
-  action = 'start'): # 'start' or 'stop' or 'status'
-    
-    import params
-  
-    role = name
-    cmd = format("{daemon_script} --config {hbase_conf_dir}")
-    pid_file = format("{pid_dir}/hbase-{hbase_user}-{role}.pid")
-    no_op_test = format("ls {pid_file} >/dev/null 2>&1 && ps `cat {pid_file}` >/dev/null 2>&1")
-    
-    if action == 'start':
-      daemon_cmd = format("{cmd} start {role}")
-      
-      Execute ( daemon_cmd,
-        not_if = no_op_test,
-        user = params.hbase_user
-      )
-    elif action == 'stop':
-      daemon_cmd = format("{cmd} stop {role}")
-
-      Execute ( daemon_cmd,
-        user = params.hbase_user,
-        # BUGFIX: hbase regionserver sometimes hangs when nn is in safemode
-        timeout = 30,
-        on_timeout = format("{no_op_test} && kill -9 `cat {pid_file}`")
-      )
-      
-      Execute (format("rm -f {pid_file}"))

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/metric_collector.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/metric_collector.py b/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/metric_collector.py
deleted file mode 100644
index ae71aa1..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/metric_collector.py
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/usr/bin/env python
-"""
-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.
-
-"""
-
-from resource_management import *
-from ams import ams
-from ams_service import ams_service
-from hbase import hbase
-
-class AmsCollector(Script):
-    def install(self, env):
-        self.install_packages(env)
-
-
-    def configure(self, env):
-        import params
-        env.set_params(params)
-        hbase('master')
-        hbase('regionserver')
-        ams(name='collector')
-
-    def start(self, env):
-        import params
-        env.set_params(params)
-        self.configure(env) # for security
-
-        ams_service( 'collector',
-                       action = 'start'
-        )
-
-    def stop(self, env):
-        import params
-        env.set_params(params)
-
-        ams_service( 'collector',
-                       action = 'stop'
-        )
-
-    def status(self, env):
-        import status_params
-        env.set_params(status_params)
-        pid_file = format("{ams_collector_pid_dir}/ambari-metrics-collector.pid")
-        check_process_status(pid_file)
-
-
-if __name__ == "__main__":
-    AmsCollector().execute()

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/metric_monitor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/metric_monitor.py b/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/metric_monitor.py
deleted file mode 100644
index 23bdf39..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/metric_monitor.py
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/usr/bin/env python
-"""
-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.
-
-"""
-
-from resource_management import *
-from ams import ams
-from ams_service import ams_service
-from hbase import hbase
-
-class AmsMonitor(Script):
-  def install(self, env):
-    self.install_packages(env)
-
-  def configure(self, env):
-    import params
-    env.set_params(params)
-    ams(name='monitor')
-
-  def start(self, env):
-    import params
-    env.set_params(params)
-    self.configure(env) # for security
-
-    ams_service( 'monitor',
-                 action = 'start'
-    )
-
-  def stop(self, env):
-    import params
-    env.set_params(params)
-
-    ams_service( 'monitor',
-                 action = 'stop'
-    )
-
-  def status(self, env):
-    import status_params
-    env.set_params(status_params)
-    pid_file = format("{ams_monitor_pid_dir}/ambari-metrics-monitor.pid")
-    check_process_status(pid_file)
-
-
-if __name__ == "__main__":
-  AmsMonitor().execute()
-

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/params.py b/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/params.py
deleted file mode 100644
index 278bb90..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/params.py
+++ /dev/null
@@ -1,174 +0,0 @@
-#!/usr/bin/env python
-"""
-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.
-
-"""
-
-from functions import calc_xmn_from_xms
-from resource_management import *
-import status_params
-
-# server configurations
-config = Script.get_config()
-exec_tmp_dir = Script.get_tmp_dir()
-
-#AMS data
-ams_user=status_params.ams_user
-ams_pid_dir="/var/run/ambari-metrics"
-
-ams_collector_script = "/usr/sbin/ambari-metrics-collector"
-ams_collector_conf_dir = "/etc/ambari-metrics-collector/conf"
-ams_collector_pid_dir = status_params.ams_collector_pid_dir
-ams_collector_hosts = default("/clusterHostInfo/metric_collector_hosts", [])
-ams_collector_host_single = ams_collector_hosts[0] #TODO cardinality is 1+ so we can have more than one host
-ams_collector_port = 8188
-
-
-ams_monitor_conf_dir = "/etc/ambari-metrics-monitor/conf/"
-ams_monitor_dir = "/usr/lib/python2.6/site-packages/resource_monitoring"
-ams_monitor_pid_dir = status_params.ams_monitor_pid_dir
-ams_monitor_script = "/usr/sbin/ambari-metrics-monitor"
-
-#RPM versioning support
-rpm_version = default("/configurations/hadoop-env/rpm_version", None)
-
-#hadoop params
-if rpm_version is not None:
-#RPM versioning support
-  rpm_version = default("/configurations/hadoop-env/rpm_version", None)
-
-#hadoop params
-if rpm_version is not None:
-  hadoop_native_lib = format("/usr/hdp/current/hadoop-client/lib/native/")
-  hadoop_bin_dir = format("/usr/hdp/current/hadoop/bin")
-  daemon_script = format('/usr/hdp/current/hbase/bin/hbase-daemon.sh')
-  region_mover = format('/usr/hdp/current/hbase/bin/region_mover.rb')
-  region_drainer = format('/usr/hdp/current/hbase/bin/draining_servers.rb')
-  hbase_cmd = format('/usr/hdp/current/hbase/bin/hbase')
-else:
-  hadoop_native_lib = format("/usr/lib/hadoop/lib/native")
-  hadoop_bin_dir = "/usr/bin"
-  daemon_script = "/usr/lib/hbase/bin/hbase-daemon.sh"
-  region_mover = "/usr/lib/hbase/bin/region_mover.rb"
-  region_drainer = "/usr/lib/hbase/bin/draining_servers.rb"
-  hbase_cmd = "/usr/lib/hbase/bin/hbase"
-
-hadoop_conf_dir = "/etc/hadoop/conf"
-#hbase_conf_dir = "/etc/ams-hbase/conf"
-hbase_conf_dir = "/etc/ams-hbase/conf"
-hbase_excluded_hosts = config['commandParams']['excluded_hosts']
-hbase_drain_only = config['commandParams']['mark_draining_only']
-hbase_included_hosts = config['commandParams']['included_hosts']
-
-hbase_user = status_params.hbase_user
-smokeuser = config['configurations']['cluster-env']['smokeuser']
-_authentication = config['configurations']['core-site']['hadoop.security.authentication']
-security_enabled = config['configurations']['cluster-env']['security_enabled']
-
-# this is "hadoop-metrics.properties" for 1.x stacks
-metric_prop_file_name = "hadoop-metrics2-hbase.properties"
-
-# not supporting 32 bit jdk.
-java64_home = config['hostLevelParams']['java_home']
-
-hbase_log_dir = config['configurations']['ams-hbase-env']['hbase_log_dir']
-master_heapsize = config['configurations']['ams-hbase-env']['hbase_master_heapsize']
-
-regionserver_heapsize = config['configurations']['ams-hbase-env']['hbase_regionserver_heapsize']
-regionserver_xmn_max = config['configurations']['ams-hbase-env']['hbase_regionserver_xmn_max']
-regionserver_xmn_percent = config['configurations']['ams-hbase-env']['hbase_regionserver_xmn_ratio']
-regionserver_xmn_size = calc_xmn_from_xms(regionserver_heapsize, regionserver_xmn_percent, regionserver_xmn_max)
-
-hbase_pid_dir = status_params.hbase_pid_dir
-hbase_tmp_dir = config['configurations']['ams-hbase-site']['hbase.tmp.dir']
-# TODO UPGRADE default, update site during upgrade
-_local_dir_conf = default('/configurations/ams-hbase-site/hbase.local.dir', "${hbase.tmp.dir}/local")
-local_dir = substitute_vars(_local_dir_conf, config['configurations']['ams-hbase-site'])
-
-client_jaas_config_file = format("{hbase_conf_dir}/hbase_client_jaas.conf")
-master_jaas_config_file = format("{hbase_conf_dir}/hbase_master_jaas.conf")
-regionserver_jaas_config_file = format("{hbase_conf_dir}/hbase_regionserver_jaas.conf")
-
-# ganglia_server_hosts = default('/clusterHostInfo/ganglia_server_host', []) # is not passed when ganglia is not present
-# ganglia_server_host = '' if len(ganglia_server_hosts) == 0 else ganglia_server_hosts[0]
-
-# if hbase is selected the hbase_rs_hosts, should not be empty, but still default just in case
-# if 'slave_hosts' in config['clusterHostInfo']:
-#   rs_hosts = default('/clusterHostInfo/hbase_rs_hosts', '/clusterHostInfo/slave_hosts') #if hbase_rs_hosts not given it is assumed that region servers on same nodes as slaves
-# else:
-#   rs_hosts = default('/clusterHostInfo/hbase_rs_hosts', '/clusterHostInfo/all_hosts')
-
-rs_hosts = ["localhost"]
-
-smoke_test_user = config['configurations']['cluster-env']['smokeuser']
-smokeuser_permissions = "RWXCA"
-service_check_data = functions.get_unique_id_and_date()
-user_group = config['configurations']['cluster-env']["user_group"]
-
-if security_enabled:
-  _hostname_lowercase = config['hostname'].lower()
-  master_jaas_princ = config['configurations']['ams-hbase-site']['hbase.master.kerberos.principal'].replace('_HOST',_hostname_lowercase)
-  regionserver_jaas_princ = config['configurations']['ams-hbase-site']['hbase.regionserver.kerberos.principal'].replace('_HOST',_hostname_lowercase)
-
-master_keytab_path = config['configurations']['ams-hbase-site']['hbase.master.keytab.file']
-regionserver_keytab_path = config['configurations']['ams-hbase-site']['hbase.regionserver.keytab.file']
-smoke_user_keytab = config['configurations']['cluster-env']['smokeuser_keytab']
-hbase_user_keytab = config['configurations']['ams-hbase-env']['hbase_user_keytab']
-kinit_path_local = functions.get_kinit_path(["/usr/bin", "/usr/kerberos/bin", "/usr/sbin"])
-
-# if security_enabled:
-#   kinit_cmd = format("{kinit_path_local} -kt {hbase_user_keytab} {hbase_user};")
-# else:
-#   kinit_cmd = ""
-
-#log4j.properties
-if (('ams-hbase-log4j' in config['configurations']) and ('content' in config['configurations']['ams-hbase-log4j'])):
-  hbase_log4j_props = config['configurations']['ams-hbase-log4j']['content']
-else:
-  hbase_log4j_props = None
-
-if (('ams-log4j' in config['configurations']) and ('content' in config['configurations']['ams-log4j'])):
-  log4j_props = config['configurations']['ams-log4j']['content']
-else:
-  log4j_props = None
-
-hbase_env_sh_template = config['configurations']['ams-hbase-env']['content']
-ams_env_sh_template = config['configurations']['ams-env']['content']
-
-hbase_hdfs_root_dir = config['configurations']['ams-hbase-site']['hbase.rootdir']
-hbase_staging_dir = "/apps/hbase/staging"
-#for create_hdfs_directory
-hostname = config["hostname"]
-hdfs_user_keytab = config['configurations']['hadoop-env']['hdfs_user_keytab']
-hdfs_user = config['configurations']['hadoop-env']['hdfs_user']
-hdfs_principal_name = config['configurations']['hadoop-env']['hdfs_principal_name']
-kinit_path_local = functions.get_kinit_path(["/usr/bin", "/usr/kerberos/bin", "/usr/sbin"])
-import functools
-#create partial functions with common arguments for every HdfsDirectory call
-#to create hdfs directory we need to call params.HdfsDirectory in code
-# HdfsDirectory = functools.partial(
-#   HdfsDirectory,
-#   conf_dir=hadoop_conf_dir,
-#   hdfs_user=hdfs_user,
-#   security_enabled = security_enabled,
-#   keytab = hdfs_user_keytab,
-#   kinit_path_local = kinit_path_local,
-#   bin_dir = hadoop_bin_dir
-# )
-
-
-

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/service_check.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/service_check.py b/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/service_check.py
deleted file mode 100644
index 5561e10..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/service_check.py
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/usr/bin/env python
-"""
-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.
-
-"""

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/status_params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/status_params.py b/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/status_params.py
deleted file mode 100644
index 0e949eb..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/scripts/status_params.py
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/usr/bin/env python
-"""
-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.
-
-"""
-
-from resource_management import *
-
-config = Script.get_config()
-
-hbase_pid_dir = config['configurations']['ams-hbase-env']['hbase_pid_dir']
-hbase_user = config['configurations']['ams-hbase-env']['hbase_user']
-ams_user = config['configurations']['ams-env']['ams_user']
-
-ams_monitor_pid_dir = "/var/run/ambari-metrics-monitor"
-ams_collector_pid_dir = "/var/run/ambari-metrics-collector"

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/templates/hadoop-metrics2-hbase.properties.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/templates/hadoop-metrics2-hbase.properties.j2 b/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/templates/hadoop-metrics2-hbase.properties.j2
deleted file mode 100644
index 3e980f7..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/templates/hadoop-metrics2-hbase.properties.j2
+++ /dev/null
@@ -1,56 +0,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.
-#}
-
-# 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.
-
-# syntax: [prefix].[source|sink|jmx].[instance].[options]
-# See package.html for org.apache.hadoop.metrics2 for details
-
-# HBase-specific configuration to reset long-running stats (e.g. compactions)
-# If this variable is left out, then the default is no expiration.
-hbase.extendedperiod = 3600
-
-hbase.class=org.apache.hadoop.metrics2.sink.timeline.HadoopTimelineMetricsSink
-hbase.period=10
-hbase.collector={{ams_collector_host_single}}:8188
-
-jvm.class=org.apache.hadoop.metrics2.sink.timeline.HadoopTimelineMetricsSink
-jvm.period=10
-jvm.collector={{ams_collector_host_single}}:8188
-
-rpc.class=org.apache.hadoop.metrics2.sink.timeline.HadoopTimelineMetricsSink
-rpc.period=10
-rpc.collector={{ams_collector_host_single}}:8188
-
-hbase.sink.timeline.class=org.apache.hadoop.metrics2.sink.timeline.HadoopTimelineMetricsSink
-hbase.sink.timeline.period=10
-hbase.sink.timeline.collector={{ams_collector_host_single}}:8188
-hbase.sink.timeline.serviceName-prefix=ams

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/templates/hbase_client_jaas.conf.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/templates/hbase_client_jaas.conf.j2 b/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/templates/hbase_client_jaas.conf.j2
deleted file mode 100644
index 38f9721..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/package/templates/hbase_client_jaas.conf.j2
+++ /dev/null
@@ -1,23 +0,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.
-#}
-
-Client {
-com.sun.security.auth.module.Krb5LoginModule required
-useKeyTab=false
-useTicketCache=true;
-};


[5/6] ambari git commit: AMBARI-8782: Common Services: Refactor HDP-2.2 AMS, KAFKA, KNOX, SLIDER services (Jayush Luniya)

Posted by jl...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/metric_monitor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/metric_monitor.py b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/metric_monitor.py
new file mode 100644
index 0000000..23bdf39
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/metric_monitor.py
@@ -0,0 +1,61 @@
+#!/usr/bin/env python
+"""
+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.
+
+"""
+
+from resource_management import *
+from ams import ams
+from ams_service import ams_service
+from hbase import hbase
+
+class AmsMonitor(Script):
+  def install(self, env):
+    self.install_packages(env)
+
+  def configure(self, env):
+    import params
+    env.set_params(params)
+    ams(name='monitor')
+
+  def start(self, env):
+    import params
+    env.set_params(params)
+    self.configure(env) # for security
+
+    ams_service( 'monitor',
+                 action = 'start'
+    )
+
+  def stop(self, env):
+    import params
+    env.set_params(params)
+
+    ams_service( 'monitor',
+                 action = 'stop'
+    )
+
+  def status(self, env):
+    import status_params
+    env.set_params(status_params)
+    pid_file = format("{ams_monitor_pid_dir}/ambari-metrics-monitor.pid")
+    check_process_status(pid_file)
+
+
+if __name__ == "__main__":
+  AmsMonitor().execute()
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/params.py b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/params.py
new file mode 100644
index 0000000..278bb90
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/params.py
@@ -0,0 +1,174 @@
+#!/usr/bin/env python
+"""
+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.
+
+"""
+
+from functions import calc_xmn_from_xms
+from resource_management import *
+import status_params
+
+# server configurations
+config = Script.get_config()
+exec_tmp_dir = Script.get_tmp_dir()
+
+#AMS data
+ams_user=status_params.ams_user
+ams_pid_dir="/var/run/ambari-metrics"
+
+ams_collector_script = "/usr/sbin/ambari-metrics-collector"
+ams_collector_conf_dir = "/etc/ambari-metrics-collector/conf"
+ams_collector_pid_dir = status_params.ams_collector_pid_dir
+ams_collector_hosts = default("/clusterHostInfo/metric_collector_hosts", [])
+ams_collector_host_single = ams_collector_hosts[0] #TODO cardinality is 1+ so we can have more than one host
+ams_collector_port = 8188
+
+
+ams_monitor_conf_dir = "/etc/ambari-metrics-monitor/conf/"
+ams_monitor_dir = "/usr/lib/python2.6/site-packages/resource_monitoring"
+ams_monitor_pid_dir = status_params.ams_monitor_pid_dir
+ams_monitor_script = "/usr/sbin/ambari-metrics-monitor"
+
+#RPM versioning support
+rpm_version = default("/configurations/hadoop-env/rpm_version", None)
+
+#hadoop params
+if rpm_version is not None:
+#RPM versioning support
+  rpm_version = default("/configurations/hadoop-env/rpm_version", None)
+
+#hadoop params
+if rpm_version is not None:
+  hadoop_native_lib = format("/usr/hdp/current/hadoop-client/lib/native/")
+  hadoop_bin_dir = format("/usr/hdp/current/hadoop/bin")
+  daemon_script = format('/usr/hdp/current/hbase/bin/hbase-daemon.sh')
+  region_mover = format('/usr/hdp/current/hbase/bin/region_mover.rb')
+  region_drainer = format('/usr/hdp/current/hbase/bin/draining_servers.rb')
+  hbase_cmd = format('/usr/hdp/current/hbase/bin/hbase')
+else:
+  hadoop_native_lib = format("/usr/lib/hadoop/lib/native")
+  hadoop_bin_dir = "/usr/bin"
+  daemon_script = "/usr/lib/hbase/bin/hbase-daemon.sh"
+  region_mover = "/usr/lib/hbase/bin/region_mover.rb"
+  region_drainer = "/usr/lib/hbase/bin/draining_servers.rb"
+  hbase_cmd = "/usr/lib/hbase/bin/hbase"
+
+hadoop_conf_dir = "/etc/hadoop/conf"
+#hbase_conf_dir = "/etc/ams-hbase/conf"
+hbase_conf_dir = "/etc/ams-hbase/conf"
+hbase_excluded_hosts = config['commandParams']['excluded_hosts']
+hbase_drain_only = config['commandParams']['mark_draining_only']
+hbase_included_hosts = config['commandParams']['included_hosts']
+
+hbase_user = status_params.hbase_user
+smokeuser = config['configurations']['cluster-env']['smokeuser']
+_authentication = config['configurations']['core-site']['hadoop.security.authentication']
+security_enabled = config['configurations']['cluster-env']['security_enabled']
+
+# this is "hadoop-metrics.properties" for 1.x stacks
+metric_prop_file_name = "hadoop-metrics2-hbase.properties"
+
+# not supporting 32 bit jdk.
+java64_home = config['hostLevelParams']['java_home']
+
+hbase_log_dir = config['configurations']['ams-hbase-env']['hbase_log_dir']
+master_heapsize = config['configurations']['ams-hbase-env']['hbase_master_heapsize']
+
+regionserver_heapsize = config['configurations']['ams-hbase-env']['hbase_regionserver_heapsize']
+regionserver_xmn_max = config['configurations']['ams-hbase-env']['hbase_regionserver_xmn_max']
+regionserver_xmn_percent = config['configurations']['ams-hbase-env']['hbase_regionserver_xmn_ratio']
+regionserver_xmn_size = calc_xmn_from_xms(regionserver_heapsize, regionserver_xmn_percent, regionserver_xmn_max)
+
+hbase_pid_dir = status_params.hbase_pid_dir
+hbase_tmp_dir = config['configurations']['ams-hbase-site']['hbase.tmp.dir']
+# TODO UPGRADE default, update site during upgrade
+_local_dir_conf = default('/configurations/ams-hbase-site/hbase.local.dir', "${hbase.tmp.dir}/local")
+local_dir = substitute_vars(_local_dir_conf, config['configurations']['ams-hbase-site'])
+
+client_jaas_config_file = format("{hbase_conf_dir}/hbase_client_jaas.conf")
+master_jaas_config_file = format("{hbase_conf_dir}/hbase_master_jaas.conf")
+regionserver_jaas_config_file = format("{hbase_conf_dir}/hbase_regionserver_jaas.conf")
+
+# ganglia_server_hosts = default('/clusterHostInfo/ganglia_server_host', []) # is not passed when ganglia is not present
+# ganglia_server_host = '' if len(ganglia_server_hosts) == 0 else ganglia_server_hosts[0]
+
+# if hbase is selected the hbase_rs_hosts, should not be empty, but still default just in case
+# if 'slave_hosts' in config['clusterHostInfo']:
+#   rs_hosts = default('/clusterHostInfo/hbase_rs_hosts', '/clusterHostInfo/slave_hosts') #if hbase_rs_hosts not given it is assumed that region servers on same nodes as slaves
+# else:
+#   rs_hosts = default('/clusterHostInfo/hbase_rs_hosts', '/clusterHostInfo/all_hosts')
+
+rs_hosts = ["localhost"]
+
+smoke_test_user = config['configurations']['cluster-env']['smokeuser']
+smokeuser_permissions = "RWXCA"
+service_check_data = functions.get_unique_id_and_date()
+user_group = config['configurations']['cluster-env']["user_group"]
+
+if security_enabled:
+  _hostname_lowercase = config['hostname'].lower()
+  master_jaas_princ = config['configurations']['ams-hbase-site']['hbase.master.kerberos.principal'].replace('_HOST',_hostname_lowercase)
+  regionserver_jaas_princ = config['configurations']['ams-hbase-site']['hbase.regionserver.kerberos.principal'].replace('_HOST',_hostname_lowercase)
+
+master_keytab_path = config['configurations']['ams-hbase-site']['hbase.master.keytab.file']
+regionserver_keytab_path = config['configurations']['ams-hbase-site']['hbase.regionserver.keytab.file']
+smoke_user_keytab = config['configurations']['cluster-env']['smokeuser_keytab']
+hbase_user_keytab = config['configurations']['ams-hbase-env']['hbase_user_keytab']
+kinit_path_local = functions.get_kinit_path(["/usr/bin", "/usr/kerberos/bin", "/usr/sbin"])
+
+# if security_enabled:
+#   kinit_cmd = format("{kinit_path_local} -kt {hbase_user_keytab} {hbase_user};")
+# else:
+#   kinit_cmd = ""
+
+#log4j.properties
+if (('ams-hbase-log4j' in config['configurations']) and ('content' in config['configurations']['ams-hbase-log4j'])):
+  hbase_log4j_props = config['configurations']['ams-hbase-log4j']['content']
+else:
+  hbase_log4j_props = None
+
+if (('ams-log4j' in config['configurations']) and ('content' in config['configurations']['ams-log4j'])):
+  log4j_props = config['configurations']['ams-log4j']['content']
+else:
+  log4j_props = None
+
+hbase_env_sh_template = config['configurations']['ams-hbase-env']['content']
+ams_env_sh_template = config['configurations']['ams-env']['content']
+
+hbase_hdfs_root_dir = config['configurations']['ams-hbase-site']['hbase.rootdir']
+hbase_staging_dir = "/apps/hbase/staging"
+#for create_hdfs_directory
+hostname = config["hostname"]
+hdfs_user_keytab = config['configurations']['hadoop-env']['hdfs_user_keytab']
+hdfs_user = config['configurations']['hadoop-env']['hdfs_user']
+hdfs_principal_name = config['configurations']['hadoop-env']['hdfs_principal_name']
+kinit_path_local = functions.get_kinit_path(["/usr/bin", "/usr/kerberos/bin", "/usr/sbin"])
+import functools
+#create partial functions with common arguments for every HdfsDirectory call
+#to create hdfs directory we need to call params.HdfsDirectory in code
+# HdfsDirectory = functools.partial(
+#   HdfsDirectory,
+#   conf_dir=hadoop_conf_dir,
+#   hdfs_user=hdfs_user,
+#   security_enabled = security_enabled,
+#   keytab = hdfs_user_keytab,
+#   kinit_path_local = kinit_path_local,
+#   bin_dir = hadoop_bin_dir
+# )
+
+
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/service_check.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/service_check.py b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/service_check.py
new file mode 100644
index 0000000..5561e10
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/service_check.py
@@ -0,0 +1,19 @@
+#!/usr/bin/env python
+"""
+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.
+
+"""

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/status_params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/status_params.py b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/status_params.py
new file mode 100644
index 0000000..0e949eb
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/status_params.py
@@ -0,0 +1,30 @@
+#!/usr/bin/env python
+"""
+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.
+
+"""
+
+from resource_management import *
+
+config = Script.get_config()
+
+hbase_pid_dir = config['configurations']['ams-hbase-env']['hbase_pid_dir']
+hbase_user = config['configurations']['ams-hbase-env']['hbase_user']
+ams_user = config['configurations']['ams-env']['ams_user']
+
+ams_monitor_pid_dir = "/var/run/ambari-metrics-monitor"
+ams_collector_pid_dir = "/var/run/ambari-metrics-collector"

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/templates/hadoop-metrics2-hbase.properties.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/templates/hadoop-metrics2-hbase.properties.j2 b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/templates/hadoop-metrics2-hbase.properties.j2
new file mode 100644
index 0000000..3e980f7
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/templates/hadoop-metrics2-hbase.properties.j2
@@ -0,0 +1,56 @@
+{#
+# 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.
+#}
+
+# 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.
+
+# syntax: [prefix].[source|sink|jmx].[instance].[options]
+# See package.html for org.apache.hadoop.metrics2 for details
+
+# HBase-specific configuration to reset long-running stats (e.g. compactions)
+# If this variable is left out, then the default is no expiration.
+hbase.extendedperiod = 3600
+
+hbase.class=org.apache.hadoop.metrics2.sink.timeline.HadoopTimelineMetricsSink
+hbase.period=10
+hbase.collector={{ams_collector_host_single}}:8188
+
+jvm.class=org.apache.hadoop.metrics2.sink.timeline.HadoopTimelineMetricsSink
+jvm.period=10
+jvm.collector={{ams_collector_host_single}}:8188
+
+rpc.class=org.apache.hadoop.metrics2.sink.timeline.HadoopTimelineMetricsSink
+rpc.period=10
+rpc.collector={{ams_collector_host_single}}:8188
+
+hbase.sink.timeline.class=org.apache.hadoop.metrics2.sink.timeline.HadoopTimelineMetricsSink
+hbase.sink.timeline.period=10
+hbase.sink.timeline.collector={{ams_collector_host_single}}:8188
+hbase.sink.timeline.serviceName-prefix=ams

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/templates/hbase_client_jaas.conf.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/templates/hbase_client_jaas.conf.j2 b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/templates/hbase_client_jaas.conf.j2
new file mode 100644
index 0000000..38f9721
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/templates/hbase_client_jaas.conf.j2
@@ -0,0 +1,23 @@
+{#
+# 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.
+#}
+
+Client {
+com.sun.security.auth.module.Krb5LoginModule required
+useKeyTab=false
+useTicketCache=true;
+};

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/templates/hbase_grant_permissions.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/templates/hbase_grant_permissions.j2 b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/templates/hbase_grant_permissions.j2
new file mode 100644
index 0000000..3378983
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/templates/hbase_grant_permissions.j2
@@ -0,0 +1,39 @@
+{#
+# 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.
+#}
+
+#
+# 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.
+#
+#
+grant '{{smoke_test_user}}', '{{smokeuser_permissions}}'
+exit
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/templates/hbase_master_jaas.conf.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/templates/hbase_master_jaas.conf.j2 b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/templates/hbase_master_jaas.conf.j2
new file mode 100644
index 0000000..a93c36c
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/templates/hbase_master_jaas.conf.j2
@@ -0,0 +1,26 @@
+{#
+# 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.
+#}
+
+Client {
+com.sun.security.auth.module.Krb5LoginModule required
+useKeyTab=true
+storeKey=true
+useTicketCache=false
+keyTab="{{master_keytab_path}}"
+principal="{{master_jaas_princ}}";
+};

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/templates/hbase_regionserver_jaas.conf.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/templates/hbase_regionserver_jaas.conf.j2 b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/templates/hbase_regionserver_jaas.conf.j2
new file mode 100644
index 0000000..7097481
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/templates/hbase_regionserver_jaas.conf.j2
@@ -0,0 +1,26 @@
+{#
+# 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.
+#}
+
+Client {
+com.sun.security.auth.module.Krb5LoginModule required
+useKeyTab=true
+storeKey=true
+useTicketCache=false
+keyTab="{{regionserver_keytab_path}}"
+principal="{{regionserver_jaas_princ}}";
+};

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/templates/metric_groups.conf.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/templates/metric_groups.conf.j2 b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/templates/metric_groups.conf.j2
new file mode 100644
index 0000000..aa03d19
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/templates/metric_groups.conf.j2
@@ -0,0 +1,37 @@
+{#
+# 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.
+#}
+
+{
+   "host_metric_groups": {
+      "all": {
+         "collect_every": "10",
+         "metrics": [
+            {
+               "name": "bytes_out",
+               "value_threshold": "128"
+            }
+         ]
+      }
+   },
+   "process_metric_groups": {
+      "": {
+         "collect_every": "15",
+         "metrics": []
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/templates/metric_monitor.ini.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/templates/metric_monitor.ini.j2 b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/templates/metric_monitor.ini.j2
new file mode 100644
index 0000000..5e672fc
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/templates/metric_monitor.ini.j2
@@ -0,0 +1,30 @@
+{#
+# 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.
+#}
+
+[default]
+debug_level = INFO
+metrics_server = {{ams_collector_host_single}}:{{ams_collector_port}}
+enable_time_threshold = false
+enable_value_threshold = false
+
+[emitter]
+send_interval = 60
+
+[collector]
+collector_sleep_interval = 5
+max_queue_size = 5000

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/templates/regionservers.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/templates/regionservers.j2 b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/templates/regionservers.j2
new file mode 100644
index 0000000..fc6cc37
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/templates/regionservers.j2
@@ -0,0 +1,20 @@
+{#
+# 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.
+#}
+
+{% for host in rs_hosts %}{{host}}
+{% endfor %}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/alerts.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/alerts.json b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/alerts.json
new file mode 100644
index 0000000..4c9884c
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/alerts.json
@@ -0,0 +1,32 @@
+{
+  "KAFKA": {
+    "service": [],
+    "KAFKA_BROKER": [
+      {
+        "name": "kafka_broker_process",
+        "label": "Kafka Broker Process",
+        "description": "This host-level alert is triggered if the Kafka Broker cannot be determined to be up.",
+        "interval": 1,
+        "scope": "HOST",
+        "source": {
+          "type": "PORT",
+          "uri": "{{kafka-broker/port}}",
+          "default_port": 6667,
+          "reporting": {
+            "ok": {
+              "text": "TCP OK - {0:.3f}s response on port {1}"
+            },
+            "warning": {
+              "text": "TCP OK - {0:.3f}s response on port {1}",
+              "value": 1.5
+            },
+            "critical": {
+              "text": "Connection failed: {0} to {1}:{2}",
+              "value": 5.0
+            }
+          }
+        }
+      }
+    ]
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/configuration/kafka-broker.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/configuration/kafka-broker.xml b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/configuration/kafka-broker.xml
new file mode 100644
index 0000000..dc1b6b4
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/configuration/kafka-broker.xml
@@ -0,0 +1,321 @@
+<?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>log.dirs</name>
+    <value>/kafka-logs</value>
+    <description>
+      A comma-separated list of one or more directories in which Kafka data is stored.
+      Each new partition that is created will be placed in the directory which currently has the fewest partitions.
+    </description>
+  </property>
+  <property>
+    <name>port</name>
+    <value>6667</value>
+    <description>
+      The port on which the server accepts client connections.
+    </description>
+  </property>
+  <property>
+    <name>zookeeper.connect</name>
+    <value>localhost:2181</value>
+    <description>
+      Zookeeper also allows you to add a "chroot" path which will make all kafka data for this cluster appear under a particular path.
+      This is a way to setup multiple Kafka clusters or other applications on the same zookeeper cluster. To do this give a connection
+      string in the form hostname1:port1,hostname2:port2,hostname3:port3/chroot/path which would put all this cluster's data under the
+      path /chroot/path. Note that you must create this path yourself prior to starting the broker and consumers must use the
+      same connection string.
+    </description>
+  </property>
+  <property>
+    <name>message.max.bytes</name>
+    <value>1000000</value>
+    <description>
+      The maximum size of a message that the server can receive.
+      It is important that this property be in sync with the maximum fetch size your consumers use or
+      else an unruly producer will be able to publish messages too large for consumers to consume.
+    </description>
+  </property>
+  <property>
+    <name>num.network.threads</name>
+    <value>3</value>
+    <description>
+      The number of network threads that the server uses for handling network requests.
+      You probably don't need to change this.
+    </description>
+  </property>
+  <property>
+    <name>num.io.threads</name>
+    <value>8</value>
+    <description>
+      The number of I/O threads that the server uses for executing requests. You should have at least as many threads as you have disks.
+    </description>
+  </property>
+  <property>
+    <name>queued.max.requests</name>
+    <value>500</value>
+    <description>The number of requests that can be queued up for processing by the I/O threads before the network threads stop reading in new requests.</description>
+  </property>
+  <property>
+    <name>socket.send.buffer.bytes</name>
+    <value>102400</value>
+    <description>
+      The SO_SNDBUFF buffer the server prefers for socket connections.
+    </description>
+  </property>
+  <property>
+    <name>socket.receive.buffer.bytes</name>
+    <value>102400</value>
+    <description>
+      The SO_RCVBUFF buffer the server prefers for socket connections.
+    </description>
+  </property>
+  <property>
+    <name>socket.request.max.bytes</name>
+    <value>104857600</value>
+    <description>
+      The maximum request size the server will allow. This prevents the server from running out of memory and should be smaller than the Java heap size.
+    </description>
+  </property>
+  <property>
+    <name>num.partitions</name>
+    <value>1</value>
+    <description>
+       	The default number of partitions per topic.
+    </description>
+  </property>
+  <property>
+    <name>log.segment.bytes</name>
+    <value>1073741824</value>
+    <description>
+      The maximum request size the server will allow.
+      This prevents the server from running out of memory and should be smaller than the Java heap size.
+    </description>
+  </property>
+  <property>
+    <name>log.roll.hours</name>
+    <value>168</value>
+    <description>
+      This setting will force Kafka to roll a new log segment even if the log.segment.bytes size has not been reached.
+    </description>
+  </property>
+  <property>
+    <name>log.retention.bytes</name>
+    <value>-1</value>
+    <description>
+      The amount of data to retain in the log for each topic-partitions. Note that this is the limit per-partition so multiply by the number of partitions to get the total data retained for the topic. Also note that if both log.retention.hours and log.retention.bytes are both set we delete a segment when either limit is exceeded.
+    </description>
+  </property>
+  <property>
+    <name>log.retention.hours</name>
+    <value>168</value>
+    <description>
+      The number of hours to keep a log segment before it is deleted, i.e. the default data retention window for all topics. Note that if both log.retention.hours and log.retention.bytes are both set we delete a segment when either limit is exceeded.
+    </description>
+  </property>
+  <property>
+    <name>log.cleanup.interval.mins</name>
+    <value>10</value>
+    <description>The frequency in minutes that the log cleaner checks whether any log segment is eligible for deletion to meet the retention policies.
+    </description>
+  </property>
+  <property>
+    <name>log.index.size.max.bytes</name>
+    <value>10485760</value>
+    <description>
+      The maximum size in bytes we allow for the offset index for each log segment. Note that we will always pre-allocate a
+      sparse file with this much space and shrink it down when the log rolls. If the index fills up we will roll a new log segment
+      even if we haven't reached the log.segment.bytes limit.
+    </description>
+  </property>
+  <property>
+    <name>log.index.interval.bytes</name>
+    <value>4096</value>
+    <description>
+      The byte interval at which we add an entry to the offset index. When executing a fetch request the server must do a linear scan for up to this many bytes to find the correct position in the log to begin and end the fetch. So setting this value to be larger will mean larger index files (and a bit more memory usage) but less scanning. However the server will never add more than one index entry per log append (even if more than log.index.interval worth of messages are appended). In general you probably don't need to mess with this value.
+    </description>
+  </property>
+  <property>
+    <name>log.flush.interval.messages</name>
+    <value>10000</value>
+    <description>The number of messages written to a log partition before we force an fsync on the log. Setting this higher will improve performance a lot but will increase the window of data at risk in the event of a crash (though that is usually best addressed through replication). If both this setting and log.flush.interval.ms are both used the log will be flushed when either criteria is met.
+    </description>
+  </property>
+  <property>
+    <name>log.flush.scheduler.interval.ms</name>
+    <value>3000</value>
+    <description>
+      The frequency in ms that the log flusher checks whether any log is eligible to be flushed to disk.
+    </description>
+  </property>
+  <property>
+    <name>log.flush.interval.ms</name>
+    <value>3000</value>
+    <description>
+      The maximum time between fsync calls on the log. If used in conjuction with log.flush.interval.messages the log will be flushed when either criteria is met.
+    </description>
+  </property>
+  <property>
+    <name>auto.create.topics.enable</name>
+    <value>true</value>
+    <description>
+      Enable auto creation of topic on the server. If this is set to true then attempts to produce, consume, or fetch metadata for a non-existent topic will automatically create it with the default replication factor and number of partitions.
+    </description>
+  </property>
+  <property>
+    <name>controller.socket.timeout.ms</name>
+    <value>30000</value>
+    <property>The socket timeout for commands from the partition management controller to the replicas.</property>
+  </property>
+  <property>
+    <name>controller.message.queue.size</name>
+    <value>10</value>
+    <description>The buffer size for controller-to-broker-channels</description>
+  </property>
+  <property>
+    <name>default.replication.factor</name>
+    <value>1</value>
+    <description>The default replication factor for automatically created topics.</description>
+  </property>
+  <property>
+    <name>replica.lag.time.max.ms</name>
+    <value>10000</value>
+    <description>If a follower hasn't sent any fetch requests for this window of time, the leader will remove the follower from ISR (in-sync replicas) and treat it as dead.</description>
+  </property>
+  <property>
+    <name>replica.lag.max.messages</name>
+    <value>4000</value>
+    <description>
+      If a replica falls more than this many messages behind the leader, the leader will remove the follower from ISR and treat it as dead.
+    </description>
+  </property>
+  <property>
+    <name>replica.socket.timeout.ms</name>
+    <value>30000</value>
+    <description>The socket timeout for network requests to the leader for replicating data.</description>
+  </property>
+  <property>
+    <name>replica.socket.receive.buffer.bytes</name>
+    <value>65536</value>
+    <description>The socket receive buffer for network requests to the leader for replicating data.</description>
+  </property>
+  <property>
+    <name>replica.fetch.max.bytes</name>
+    <value>1048576</value>
+    <description>The number of byes of messages to attempt to fetch for each partition in the fetch requests the replicas send to the leader.</description>
+  </property>
+  <property>
+    <name>replica.fetch.wait.max.ms</name>
+    <value>500</value>
+    <description>The maximum amount of time to wait time for data to arrive on the leader in the fetch requests sent by the replicas to the leader.</description>
+  </property>
+  <property>
+    <name>replica.fetch.min.bytes</name>
+    <value>1</value>
+    <description>Minimum bytes expected for each fetch response for the fetch requests from the replica to the leader. If not enough bytes, wait up to replica.fetch.wait.max.ms for this many bytes to arrive.
+    </description>
+  </property>
+  <property>
+    <name>num.replica.fetchers</name>
+    <value>1</value>
+    <description>
+      Number of threads used to replicate messages from leaders. Increasing this value can increase the degree of I/O parallelism in the follower broker.
+    </description>
+  </property>
+  <property>
+    <name>replica.high.watermark.checkpoint.interval.ms</name>
+    <value>5000</value>
+    <description>The frequency with which each replica saves its high watermark to disk to handle recovery.</description>
+  </property>
+  <property>
+    <name>fetch.purgatory.purge.interval.requests</name>
+    <value>10000</value>
+    <description>The purge interval (in number of requests) of the fetch request purgatory.</description>
+  </property>
+  <property>
+    <name>producer.purgatory.purge.interval.requests</name>
+    <value>10000</value>
+    <description>The purge interval (in number of requests) of the producer request purgatory.</description>
+  </property>
+  <property>
+    <name>zookeeper.session.timeout.ms</name>
+    <value>6000</value>
+    <description>Zookeeper session timeout. If the server fails to heartbeat to zookeeper within this period of time it is considered dead. If you set this too low the server may be falsely considered dead; if you set it too high it may take too long to recognize a truly dead server.</description>
+  </property>
+  <property>
+    <name>zookeeper.connection.timeout.ms</name>
+    <value>6000</value>
+    <description>The maximum amount of time that the client waits to establish a connection to zookeeper.</description>
+  </property>
+  <property>
+    <name>zookeeper.sync.time.ms</name>
+    <value>2000</value>
+    <description>How far a ZK follower can be behind a ZK leader.</description>
+  </property>
+  <property>
+    <name>controlled.shutdown.enable</name>
+    <value>false</value>
+    <description>Enable controlled shutdown of the broker. If enabled, the broker will move all leaders on it to some other brokers before shutting itself down. This reduces the unavailability window during shutdown.</description>
+  </property>
+  <property>
+    <name>controlled.shutdown.max.retries</name>
+    <value>3</value>
+    <description>Number of retries to complete the controlled shutdown successfully before executing an unclean shutdown.</description>
+  </property>
+  <property>
+    <name>controlled.shutdown.retry.backoff.ms</name>
+    <value>5000</value>
+    <description>
+      Backoff time between shutdown retries.
+    </description>
+  </property>
+  <property>
+    <name>kafka.metrics.reporters</name>
+    <value>kafka.ganglia.KafkaGangliaMetricsReporter</value>
+    <description>
+      kafka ganglia metrics reporter
+    </description>
+  </property>
+  <property>
+    <name>kafka.ganglia.metrics.reporter.enabled</name>
+    <value>true</value>
+    <description>
+      kafka ganglia metrics reporter enable
+    </description>
+  </property>
+  <property>
+    <name>kafka.ganglia.metrics.host</name>
+    <value>localhost</value>
+    <description> Ganglia host </description>
+  </property>
+  <property>
+    <name>kafka.ganglia.metrics.port</name>
+    <value>8671</value>
+    <description> Ganglia port </description>
+  </property>
+  <property>
+    <name>kafka.ganglia.metrics.group</name>
+    <value>kafka</value>
+    <description>Ganglia group name </description>
+  </property>
+</configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/configuration/kafka-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/configuration/kafka-env.xml b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/configuration/kafka-env.xml
new file mode 100644
index 0000000..7ad4396
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/configuration/kafka-env.xml
@@ -0,0 +1,55 @@
+<?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>kafka_user</name>
+    <value>kafka</value>
+    <property-type>USER</property-type>
+    <description></description>
+  </property>
+  <property>
+    <name>kafka_log_dir</name>
+    <value>/var/log/kafka</value>
+    <description></description>
+  </property>
+  <property>
+    <name>kafka_pid_dir</name>
+    <value>/var/run/kafka</value>
+    <description></description>
+  </property>
+
+  <!-- kafka-env.sh -->
+  <property>
+    <name>content</name>
+    <description>This is the jinja template for kafka-env.sh file</description>
+    <value>
+#!/bin/bash
+
+# Set KAFKA specific environment variables here.
+
+# The java implementation to use.
+export JAVA_HOME={{java64_home}}
+export PATH=$PATH:$JAVA_HOME/bin
+    </value>
+  </property>
+</configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/configuration/kafka-log4j.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/configuration/kafka-log4j.xml b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/configuration/kafka-log4j.xml
new file mode 100644
index 0000000..901859e
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/configuration/kafka-log4j.xml
@@ -0,0 +1,116 @@
+<?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 supports_final="false">
+
+  <property>
+    <name>content</name>
+    <description>Custom log4j.properties</description>
+    <value>
+#
+#
+# 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.
+#
+#
+#
+kafka.logs.dir=logs
+
+log4j.rootLogger=INFO, stdout
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=[%d] %p %m (%c)%n
+
+log4j.appender.kafkaAppender=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.kafkaAppender.DatePattern='.'yyyy-MM-dd-HH
+log4j.appender.kafkaAppender.File=${kafka.logs.dir}/server.log
+log4j.appender.kafkaAppender.layout=org.apache.log4j.PatternLayout
+log4j.appender.kafkaAppender.layout.ConversionPattern=[%d] %p %m (%c)%n
+
+log4j.appender.stateChangeAppender=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.stateChangeAppender.DatePattern='.'yyyy-MM-dd-HH
+log4j.appender.stateChangeAppender.File=${kafka.logs.dir}/state-change.log
+log4j.appender.stateChangeAppender.layout=org.apache.log4j.PatternLayout
+log4j.appender.stateChangeAppender.layout.ConversionPattern=[%d] %p %m (%c)%n
+
+log4j.appender.requestAppender=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.requestAppender.DatePattern='.'yyyy-MM-dd-HH
+log4j.appender.requestAppender.File=${kafka.logs.dir}/kafka-request.log
+log4j.appender.requestAppender.layout=org.apache.log4j.PatternLayout
+log4j.appender.requestAppender.layout.ConversionPattern=[%d] %p %m (%c)%n
+
+log4j.appender.cleanerAppender=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.cleanerAppender.DatePattern='.'yyyy-MM-dd-HH
+log4j.appender.cleanerAppender.File=${kafka.logs.dir}/log-cleaner.log
+log4j.appender.cleanerAppender.layout=org.apache.log4j.PatternLayout
+log4j.appender.cleanerAppender.layout.ConversionPattern=[%d] %p %m (%c)%n
+
+log4j.appender.controllerAppender=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.controllerAppender.DatePattern='.'yyyy-MM-dd-HH
+log4j.appender.controllerAppender.File=${kafka.logs.dir}/controller.log
+log4j.appender.controllerAppender.layout=org.apache.log4j.PatternLayout
+log4j.appender.controllerAppender.layout.ConversionPattern=[%d] %p %m (%c)%n
+
+# Turn on all our debugging info
+#log4j.logger.kafka.producer.async.DefaultEventHandler=DEBUG, kafkaAppender
+#log4j.logger.kafka.client.ClientUtils=DEBUG, kafkaAppender
+#log4j.logger.kafka.perf=DEBUG, kafkaAppender
+#log4j.logger.kafka.perf.ProducerPerformance$ProducerThread=DEBUG, kafkaAppender
+#log4j.logger.org.I0Itec.zkclient.ZkClient=DEBUG
+log4j.logger.kafka=INFO, kafkaAppender
+log4j.logger.kafka.network.RequestChannel$=WARN, requestAppender
+log4j.additivity.kafka.network.RequestChannel$=false
+
+#log4j.logger.kafka.network.Processor=TRACE, requestAppender
+#log4j.logger.kafka.server.KafkaApis=TRACE, requestAppender
+#log4j.additivity.kafka.server.KafkaApis=false
+log4j.logger.kafka.request.logger=WARN, requestAppender
+log4j.additivity.kafka.request.logger=false
+
+log4j.logger.kafka.controller=TRACE, controllerAppender
+log4j.additivity.kafka.controller=false
+
+log4j.logger.kafka.log.LogCleaner=INFO, cleanerAppender
+log4j.additivity.kafka.log.LogCleaner=false
+
+log4j.logger.state.change.logger=TRACE, stateChangeAppender
+log4j.additivity.state.change.logger=false
+
+   </value>
+  </property>
+
+</configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/metainfo.xml b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/metainfo.xml
new file mode 100644
index 0000000..8e7aa64
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/metainfo.xml
@@ -0,0 +1,82 @@
+<?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>KAFKA</name>
+      <displayName>Kafka</displayName>
+      <comment>A high-throughput distributed messaging system</comment>
+      <version>0.8.1.2.2</version>
+      <components>
+        <component>
+          <name>KAFKA_BROKER</name>
+          <displayName>Kafka Broker</displayName>
+          <category>MASTER</category>
+          <cardinality>1+</cardinality>
+          <dependencies>
+            <dependency>
+              <name>ZOOKEEPER/ZOOKEEPER_SERVER</name>
+              <scope>cluster</scope>
+              <auto-deploy>
+                <enabled>true</enabled>
+              </auto-deploy>
+            </dependency>
+          </dependencies>
+          <commandScript>
+            <script>scripts/kafka_broker.py</script>
+            <scriptType>PYTHON</scriptType>
+            <timeout>600</timeout>
+          </commandScript>
+        </component>
+      </components>
+      <osSpecifics>
+        <osSpecific>
+          <osFamily>redhat5,redhat6,suse11</osFamily>
+          <packages>
+            <package>
+              <name>kafka_2_2_*</name>
+            </package>
+          </packages>
+        </osSpecific>
+        <osSpecific>
+          <osFamily>ubuntu12</osFamily>
+          <packages>
+            <package>
+              <name>kafka-2-2-.*</name>
+            </package>
+          </packages>
+        </osSpecific>
+      </osSpecifics>
+      <commandScript>
+        <script>scripts/service_check.py</script>
+        <scriptType>PYTHON</scriptType>
+        <timeout>300</timeout>
+      </commandScript>
+      <requiredServices>
+        <service>ZOOKEEPER</service>
+      </requiredServices>
+      <configuration-dependencies>
+        <config-type>kafka-broker</config-type>
+        <config-type>kafka-env</config-type>
+        <config-type>kafka-log4j</config-type>
+      </configuration-dependencies>
+      <restartRequiredAfterChange>true</restartRequiredAfterChange>
+    </service>
+  </services>
+</metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/metrics.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/metrics.json b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/metrics.json
new file mode 100644
index 0000000..826c0e8
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/metrics.json
@@ -0,0 +1,262 @@
+{
+  "KAFKA_BROKER": {
+    "Component": [
+      {
+        "type": "ganglia",
+        "metrics": {
+          "metrics/jvm/uptime":{
+            "metric":"jvm.uptime",
+            "pointInTime":true,
+            "temporal":true
+          },
+          "metrics/jvm/heap_usage":{
+            "metric":"jvm.heap_usage",
+            "pointInTime":true,
+            "temporal":true
+          },
+          "metrics/jvm/non_heap_usage":{
+            "metric":"jvm.non_heap_usage",
+            "pointInTime":true,
+            "temporal":true
+          },
+          "metrics/jvm/thread-states/runnable":{
+            "metric":"jvm.thread-states.runnable",
+            "pointInTime":true,
+            "temporal":true
+          },
+          "metrics/jvm/thread-states/blocked":{
+            "metric":"jvm.thread-states.blocked",
+            "pointInTime":true,
+            "temporal":true
+          },
+          "metrics/jvm/thread-states/timed_waiting":{
+            "metric":"jvm.thread-states.timed_waiting",
+            "pointInTime":true,
+            "temporal":true
+          },
+          "metrics/jvm/thread-states/terminated":{
+            "metric":"jvm.thread-states.terminated",
+            "pointInTime":true,
+            "temporal":true
+          },
+          "metrics/jvm/thread_count":{
+            "metric":"jvm.thread_count",
+            "pointInTime":true,
+            "temporal":true
+          },
+          "metrics/jvm/daemon_thread_count":{
+            "metric":"jvm.daemon_thread_count",
+            "pointInTime":true,
+            "temporal":true
+          },
+          "metrics/kafka/server/BrokerTopicMetrics/AllTopicsMessagesInPerSec/1MinuteRate": {
+            "metric": "kafka.server.BrokerTopicMetrics.AllTopicsMessagesInPerSec.1MinuteRate",
+            "pointInTime": true,
+            "temporal": true
+          },
+          "metrics/kafka/server/BrokerTopicMetrics/AllTopicsMessagesInPerSec/5MinuteRate": {
+            "metric": "kafka.server.BrokerTopicMetrics.AllTopicsMessagesInPerSec.5MinuteRate",
+            "pointInTime": false,
+            "temporal": true
+          },
+          "metrics/kafka/server/BrokerTopicMetrics/AllTopicsMessagesInPerSec/15MinuteRate": {
+            "metric": "kafka.server.BrokerTopicMetrics.AllTopicsMessagesInPerSec.15MinuteRate",
+            "pointInTime": false,
+            "temporal": true
+          },
+          "metrics/kafka/server/BrokerTopicMetrics/AllTopicsMessagesInPerSec/meanRate": {
+            "metric": "kafka.server.BrokerTopicMetrics/AllTopicsMessagesInPerSec/meanRate",
+            "pointInTime": true,
+            "temporal": true
+          },
+          "metrics/kafka/server/BrokerTopicMetrics/AllTopicsMessagesInPerSec/count": {
+            "metric": "kafka.server.BrokerTopicMetrics/AllTopicsMessagesInPerSec.counte",
+            "pointInTime": true,
+            "temporal": true
+          },
+          "metrics/kafka/server/BrokerTopicMetrics/AllTopicsBytesInPerSec/1MinuteRate": {
+            "metric": "kafka.server.BrokerTopicMetrics.AllTopicsBytesInPerSec.1MinuteRate",
+            "pointInTime": true,
+            "temporal": true
+          },
+          "metrics/kafka/server/BrokerTopicMetrics/AllTopicsBytesInPerSec/5MinuteRate": {
+            "metric": "kafka.server.BrokerTopicMetrics.AllTopicsBytesInPerSec.5MinuteRate",
+            "pointInTime": true,
+            "temporal": true
+          },
+          "metrics/kafka/server/BrokerTopicMetrics/AllTopicsBytesInPerSec/15MinuteRate": {
+            "metric": "kafka.server.BrokerTopicMetrics.AllTopicsBytesInPerSec.15MinuteRate",
+            "pointInTime": true,
+            "temporal": true
+          },
+          "metrics/kafka/server/BrokerTopicMetrics/AllTopicsBytesInPerSec/meanRate": {
+            "metric": "kafka.server.BrokerTopicMetrics.AllTopicsBytesInPerSec.meanRate",
+            "pointInTime": true,
+            "temporal": true
+          },
+          "metrics/kafka/server/BrokerTopicMetrics/AllTopicsBytesInPerSec/count": {
+            "metric": "kafka.server.BrokerTopicMetrics.AllTopicsBytesInPerSec.count",
+            "pointInTime": true,
+            "temporal": true
+          },
+          "metrics/kafka/server/BrokerTopicMetrics/AllTopicsBytesOutPerSec/1MinuteRate": {
+            "metric": "kafka.server.BrokerTopicMetrics.AllTopicsBytesOutPerSec.1MinuteRate",
+            "pointInTime": true,
+            "temporal": true
+          },
+          "metrics/kafka/server/BrokerTopicMetrics/AllTopicsBytesOutPerSec/5MinuteRate": {
+            "metric": "kafka.server.BrokerTopicMetrics.AllTopicsBytesOutPerSec.5MinuteRate",
+            "pointInTime": true,
+            "temporal": true
+          },
+          "metrics/kafka/server/BrokerTopicMetrics/AllTopicsBytesOutPerSec/15MinuteRate": {
+            "metric": "kafka.server.BrokerTopicMetrics.AllTopicsBytesOutPerSec.15MinuteRate",
+            "pointInTime": true,
+            "temporal": true
+          },
+          "metrics/kafka/server/BrokerTopicMetrics/AllTopicsBytesOutPerSec/meanRate": {
+            "metric": "kafka.server.BrokerTopicMetrics.AllTopicsBytesOutPerSec.meanRate",
+            "pointInTime": true,
+            "temporal": true
+          },
+          "metrics/kafka/server/BrokerTopicMetrics/AllTopicsBytesOutPerSec/count": {
+            "metric": "kafka.server.BrokerTopicMetrics.AllTopicsBytesOutPerSec.count",
+            "pointInTime": true,
+            "temporal": true
+          },
+          "metrics/kafka/controller/KafkaController/ActiveControllerCount": {
+            "metric": "kafka.controller.KafkaController.ActiveControllerCount",
+            "pointInTime": true,
+            "temporal": true
+          },
+          "metrics/kafka/log/LogFlushStats/LogFlushRateAndTimeMs/meanRate": {
+            "metric": "kafka.log.LogFlushStats.LogFlushRateAndTimeMs.meanRate",
+            "pointInTime": true,
+            "temporal": true
+          },
+          "metrics/kafka/log/LogFlushStats/LogFlushRateAndTimeMs/1MinuteRate": {
+            "metric": "kafka.log.LogFlushStats.LogFlushRateAndTimeMs.1MinuteRate",
+            "pointInTime": true,
+            "temporal": true
+          },
+          "metrics/kafka/log/LogFlushStats/LogFlushRateAndTimeMs/5MinuteRate": {
+            "metric": "kafka.log.LogFlushStats.LogFlushRateAndTimeMs.1MinuteRate",
+            "pointInTime": true,
+            "temporal": true
+          },
+          "metrics/kafka/log/LogFlushStats/LogFlushRateAndTimeMs/15MinuteRate": {
+            "metric": "kafka.log.LogFlushStats.LogFlushRateAndTimeMs.15MinuteRate",
+            "pointInTime": true,
+            "temporal": true
+          },
+          "metrics/kafka/log/LogFlushStats/LogFlushRateAndTimeMs/count": {
+            "metric": "kafka.log.LogFlushStats.LogFlushRateAndTimeMs.count",
+            "pointInTime": true,
+            "temporal": true
+          },
+          "metrics/kafka/controller/ControllerStats/LeaderElectionRateAndTimeMs/meanRate": {
+            "metric": "kafka.controller.ControllerStats.LeaderElectionRateAndTimeMs.meanRate",
+            "pointInTime": true,
+            "temporal": true
+          },
+          "metrics/kafka/controller/ControllerStats/LeaderElectionRateAndTimeMs/1MinuteRate": {
+            "metric": "kafka.controller.ControllerStats.LeaderElectionRateAndTimeMs.1MinuteRate",
+            "pointInTime": true,
+            "temporal": true
+          },
+          "metrics/kafka/controller/ControllerStats/LeaderElectionRateAndTimeMs/5MinuteRate": {
+            "metric": "kafka.controller.ControllerStats.LeaderElectionRateAndTimeMs.5MinuteRate",
+            "pointInTime": true,
+            "temporal": true
+          },
+          "metrics/kafka/controller/ControllerStats/LeaderElectionRateAndTimeMs/15MinuteRate": {
+            "metric": "kafka.controller.ControllerStats.LeaderElectionRateAndTimeMs.15MinuteRate",
+            "pointInTime": true,
+            "temporal": true
+          },
+          "metrics/kafka/controller/ControllerStats/LeaderElectionRateAndTimeMs/count": {
+            "metric": "kafka.controller.ControllerStats.LeaderElectionRateAndTimeMs.count",
+            "pointInTime": true,
+            "temporal": true
+          },
+          "metrics/kafka/controller/ControllerStats/UncleanLeaderElectionsPerSec/1MinuteRate": {
+            "metric": "kafka.controller.ControllerStats.UncleanLeaderElectionsPerSec.1MinuteRate",
+            "pointInTime": true,
+            "temporal": true
+          },
+          "metrics/kafka/controller/ControllerStats/UncleanLeaderElectionsPerSec/5MinuteRate": {
+            "metric": "kafka.controller.ControllerStats.UncleanLeaderElectionsPerSec.5MinuteRate",
+            "pointInTime": true,
+            "temporal": true
+          },
+          "metrics/kafka/controller/ControllerStats/UncleanLeaderElectionsPerSec/15MinuteRate": {
+            "metric": "kafka.controller.ControllerStats.UncleanLeaderElectionsPerSec.15MinuteRate",
+            "pointInTime": true,
+            "temporal": true
+          },
+          "metrics/kafka/controller/ControllerStats/OfflinePartitionsCount": {
+              "metric": "kafka.controller.ControllerStats.OfflinePartitionsCount",
+              "pointInTime" :true,
+              "temporal": true
+          },
+          "metrics/kafka/server/ReplicaManager/PartitionCount": {
+              "metric": "kafka.server.ReplicaManager.PartitionCount",
+              "pointInTime" : true,
+              "temporal": true
+          },
+          "metrics/kafka/server/ReplicaManager/LeaderCount": {
+              "metric": "kafka.server.ReplicaManager.LeaderCount",
+              "pointInTime" : true,
+              "temporal": true
+          },
+          "metrics/kafka/server/ReplicaManager/UnderReplicatedPartitions": {
+              "metric": "kafka.server.ReplicaManager.UnderReplicatedPartitions",
+              "pointInTime" :true,
+              "temporal": true
+          },
+          "metrics/kafka/server/ReplicaManager/ISRShrinksPerSec": {
+              "metric": "kafka.server.ReplicaManager.ISRShrinksPerSec",
+              "pointInTime" : true,
+              "temporal": true
+          },
+          "metrics/kafka/server/ReplicaManager/ISRExpandsPerSec": {
+              "metric": "kafka.server.ReplicaManager.ISRExpandsPerSec",
+              "pointInTime" : true,
+              "temporal": true
+          },
+
+          "metrics/kafka/server/ReplicaFetcherManager/Replica-MaxLag": {
+              "metric": "kafka.server.ReplicaFetcherManager.Replica-MaxLag",
+              "pointInTime" : true,
+              "temporal": true
+          },
+          "metrics/kafka/server/ProducerRequestPurgatory/PurgatorySize": {
+              "metric": "kafka.server.ProducerRequestPurgatory.PurgatorySize",
+              "pointInTime" : true,
+              "temporal": true
+          },
+          "metrics/kafka/server/FetchRequestPurgatory/PurgatorySize": {
+              "metric": "kafka.server.FetchRequestPurgatory.PurgatorySize",
+              "pointInTime" : true,
+              "temporal": true
+          },
+          "metrics/kafka/cluster/Partition/$1-UnderReplicated":{
+            "metric":"kafka.cluster.Partition.(\\w+)-UnderReplicated",
+            "pointInTime":true,
+            "temporal":true
+          },
+          "metrics/kafka/consumer/ConsumerFetcherManager/$1-MaxLag":{
+            "metric":"kafka.consumer.ConsumerFetcherManager.(\\w+)-MaxLag",
+            "pointInTime":true,
+            "temporal":true
+          },
+          "metrics/kafka/consumer/ConsumerFetcherManager/$1-MinFetch":{
+            "metric":"kafka.consumer.ConsumerFetcherManager.(\\w+)-MinFetch",
+            "pointInTime":true,
+            "temporal":true
+          }
+        }
+      }
+    ]
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/kafka.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/kafka.py b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/kafka.py
new file mode 100644
index 0000000..c0231a8
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/kafka.py
@@ -0,0 +1,70 @@
+#!/usr/bin/env python
+"""
+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.
+
+"""
+
+from resource_management import *
+from properties_config import properties_config
+import sys
+from copy import deepcopy
+
+def kafka():
+    import params
+
+    Directory([params.log_dir, params.pid_dir, params.conf_dir],
+              owner=params.kafka_user,
+              group=params.user_group,
+              recursive=True
+          )
+    brokerid = str(sorted(params.kafka_hosts).index(params.hostname))
+    kafka_server_config = mutable_config_dict(params.config['configurations']['kafka-broker'])
+    kafka_server_config['broker.id'] = brokerid
+    kafka_server_config['host.name'] = params.hostname
+    kafka_data_dir = kafka_server_config['log.dirs']
+    Directory(filter(None,kafka_data_dir.split(",")),
+              owner=params.kafka_user,
+              group=params.user_group,
+              recursive=True)
+
+    conf_dir = params.conf_dir
+    properties_config("server.properties",
+                      conf_dir=params.conf_dir,
+                      configurations=kafka_server_config,
+                      owner=params.kafka_user,
+                      group=params.user_group,
+                      brokerid=brokerid)
+
+    File(format("{conf_dir}/kafka-env.sh"),
+          owner=params.kafka_user,
+          content=InlineTemplate(params.kafka_env_sh_template)
+     )
+
+    if (params.log4j_props != None):
+        File(format("{conf_dir}/log4j.properties"),
+             mode=0644,
+             group=params.user_group,
+             owner=params.kafka_user,
+             content=params.log4j_props
+         )
+
+
+def mutable_config_dict(kafka_broker_config):
+    kafka_server_config = {}
+    for key, value in kafka_broker_config.iteritems():
+        kafka_server_config[key] = value
+    return kafka_server_config

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/kafka_broker.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/kafka_broker.py b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/kafka_broker.py
new file mode 100644
index 0000000..c79ebb9
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/kafka_broker.py
@@ -0,0 +1,63 @@
+"""
+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.
+
+"""
+
+from resource_management import *
+import sys
+
+from kafka import kafka
+
+class KafkaBroker(Script):
+  def install(self, env):
+    self.install_packages(env)
+    self.configure(env)
+
+  def configure(self, env):
+    import params
+    env.set_params(params)
+    kafka()
+
+  def start(self, env):
+    import params
+    env.set_params(params)
+    self.configure(env)
+    daemon_cmd = format('source {params.conf_dir}/kafka-env.sh ; {params.kafka_bin} start')
+    no_op_test = format('ls {params.pid_file} >/dev/null 2>&1 && ps -p `cat {params.pid_file}` >/dev/null 2>&1')
+    Execute(daemon_cmd,
+            user=params.kafka_user,
+            not_if=no_op_test
+    )
+
+  def stop(self, env):
+    import params
+    env.set_params(params)
+    self.configure(env)
+    daemon_cmd = format('source {params.conf_dir}/kafka-env.sh; {params.kafka_bin} stop')
+    Execute(daemon_cmd,
+            user=params.kafka_user,
+    )
+    Execute (format("rm -f {params.pid_file}"))
+
+
+  def status(self, env):
+    import status_params
+    env.set_params(status_params)
+    check_process_status(status_params.kafka_pid_file)
+
+if __name__ == "__main__":
+  KafkaBroker().execute()

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/params.py b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/params.py
new file mode 100644
index 0000000..dc98526
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/params.py
@@ -0,0 +1,57 @@
+#!/usr/bin/env python
+"""
+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.
+
+"""
+
+from resource_management.libraries.functions.version import format_hdp_stack_version, compare_versions
+from resource_management import *
+import status_params
+
+# server configurations
+config = Script.get_config()
+
+hdp_stack_version = str(config['hostLevelParams']['stack_version'])
+hdp_stack_version = format_hdp_stack_version(hdp_stack_version)
+
+if hdp_stack_version != "" and compare_versions(hdp_stack_version, '2.2') >= 0:
+    kafka_home = '/usr/hdp/current/kafka-broker/'
+    kafka_bin = kafka_home+'bin/kafka'
+else:
+    kafka_home = '/usr/lib/kafka/'
+    kafka_bin = kafka_home+'/bin/kafka'
+
+
+conf_dir = "/etc/kafka/conf"
+kafka_user = config['configurations']['kafka-env']['kafka_user']
+log_dir = config['configurations']['kafka-env']['kafka_log_dir']
+pid_dir = status_params.kafka_pid_dir
+pid_file = pid_dir+"/kafka.pid"
+hostname = config['hostname']
+user_group = config['configurations']['cluster-env']['user_group']
+java64_home = config['hostLevelParams']['java_home']
+kafka_env_sh_template = config['configurations']['kafka-env']['content']
+kafka_hosts = config['clusterHostInfo']['kafka_broker_hosts']
+kafka_hosts.sort()
+
+zookeeper_hosts = config['clusterHostInfo']['zookeeper_hosts']
+zookeeper_hosts.sort()
+
+if (('kafka-log4j' in config['configurations']) and ('content' in config['configurations']['kafka-log4j'])):
+    log4j_props = config['configurations']['kafka-log4j']['content']
+else:
+    log4j_props = None

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/properties_config.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/properties_config.py b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/properties_config.py
new file mode 100644
index 0000000..56bab2c
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/properties_config.py
@@ -0,0 +1,32 @@
+#!/usr/bin/env python
+"""
+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 re
+from resource_management import *
+
+def properties_inline_template(configurations):
+  return source.InlineTemplate('''{% for key, value in configurations_dict.items() %}{{ key }}={{ value }}
+{% endfor %}''', configurations_dict=configurations)
+
+def properties_config(filename, configurations = None, conf_dir = None,
+                      mode = None, owner = None, group = None, brokerid = None):
+    config_content = properties_inline_template(configurations)
+    File (format("{conf_dir}/{filename}"), content = config_content, owner = owner,
+          group = group, mode = mode)

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/service_check.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/service_check.py b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/service_check.py
new file mode 100644
index 0000000..c2b4bc1
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/service_check.py
@@ -0,0 +1,65 @@
+#!/usr/bin/env python
+"""
+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.
+
+"""
+from __future__ import print_function
+from resource_management import *
+import  sys,subprocess,os
+
+class ServiceCheck(Script):
+    def service_check(self, env):
+        import params
+        env.set_params(params)
+        kafka_config=self.read_kafka_config(params.conf_dir)
+        self.set_env(params.conf_dir)
+        create_topic_cmd_created_output = "Created topic \"ambari_kafka_service_check\"."
+        create_topic_cmd_exists_output = "Topic \"ambari_kafka_service_check\" already exists."
+	print("Running kafka create topic command", file=sys.stdout)
+        create_topic_cmd = [params.kafka_home+'/bin/kafka-topics.sh', '--zookeeper '+kafka_config['zookeeper.connect'],
+                            '--create --topic ambari_kafka_service_check', '--partitions 1 --replication-factor 1']
+	print(" ".join(create_topic_cmd), file=sys.stdout)
+        create_topic_process = subprocess.Popen(create_topic_cmd,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
+        out, err = create_topic_process.communicate()
+        if out.find(create_topic_cmd_created_output) != -1:
+	    print(out, file=sys.stdout)
+            sys.exit(0)
+        elif out.find(create_topic_cmd_exists_output) != -1:
+            print("Topic ambari_kafka_service_check exists", file=sys.stdout)
+            sys.exit(0)
+        else:
+	    print(out, file=sys.stderr)
+            sys.exit(1)
+
+    def read_kafka_config(self,kafka_conf_dir):
+        conf_file = open(kafka_conf_dir+"/server.properties","r")
+        kafka_config = {}
+        for line in conf_file:
+            key,value = line.split("=")
+            kafka_config[key] = value.replace("\n","")
+        return kafka_config
+
+    def set_env(self, kafka_conf_dir):
+        command = ['bash', '-c', 'source '+kafka_conf_dir+'/kafka-env.sh && env']
+        proc = subprocess.Popen(command, stdout = subprocess.PIPE)
+        for line in proc.stdout:
+            (key, _, value) = line.partition("=")
+            os.environ[key] = value.replace("\n","")
+        proc.communicate()
+
+if __name__ == "__main__":
+    ServiceCheck().execute()

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/status_params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/status_params.py b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/status_params.py
new file mode 100644
index 0000000..fcb0816
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/status_params.py
@@ -0,0 +1,26 @@
+#!/usr/bin/env python
+"""
+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.
+
+"""
+
+from resource_management import *
+
+config = Script.get_config()
+
+kafka_pid_dir = config['configurations']['kafka-env']['kafka_pid_dir']
+kafka_pid_file = format("{kafka_pid_dir}/kafka.pid")

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/alerts.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/alerts.json b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/alerts.json
new file mode 100644
index 0000000..e063da7
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/alerts.json
@@ -0,0 +1,32 @@
+{
+  "KNOX": {
+    "service": [],
+    "KNOX_GATEWAY": [
+      {
+        "name": "knox_gateway_process",
+        "label": "Know Gateway Process",
+        "description": "This host-level alert is triggered if the Knox Gateway cannot be determined to be up.",
+        "interval": 1,
+        "scope": "HOST",
+        "source": {
+          "type": "PORT",
+          "uri": "{{gateway-site/gateway.port}}",
+          "default_port": 8443,
+          "reporting": {
+            "ok": {
+              "text": "TCP OK - {0:.3f}s response on port {1}"
+            },
+            "warning": {
+              "text": "TCP OK - {0:.3f}s response on port {1}",
+              "value": 1.5
+            },
+            "critical": {
+              "text": "Connection failed: {0} to {1}:{2}",
+              "value": 5.0
+            }
+          }
+        }
+      }
+    ]
+  }
+}


[4/6] ambari git commit: AMBARI-8782: Common Services: Refactor HDP-2.2 AMS, KAFKA, KNOX, SLIDER services (Jayush Luniya)

Posted by jl...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/gateway-log4j.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/gateway-log4j.xml b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/gateway-log4j.xml
new file mode 100644
index 0000000..370f786
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/gateway-log4j.xml
@@ -0,0 +1,83 @@
+<?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 supports_final="false">
+
+  <property>
+    <name>content</name>
+    <value>
+
+      # 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.
+
+      app.log.dir=${launcher.dir}/../logs
+      app.log.file=${launcher.name}.log
+      app.audit.file=${launcher.name}-audit.log
+
+      log4j.rootLogger=ERROR, drfa
+
+      log4j.logger.org.apache.hadoop.gateway=INFO
+      #log4j.logger.org.apache.hadoop.gateway=DEBUG
+
+      #log4j.logger.org.eclipse.jetty=DEBUG
+      #log4j.logger.org.apache.shiro=DEBUG
+      #log4j.logger.org.apache.http=DEBUG
+      #log4j.logger.org.apache.http.client=DEBUG
+      #log4j.logger.org.apache.http.headers=DEBUG
+      #log4j.logger.org.apache.http.wire=DEBUG
+
+      log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+      log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+      log4j.appender.stdout.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{2}: %m%n
+
+      log4j.appender.drfa=org.apache.log4j.DailyRollingFileAppender
+      log4j.appender.drfa.File=${app.log.dir}/${app.log.file}
+      log4j.appender.drfa.DatePattern=.yyyy-MM-dd
+      log4j.appender.drfa.layout=org.apache.log4j.PatternLayout
+      log4j.appender.drfa.layout.ConversionPattern=%d{ISO8601} %-5p %c{2} (%F:%M(%L)) - %m%n
+
+      log4j.logger.audit=INFO, auditfile
+      log4j.appender.auditfile=org.apache.log4j.DailyRollingFileAppender
+      log4j.appender.auditfile.File=${app.log.dir}/${app.audit.file}
+      log4j.appender.auditfile.Append = true
+      log4j.appender.auditfile.DatePattern = '.'yyyy-MM-dd
+      log4j.appender.auditfile.layout = org.apache.hadoop.gateway.audit.log4j.layout.AuditLayout
+
+    </value>
+    <description>
+      content for log4j.properties file for Knox.
+    </description>
+  </property>
+</configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/gateway-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/gateway-site.xml b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/gateway-site.xml
new file mode 100644
index 0000000..4d4c4ed
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/gateway-site.xml
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 
+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.
+-->
+
+<!-- The default settings for Knox. -->
+<!-- Edit gateway-site.xml to change settings for your local -->
+<!-- install. -->
+
+<configuration supports_final="false">
+
+    <property>
+        <name>gateway.port</name>
+        <value>8443</value>
+        <description>The HTTP port for the Gateway.</description>
+    </property>
+
+    <property>
+        <name>gateway.path</name>
+        <value>gateway</value>
+        <description>The default context path for the gateway.</description>
+    </property>
+
+    <property>
+        <name>gateway.gateway.conf.dir</name>
+        <value>deployments</value>
+        <description>The directory within GATEWAY_HOME that contains gateway topology files and deployments.</description>
+    </property>
+
+    <property>
+        <name>gateway.hadoop.kerberos.secured</name>
+        <value>false</value>
+        <description>Boolean flag indicating whether the Hadoop cluster protected by Gateway is secured with Kerberos</description>
+    </property>
+
+    <property>
+        <name>java.security.krb5.conf</name>
+        <value>/etc/knox/conf/krb5.conf</value>
+        <description>Absolute path to krb5.conf file</description>
+    </property>
+
+    <property>
+        <name>java.security.auth.login.config</name>
+        <value>/etc/knox/conf/krb5JAASLogin.conf</value>
+        <description>Absolute path to JASS login config file</description>
+    </property>
+
+    <property>
+        <name>sun.security.krb5.debug</name>
+        <value>true</value>
+        <description>Boolean flag indicating whether to enable debug messages for krb5 authentication</description>
+    </property>
+
+</configuration>
+
+
+
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/knox-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/knox-env.xml b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/knox-env.xml
new file mode 100644
index 0000000..871d0c0
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/knox-env.xml
@@ -0,0 +1,53 @@
+<?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 supports_final="true">
+    <!-- knox-env.sh -->
+
+    <property require-input="true">
+        <name>knox_master_secret</name>
+        <value></value>
+        <property-type>PASSWORD</property-type>
+        <description>password to use as the master secret</description>
+    </property>
+
+    <property>
+        <name>knox_user</name>
+        <value>knox</value>
+        <property-type>USER</property-type>
+        <description>Knox Username.</description>
+    </property>
+
+    <property>
+        <name>knox_group</name>
+        <value>knox</value>
+        <property-type>GROUP</property-type>
+        <description>Knox Group.</description>
+    </property>
+
+    <property>
+        <name>knox_pid_dir</name>
+        <value>/var/run/knox</value>
+        <description>Knox PID dir.</description>
+    </property>
+
+</configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/ldap-log4j.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/ldap-log4j.xml b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/ldap-log4j.xml
new file mode 100644
index 0000000..a0cf658
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/ldap-log4j.xml
@@ -0,0 +1,66 @@
+<?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 supports_final="false">
+
+  <property>
+    <name>content</name>
+    <value>
+        # 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.
+
+        app.log.dir=${launcher.dir}/../logs
+        app.log.file=${launcher.name}.log
+
+        log4j.rootLogger=ERROR, drfa
+        log4j.logger.org.apache.directory.server.ldap.LdapServer=INFO
+        log4j.logger.org.apache.directory=WARN
+
+        log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+        log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+        log4j.appender.stdout.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{2}: %m%n
+
+        log4j.appender.drfa=org.apache.log4j.DailyRollingFileAppender
+        log4j.appender.drfa.File=${app.log.dir}/${app.log.file}
+        log4j.appender.drfa.DatePattern=.yyyy-MM-dd
+        log4j.appender.drfa.layout=org.apache.log4j.PatternLayout
+        log4j.appender.drfa.layout.ConversionPattern=%d{ISO8601} %-5p %c{2} (%F:%M(%L)) - %m%n
+
+    </value>
+    <description>
+      content for log4j.properties file for the demo LDAP that comes with Knox.
+    </description>
+  </property>
+</configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/topology.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/topology.xml b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/topology.xml
new file mode 100644
index 0000000..db16a21
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/topology.xml
@@ -0,0 +1,116 @@
+<?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 supports_final="false" supports_adding_forbidden="true">
+    <!-- topology file -->
+
+    <property>
+    <name>content</name>
+    <value>
+        &lt;topology&gt;
+
+            &lt;gateway&gt;
+
+                &lt;provider&gt;
+                    &lt;role&gt;authentication&lt;/role&gt;
+                    &lt;name&gt;ShiroProvider&lt;/name&gt;
+                    &lt;enabled&gt;true&lt;/enabled&gt;
+                    &lt;param&gt;
+                        &lt;name&gt;sessionTimeout&lt;/name&gt;
+                        &lt;value&gt;30&lt;/value&gt;
+                    &lt;/param&gt;
+                    &lt;param&gt;
+                        &lt;name&gt;main.ldapRealm&lt;/name&gt;
+                        &lt;value&gt;org.apache.hadoop.gateway.shirorealm.KnoxLdapRealm&lt;/value&gt;
+                    &lt;/param&gt;
+                    &lt;param&gt;
+                        &lt;name&gt;main.ldapRealm.userDnTemplate&lt;/name&gt;
+                        &lt;value&gt;uid={0},ou=people,dc=hadoop,dc=apache,dc=org&lt;/value&gt;
+                    &lt;/param&gt;
+                    &lt;param&gt;
+                        &lt;name&gt;main.ldapRealm.contextFactory.url&lt;/name&gt;
+                        &lt;value&gt;ldap://{{knox_host_name}}:33389&lt;/value&gt;
+                    &lt;/param&gt;
+                    &lt;param&gt;
+                        &lt;name&gt;main.ldapRealm.contextFactory.authenticationMechanism&lt;/name&gt;
+                        &lt;value&gt;simple&lt;/value&gt;
+                    &lt;/param&gt;
+                    &lt;param&gt;
+                        &lt;name&gt;urls./**&lt;/name&gt;
+                        &lt;value&gt;authcBasic&lt;/value&gt;
+                    &lt;/param&gt;
+                &lt;/provider&gt;
+
+                &lt;provider&gt;
+                    &lt;role&gt;identity-assertion&lt;/role&gt;
+                    &lt;name&gt;Default&lt;/name&gt;
+                    &lt;enabled&gt;true&lt;/enabled&gt;
+                &lt;/provider&gt;
+
+            &lt;/gateway&gt;
+
+            &lt;service&gt;
+                &lt;role&gt;NAMENODE&lt;/role&gt;
+                &lt;url&gt;hdfs://{{namenode_host}}:{{namenode_rpc_port}}&lt;/url&gt;
+            &lt;/service&gt;
+
+            &lt;service&gt;
+                &lt;role&gt;JOBTRACKER&lt;/role&gt;
+                &lt;url&gt;rpc://{{rm_host}}:{{jt_rpc_port}}&lt;/url&gt;
+            &lt;/service&gt;
+
+            &lt;service&gt;
+                &lt;role&gt;WEBHDFS&lt;/role&gt;
+                &lt;url&gt;http://{{namenode_host}}:{{namenode_http_port}}/webhdfs&lt;/url&gt;
+            &lt;/service&gt;
+
+            &lt;service&gt;
+                &lt;role&gt;WEBHCAT&lt;/role&gt;
+                &lt;url&gt;http://{{webhcat_server_host}}:{{templeton_port}}/templeton&lt;/url&gt;
+            &lt;/service&gt;
+
+            &lt;service&gt;
+                &lt;role&gt;OOZIE&lt;/role&gt;
+                &lt;url&gt;http://{{oozie_server_host}}:{{oozie_server_port}}/oozie&lt;/url&gt;
+            &lt;/service&gt;
+
+            &lt;service&gt;
+                &lt;role&gt;WEBHBASE&lt;/role&gt;
+                &lt;url&gt;http://{{hbase_master_host}}:{{hbase_master_port}}&lt;/url&gt;
+            &lt;/service&gt;
+
+            &lt;service&gt;
+                &lt;role&gt;HIVE&lt;/role&gt;
+                &lt;url&gt;http://{{hive_server_host}}:{{hive_http_port}}/{{hive_http_path}}&lt;/url&gt;
+            &lt;/service&gt;
+
+            &lt;service&gt;
+                &lt;role&gt;RESOURCEMANAGER&lt;/role&gt;
+                &lt;url&gt;http://{{rm_host}}:{{rm_port}}/ws&lt;/url&gt;
+            &lt;/service&gt;
+        &lt;/topology&gt;
+    </value>
+    <description>
+        The configuration specifies the Hadoop cluster services Knox will provide access to.
+    </description>
+    </property>
+</configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/users-ldif.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/users-ldif.xml b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/users-ldif.xml
new file mode 100644
index 0000000..ace4858
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/users-ldif.xml
@@ -0,0 +1,135 @@
+<?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 supports_final="false" supports_adding_forbidden="true">
+
+    <property>
+        <name>content</name>
+        <value>
+# 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.
+
+version: 1
+
+# Please replace with site specific values
+dn: dc=hadoop,dc=apache,dc=org
+objectclass: organization
+objectclass: dcObject
+o: Hadoop
+dc: hadoop
+
+# Entry for a sample people container
+# Please replace with site specific values
+dn: ou=people,dc=hadoop,dc=apache,dc=org
+objectclass:top
+objectclass:organizationalUnit
+ou: people
+
+# Entry for a sample end user
+# Please replace with site specific values
+dn: uid=guest,ou=people,dc=hadoop,dc=apache,dc=org
+objectclass:top
+objectclass:person
+objectclass:organizationalPerson
+objectclass:inetOrgPerson
+cn: Guest
+sn: User
+uid: guest
+userPassword:guest-password
+
+# entry for sample user admin
+dn: uid=admin,ou=people,dc=hadoop,dc=apache,dc=org
+objectclass:top
+objectclass:person
+objectclass:organizationalPerson
+objectclass:inetOrgPerson
+cn: Admin
+sn: Admin
+uid: admin
+userPassword:admin-password
+
+# entry for sample user sam
+dn: uid=sam,ou=people,dc=hadoop,dc=apache,dc=org
+objectclass:top
+objectclass:person
+objectclass:organizationalPerson
+objectclass:inetOrgPerson
+cn: sam
+sn: sam
+uid: sam
+userPassword:sam-password
+
+# entry for sample user tom
+dn: uid=tom,ou=people,dc=hadoop,dc=apache,dc=org
+objectclass:top
+objectclass:person
+objectclass:organizationalPerson
+objectclass:inetOrgPerson
+cn: tom
+sn: tom
+uid: tom
+userPassword:tom-password
+
+# create FIRST Level groups branch
+dn: ou=groups,dc=hadoop,dc=apache,dc=org
+objectclass:top
+objectclass:organizationalUnit
+ou: groups
+description: generic groups branch
+
+# create the analyst group under groups
+dn: cn=analyst,ou=groups,dc=hadoop,dc=apache,dc=org
+objectclass:top
+objectclass: groupofnames
+cn: analyst
+description:analyst  group
+member: uid=sam,ou=people,dc=hadoop,dc=apache,dc=org
+member: uid=tom,ou=people,dc=hadoop,dc=apache,dc=org
+
+
+# create the scientist group under groups
+dn: cn=scientist,ou=groups,dc=hadoop,dc=apache,dc=org
+objectclass:top
+objectclass: groupofnames
+cn: scientist
+description: scientist group
+member: uid=sam,ou=people,dc=hadoop,dc=apache,dc=org
+
+        </value>
+        <description>
+            content for users-ldif file for the demo LDAP that comes with Knox.
+        </description>
+    </property>
+</configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/metainfo.xml b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/metainfo.xml
new file mode 100644
index 0000000..cf118ba
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/metainfo.xml
@@ -0,0 +1,87 @@
+<?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>KNOX</name>
+      <displayName>Knox</displayName>
+      <comment>Provides a single point of authentication and access for Apache Hadoop services in a cluster</comment>
+      <version>0.5.0.2.2</version>
+      <components>
+        <component>
+          <name>KNOX_GATEWAY</name>
+          <displayName>Knox Gateway</displayName>
+          <category>MASTER</category>
+          <cardinality>1+</cardinality>
+          <commandScript>
+            <script>scripts/knox_gateway.py</script>
+            <scriptType>PYTHON</scriptType>
+            <timeout>600</timeout>
+          </commandScript>
+            <customCommands>
+                <customCommand>
+                    <name>STARTDEMOLDAP</name>
+                    <commandScript>
+                        <script>scripts/demo_ldap.py</script>
+                        <scriptType>PYTHON</scriptType>
+                        <timeout>600</timeout>
+                    </commandScript>
+                </customCommand>
+                <customCommand>
+                    <name>STOPDEMOLDAP</name>
+                    <commandScript>
+                        <script>scripts/demo_ldap.py</script>
+                        <scriptType>PYTHON</scriptType>
+                        <timeout>600</timeout>
+                    </commandScript>
+                </customCommand>
+            </customCommands>
+        </component>
+      </components>
+      <osSpecifics>
+        <osSpecific>
+          <osFamily>redhat5,redhat6,suse11</osFamily>
+          <packages>
+            <package>
+              <name>knox_2_2_*</name>
+            </package>
+          </packages>
+        </osSpecific>
+        <osSpecific>
+          <osFamily>ubuntu12</osFamily>
+          <packages>
+            <package>
+              <name>knox-2-2-.*</name>
+            </package>
+          </packages>
+        </osSpecific>
+      </osSpecifics>
+      <commandScript>
+        <script>scripts/service_check.py</script>
+        <scriptType>PYTHON</scriptType>
+        <timeout>300</timeout>
+      </commandScript>
+      <configuration-dependencies>
+        <config-type>gateway-site</config-type>
+        <config-type>gateway-log4j</config-type>
+        <config-type>topology</config-type>
+      </configuration-dependencies>
+    </service>
+  </services>
+</metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/files/validateKnoxStatus.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/files/validateKnoxStatus.py b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/files/validateKnoxStatus.py
new file mode 100644
index 0000000..257abfb
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/files/validateKnoxStatus.py
@@ -0,0 +1,43 @@
+#!/usr/bin/env python
+"""
+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 optparse
+import socket
+
+#
+# Main.
+#
+def main():
+  parser = optparse.OptionParser(usage="usage: %prog [options]")
+  parser.add_option("-p", "--port", dest="port", help="Port for Knox process")
+  parser.add_option("-n", "--hostname", dest="hostname", help="Hostname of Knox Gateway component")
+
+  (options, args) = parser.parse_args()
+  timeout_seconds = 5
+  try:
+    s = socket.create_connection((options.hostname, int(options.port)),timeout=timeout_seconds)
+    print "Successfully connected to %s on port %s" % (options.hostname, options.port)
+    s.close()
+  except socket.error, e:
+    print "Connection to %s on port %s failed: %s" % (options.hostname, options.port, e)
+    exit(1)
+
+if __name__ == "__main__":
+  main()
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/knox.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/knox.py b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/knox.py
new file mode 100644
index 0000000..7d7d20c
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/knox.py
@@ -0,0 +1,85 @@
+"""
+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.
+
+"""
+
+from resource_management import *
+
+
+def knox():
+    import params
+
+    Directory(params.knox_conf_dir,
+              owner = params.knox_user,
+              group = params.knox_group,
+              recursive = True
+    )
+
+
+    XmlConfig("gateway-site.xml",
+              conf_dir=params.knox_conf_dir,
+              configurations=params.config['configurations']['gateway-site'],
+              configuration_attributes=params.config['configuration_attributes']['gateway-site'],
+              owner=params.knox_user,
+              group=params.knox_group,
+    )
+
+    File(format("{params.knox_conf_dir}/gateway-log4j.properties"),
+         mode=0644,
+         group=params.knox_group,
+         owner=params.knox_user,
+         content=params.gateway_log4j
+    )
+
+    File(format("{params.knox_conf_dir}/topologies/default.xml"),
+         group=params.knox_group,
+         owner=params.knox_user,
+         content=InlineTemplate(params.topology_template)
+    )
+    if params.security_enabled:
+      TemplateConfig( format("{knox_conf_dir}/krb5JAASLogin.conf"),
+                      owner = params.knox_user,
+                      template_tag = None
+      )
+
+    dirs_to_chown = (params.knox_data_dir, params.knox_logs_dir, params.knox_logs_dir, params.knox_pid_dir, params.knox_conf_dir)
+    cmd = ('chown','-R',format('{knox_user}:{knox_group}'))+dirs_to_chown
+    Execute(cmd,
+            sudo = True,
+    )
+    
+    #File([params.knox_data_dir, params.knox_logs_dir, params.knox_logs_dir, params.knox_pid_dir, params.knox_conf_dir],
+    #     owner = params.knox_user,
+    #     group = params.knox_group
+    #)
+
+    cmd = format('{knox_client_bin} create-master --master {knox_master_secret!p}')
+    master_secret_exist = as_user(format('test -f {knox_master_secret_path}'), params.knox_user)
+    
+    Execute(cmd,
+            user=params.knox_user,
+            environment={'JAVA_HOME': params.java_home},
+            not_if=master_secret_exist,
+    )
+
+    cmd = format('{knox_client_bin} create-cert --hostname {knox_host_name_in_cluster}')
+    Execute(cmd,
+            user=params.knox_user,
+            environment={'JAVA_HOME': params.java_home},
+            not_if=master_secret_exist,
+    )
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/knox_gateway.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/knox_gateway.py b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/knox_gateway.py
new file mode 100644
index 0000000..f578926
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/knox_gateway.py
@@ -0,0 +1,103 @@
+"""
+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.
+
+"""
+
+from resource_management import *
+import sys
+
+from knox import knox
+from ldap import ldap
+
+class KnoxGateway(Script):
+  def install(self, env):
+    self.install_packages(env)
+    import params
+    env.set_params(params)
+    
+    File(format('{knox_conf_dir}/topologies/sandbox.xml'),
+         action = "delete",
+    )
+
+  def configure(self, env):
+    import params
+    env.set_params(params)
+    knox()
+    ldap()
+
+  def start(self, env):
+    import params
+    env.set_params(params)
+    self.configure(env)
+    daemon_cmd = format('{knox_bin} start')
+    no_op_test = format('ls {knox_pid_file} >/dev/null 2>&1 && ps -p `cat {knox_pid_file}` >/dev/null 2>&1')
+    Execute(daemon_cmd,
+            user=params.knox_user,
+            environment={'JAVA_HOME': params.java_home},
+            not_if=no_op_test
+    )
+
+  def stop(self, env):
+    import params
+    env.set_params(params)
+    self.configure(env)
+    daemon_cmd = format('{knox_bin} stop')
+    Execute(daemon_cmd,
+            environment={'JAVA_HOME': params.java_home},
+            user=params.knox_user,
+    )
+    Execute (format("rm -f {knox_pid_file}"))
+
+
+  def status(self, env):
+    import status_params
+    env.set_params(status_params)
+    check_process_status(status_params.knox_pid_file)
+
+
+  def configureldap(self, env):
+    import params
+    env.set_params(params)
+    ldap()
+
+  def startdemoldap(self, env):
+    import params
+    env.set_params(params)
+    self.configureldap(env)
+    daemon_cmd = format('{ldap_bin} start')
+    no_op_test = format('ls {ldap_pid_file} >/dev/null 2>&1 && ps -p `cat {ldap_pid_file}` >/dev/null 2>&1')
+    Execute(daemon_cmd,
+            user=params.knox_user,
+            environment={'JAVA_HOME': params.java_home},
+            not_if=no_op_test
+    )
+
+  def stopdemoldap(self, env):
+    import params
+    env.set_params(params)
+    self.configureldap(env)
+    daemon_cmd = format('{ldap_bin} stop')
+    Execute(daemon_cmd,
+            environment={'JAVA_HOME': params.java_home},
+            user=params.knox_user,
+            )
+    Execute (format("rm -f {ldap_pid_file}"))
+
+
+
+if __name__ == "__main__":
+  KnoxGateway().execute()

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/ldap.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/ldap.py b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/ldap.py
new file mode 100644
index 0000000..2ff8297
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/ldap.py
@@ -0,0 +1,39 @@
+"""
+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.
+
+"""
+
+from resource_management import *
+
+
+def ldap():
+    import params
+
+    File(format("{params.knox_conf_dir}/ldap-log4j.properties"),
+         mode=0644,
+         group=params.knox_group,
+         owner=params.knox_user,
+         content=params.ldap_log4j
+    )
+
+    File(format("{params.knox_conf_dir}/users.ldif"),
+         mode=0644,
+         group=params.knox_group,
+         owner=params.knox_user,
+         content=params.users_ldif
+    )
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/params.py b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/params.py
new file mode 100644
index 0000000..2327a66
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/params.py
@@ -0,0 +1,139 @@
+"""
+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.
+
+Ambari Agent
+
+"""
+
+from resource_management.libraries.functions.version import format_hdp_stack_version, compare_versions
+from resource_management import *
+import status_params
+
+config = Script.get_config()
+tmp_dir = Script.get_tmp_dir()
+
+hdp_stack_version = str(config['hostLevelParams']['stack_version'])
+hdp_stack_version = format_hdp_stack_version(hdp_stack_version)
+
+if hdp_stack_version != "" and compare_versions(hdp_stack_version, '2.2') >= 0:
+  knox_bin = '/usr/hdp/current/knox-server/bin/gateway.sh'
+  ldap_bin = '/usr/hdp/current/knox-server/bin/ldap.sh'
+  knox_client_bin = '/usr/hdp/current/knox-server/bin/knoxcli.sh'
+else:
+  knox_bin = '/usr/bin/gateway'
+  ldap_bin = '/usr/lib/knox/bin/ldap.sh'
+  knox_client_bin = '/usr/lib/knox/bin/knoxcli.sh'
+
+namenode_hosts = default("/clusterHostInfo/namenode_host", None)
+if type(namenode_hosts) is list:
+    namenode_host = namenode_hosts[0]
+else:
+    namenode_host = namenode_hosts
+
+has_namenode = not namenode_host == None
+namenode_http_port = "50070"
+namenode_rpc_port = "8020"
+
+if has_namenode:
+    if 'dfs.namenode.http-address' in config['configurations']['hdfs-site']:
+        namenode_http_port = get_port_from_url(config['configurations']['hdfs-site']['dfs.namenode.http-address'])
+    if 'dfs.namenode.rpc-address' in config['configurations']['hdfs-site']:
+        namenode_rpc_port = get_port_from_url(config['configurations']['hdfs-site']['dfs.namenode.rpc-address'])
+
+rm_hosts = default("/clusterHostInfo/rm_host", None)
+if type(rm_hosts) is list:
+    rm_host = rm_hosts[0]
+else:
+    rm_host = rm_hosts
+has_rm = not rm_host == None
+
+jt_rpc_port = "8050"
+rm_port = "8080"
+
+if has_rm:
+    if 'yarn.resourcemanager.address' in config['configurations']['yarn-site']:
+        jt_rpc_port = get_port_from_url(config['configurations']['yarn-site']['yarn.resourcemanager.address'])
+
+    if 'yarn.resourcemanager.webapp.address' in config['configurations']['yarn-site']:
+        rm_port = get_port_from_url(config['configurations']['yarn-site']['yarn.resourcemanager.webapp.address'])
+
+hive_http_port = default('/configurations/hive-site/hive.server2.thrift.http.port', "10001")
+hive_http_path = default('/configurations/hive-site/hive.server2.thrift.http.path', "cliservice")
+hive_server_hosts = default("/clusterHostInfo/hive_server_host", None)
+if type(hive_server_hosts) is list:
+    hive_server_host = hive_server_hosts[0]
+else:
+    hive_server_host = hive_server_hosts
+
+templeton_port = default('/configurations/webhcat-site/templeton.port', "50111")
+webhcat_server_hosts = default("/clusterHostInfo/webhcat_server_host", None)
+if type(webhcat_server_hosts) is list:
+    webhcat_server_host = webhcat_server_hosts[0]
+else:
+    webhcat_server_host = webhcat_server_hosts
+
+hbase_master_port = default('/configurations/hbase-site/hbase.rest.port', "8080")
+hbase_master_hosts = default("/clusterHostInfo/hbase_master_hosts", None)
+if type(hbase_master_hosts) is list:
+    hbase_master_host = hbase_master_hosts[0]
+else:
+    hbase_master_host = hbase_master_hosts
+
+oozie_server_hosts = default("/clusterHostInfo/oozie_server", None)
+if type(oozie_server_hosts) is list:
+    oozie_server_host = oozie_server_hosts[0]
+else:
+    oozie_server_host = oozie_server_hosts
+
+has_oozie = not oozie_server_host == None
+oozie_server_port = "11000"
+
+if has_oozie:
+    if 'oozie.base.url' in config['configurations']['oozie-site']:
+        oozie_server_port = get_port_from_url(config['configurations']['oozie-site']['oozie.base.url'])
+
+
+# server configurations
+knox_conf_dir = '/etc/knox/conf'
+knox_data_dir = '/var/lib/knox/data'
+knox_logs_dir = '/var/log/knox'
+knox_pid_dir = status_params.knox_pid_dir
+knox_user = default("/configurations/knox-env/knox_user", "knox")
+knox_group = default("/configurations/knox-env/knox_group", "knox")
+knox_pid_file = status_params.knox_pid_file
+ldap_pid_file = status_params.ldap_pid_file
+knox_master_secret = config['configurations']['knox-env']['knox_master_secret']
+knox_master_secret_path = '/var/lib/knox/data/security/master'
+knox_cert_store_path = '/var/lib/knox/data/security/keystores/gateway.jks'
+knox_host_name = config['clusterHostInfo']['knox_gateway_hosts'][0]
+knox_host_name_in_cluster = config['hostname']
+knox_host_port = config['configurations']['gateway-site']['gateway.port']
+topology_template = config['configurations']['topology']['content']
+gateway_log4j = config['configurations']['gateway-log4j']['content']
+ldap_log4j = config['configurations']['ldap-log4j']['content']
+users_ldif = config['configurations']['users-ldif']['content']
+java_home = config['hostLevelParams']['java_home']
+security_enabled = config['configurations']['cluster-env']['security_enabled']
+smokeuser = config['configurations']['cluster-env']['smokeuser']
+smoke_user_keytab = config['configurations']['cluster-env']['smokeuser_keytab']
+kinit_path_local = functions.get_kinit_path(["/usr/bin", "/usr/kerberos/bin", "/usr/sbin"])
+if security_enabled:
+  knox_keytab_path = config['configurations']['knox-env']['knox_keytab_path']
+  _hostname_lowercase = config['hostname'].lower()
+  knox_principal_name = config['configurations']['knox-env']['knox_principal_name'].replace('_HOST',_hostname_lowercase)
+
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/service_check.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/service_check.py b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/service_check.py
new file mode 100644
index 0000000..0349c24
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/service_check.py
@@ -0,0 +1,58 @@
+#!/usr/bin/env python
+"""
+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.
+
+"""
+
+from resource_management import *
+import sys
+
+class KnoxServiceCheck(Script):
+
+    def service_check(self, env):
+        import params
+        env.set_params(params)
+
+        validateKnoxFileName = "validateKnoxStatus.py"
+        validateKnoxFilePath = format("{tmp_dir}/{validateKnoxFileName}")
+        python_executable = sys.executable
+        validateStatusCmd = format("{python_executable} {validateKnoxFilePath} -p {knox_host_port} -n {knox_host_name}")
+        if params.security_enabled:
+          kinit_cmd = format("{kinit_path_local} -kt {smoke_user_keytab} {smokeuser};")
+          smoke_cmd = format("{kinit_cmd} {validateStatusCmd}")
+        else:
+          smoke_cmd = validateStatusCmd
+
+        print "Test connectivity to knox server"
+
+
+        File(validateKnoxFilePath,
+          content=StaticFile(validateKnoxFileName),
+          mode=0755
+          )
+
+        Execute(smoke_cmd,
+          tries=3,
+          try_sleep=5,
+          path='/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin',
+          user=params.smokeuser,
+          timeout=5,
+          logoutput=True
+        )
+
+if __name__ == "__main__":
+    KnoxServiceCheck().execute()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/status_params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/status_params.py b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/status_params.py
new file mode 100644
index 0000000..880c617
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/status_params.py
@@ -0,0 +1,27 @@
+#!/usr/bin/env python
+"""
+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.
+
+"""
+
+from resource_management import *
+
+config = Script.get_config()
+
+knox_pid_dir = config['configurations']['knox-env']['knox_pid_dir']
+knox_pid_file = format("{knox_pid_dir}/gateway.pid")
+ldap_pid_file = format("{knox_pid_dir}/ldap.pid")

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/templates/krb5JAASLogin.conf.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/templates/krb5JAASLogin.conf.j2 b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/templates/krb5JAASLogin.conf.j2
new file mode 100644
index 0000000..fa3237b
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/templates/krb5JAASLogin.conf.j2
@@ -0,0 +1,30 @@
+{#
+# 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.
+#}
+com.sun.security.jgss.initiate {
+com.sun.security.auth.module.Krb5LoginModule required
+renewTGT=true
+doNotPrompt=true
+useKeyTab=true
+keyTab="{{knox_keytab_path}}"
+principal="{{knox_principal_name}}"
+isInitiator=true
+storeKey=true
+useTicketCache=true
+client=true;
+};
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/configuration/slider-client.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/configuration/slider-client.xml b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/configuration/slider-client.xml
new file mode 100644
index 0000000..fdeceae
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/configuration/slider-client.xml
@@ -0,0 +1,60 @@
+<?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 supports_final="true">
+
+  <!--
+    <property>
+      <name>slider.security.protocol.acl</name>
+      <value>*</value>
+      <description>When security is enabled, set appropriate acl. Default value means allow everyone.</description>
+    </property>
+    -->
+
+  <!--
+     The recommended approach is to configure slider-env.sh and set HADOOP_CONF_DIR.
+     Otherwise, appropriate configurations from hdfs-site, yarn-site, can be dropped in this file
+     for Slider client to work. The following list is not an exhaustive list but the minimal config
+     needed to interact with a non-secure cluster.
+  -->
+
+  <!--
+      <property>
+        <name>yarn.resourcemanager.address</name>
+        <value>localhost:8050</value>
+        <description>The address of the applications manager interface in the RM.</description>
+      </property>
+
+      <property>
+        <name>yarn.resourcemanager.scheduler.address</name>
+        <value>localhost:8030</value>
+        <description>The address of the scheduler interface.</description>
+      </property>
+
+      <property>
+        <name>fs.defaultFS</name>
+        <value>hdfs://localhost:8020</value>
+        <description>The name of the default file system.  Either the
+          literal string "local" or a host:port for NDFS.</description>
+      </property>
+    -->
+
+</configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/configuration/slider-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/configuration/slider-env.xml b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/configuration/slider-env.xml
new file mode 100644
index 0000000..80c3af1
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/configuration/slider-env.xml
@@ -0,0 +1,43 @@
+<?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>
+  <!-- slider-env.sh -->
+  <property>
+    <name>content</name>
+    <description>This is the jinja template for slider-env.sh file</description>
+    <value>
+# Set Slider-specific environment variables here.
+
+# The only required environment variable is JAVA_HOME.  All others are
+# optional.  When running a distributed configuration it is best to
+# set JAVA_HOME in this file, so that it is correctly defined on
+# remote nodes.
+
+# The java implementation to use.  Required.
+export JAVA_HOME={{java64_home}}
+# The hadoop conf directory.  Optional as slider-client.xml can be edited to add properties.
+export HADOOP_CONF_DIR={{hadoop_conf_dir}}
+    </value>
+  </property>
+  
+</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/configuration/slider-log4j.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/configuration/slider-log4j.xml b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/configuration/slider-log4j.xml
new file mode 100644
index 0000000..709867c
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/configuration/slider-log4j.xml
@@ -0,0 +1,89 @@
+<?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 supports_final="false">
+
+  <property>
+    <name>content</name>
+    <description>Custom log4j.properties</description>
+    <value>
+# 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.
+
+
+# Define some default values that can be overridden by system properties
+log4j.rootLogger=INFO,stdout
+log4j.threshhold=ALL
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+
+# log layout skips stack-trace creation operations by avoiding line numbers and method
+log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601} [%t] %-5p %c{2} - %m%n
+
+# debug edition is much more expensive
+#log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601} [%t] %-5p %c{2} (%F:%M(%L)) - %m%n
+
+
+log4j.appender.subprocess=org.apache.log4j.ConsoleAppender
+log4j.appender.subprocess.layout=org.apache.log4j.PatternLayout
+log4j.appender.subprocess.layout.ConversionPattern=[%c{1}]: %m%n
+#log4j.logger.org.apache.slider.yarn.appmaster.SliderAppMasterer.master=INFO,subprocess
+
+# for debugging Slider
+#log4j.logger.org.apache.slider=DEBUG
+#log4j.logger.org.apache.slider=DEBUG
+
+# uncomment to debug service lifecycle issues
+#log4j.logger.org.apache.hadoop.yarn.service.launcher=DEBUG
+#log4j.logger.org.apache.hadoop.yarn.service=DEBUG
+
+# uncomment for YARN operations
+#log4j.logger.org.apache.hadoop.yarn.client=DEBUG
+
+# uncomment this to debug security problems
+#log4j.logger.org.apache.hadoop.security=DEBUG
+
+#crank back on some noise
+log4j.logger.org.apache.hadoop.util.NativeCodeLoader=ERROR
+log4j.logger.org.apache.hadoop.hdfs=WARN
+
+
+log4j.logger.org.apache.hadoop.yarn.server.nodemanager.containermanager.monitor=WARN
+log4j.logger.org.apache.hadoop.yarn.server.nodemanager.NodeStatusUpdaterImpl=WARN
+log4j.logger.org.apache.zookeeper=WARN
+    </value>
+  </property>
+
+</configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/metainfo.xml b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/metainfo.xml
new file mode 100644
index 0000000..6d7dffe
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/metainfo.xml
@@ -0,0 +1,132 @@
+<?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>SLIDER</name>
+      <displayName>Slider</displayName>
+      <comment>A framework for deploying, managing and monitoring existing distributed applications on YARN.</comment>
+      <version>0.60.0.2.2</version>
+      <components>
+        <component>
+          <name>SLIDER</name>
+          <displayName>Slider</displayName>
+          <category>CLIENT</category>
+          <cardinality>0+</cardinality>
+          <dependencies>
+            <dependency>
+              <name>HDFS/HDFS_CLIENT</name>
+              <scope>host</scope>
+              <auto-deploy>
+                <enabled>true</enabled>
+              </auto-deploy>
+            </dependency>
+            <dependency>
+              <name>YARN/YARN_CLIENT</name>
+              <scope>host</scope>
+              <auto-deploy>
+                <enabled>true</enabled>
+              </auto-deploy>
+            </dependency>
+          </dependencies>
+          <commandScript>
+            <script>scripts/slider_client.py</script>
+            <scriptType>PYTHON</scriptType>
+            <timeout>600</timeout>
+          </commandScript>
+          <configFiles>
+            <configFile>
+              <type>xml</type>
+              <fileName>slider-client.xml</fileName>
+              <dictionaryName>slider-client</dictionaryName>
+            </configFile>
+            <configFile>
+              <type>xml</type>
+              <fileName>core-site.xml</fileName>
+              <dictionaryName>core-site</dictionaryName>
+            </configFile>
+            <configFile>
+              <type>xml</type>
+              <fileName>hdfs-site.xml</fileName>
+              <dictionaryName>hdfs-site</dictionaryName>
+            </configFile>
+            <configFile>
+              <type>xml</type>
+              <fileName>yarn-site.xml</fileName>
+              <dictionaryName>yarn-site</dictionaryName>
+            </configFile>
+            <configFile>
+              <type>env</type>
+              <fileName>slider-env.sh</fileName>
+              <dictionaryName>slider-env</dictionaryName>
+            </configFile>
+            <configFile>
+              <type>env</type>
+              <fileName>log4j.properties</fileName>
+              <dictionaryName>slider-log4j</dictionaryName>
+            </configFile>
+          </configFiles>
+        </component>
+      </components>
+      <osSpecifics>
+        <osSpecific>
+          <osFamily>redhat5,redhat6,suse11</osFamily>
+          <packages>
+            <package>
+              <name>slider_2_2_*</name>
+            </package>
+            <package>
+              <name>storm_2_2_*</name>
+            </package>
+          </packages>
+        </osSpecific>
+        <osSpecific>
+          <osFamily>ubuntu12</osFamily>
+          <packages>
+            <package>
+              <name>slider-2-2-.*</name>
+            </package>
+            <package>
+              <name>storm-2-2-.*</name>
+            </package>
+          </packages>
+        </osSpecific>
+      </osSpecifics>
+
+      <commandScript>
+        <script>scripts/service_check.py</script>
+        <scriptType>PYTHON</scriptType>
+        <timeout>300</timeout>
+      </commandScript>
+
+      <requiredServices>
+        <service>YARN</service>
+        <service>HDFS</service>
+        <service>ZOOKEEPER</service>
+      </requiredServices>
+
+      <configuration-dependencies>
+        <config-type>slider-log4j</config-type>
+        <config-type>slider-client</config-type>
+        <config-type>slider-env</config-type>
+      </configuration-dependencies>
+
+    </service>
+  </services>
+</metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/files/hbaseSmokeVerify.sh
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/files/hbaseSmokeVerify.sh b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/files/hbaseSmokeVerify.sh
new file mode 100644
index 0000000..5c320c0
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/files/hbaseSmokeVerify.sh
@@ -0,0 +1,34 @@
+#!/usr/bin/env bash
+#
+#
+# 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.
+#
+#
+conf_dir=$1
+data=$2
+hbase_cmd=$3
+echo "scan 'ambarismoketest'" | $hbase_cmd --config $conf_dir shell > /tmp/hbase_chk_verify
+cat /tmp/hbase_chk_verify
+echo "Looking for $data"
+grep -q $data /tmp/hbase_chk_verify
+if [ "$?" -ne 0 ]
+then
+  exit 1
+fi
+
+grep -q '1 row(s)' /tmp/hbase_chk_verify

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/__init__.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/__init__.py b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/__init__.py
new file mode 100644
index 0000000..5561e10
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/__init__.py
@@ -0,0 +1,19 @@
+#!/usr/bin/env python
+"""
+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.
+
+"""

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/params.py b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/params.py
new file mode 100644
index 0000000..657feba
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/params.py
@@ -0,0 +1,48 @@
+#!/usr/bin/env python
+"""
+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.
+
+"""
+
+from resource_management.libraries.functions.version import format_hdp_stack_version, compare_versions
+from resource_management import *
+
+# server configurations
+config = Script.get_config()
+
+hdp_stack_version = str(config['hostLevelParams']['stack_version'])
+hdp_stack_version = format_hdp_stack_version(hdp_stack_version)
+
+#hadoop params
+if hdp_stack_version != "" and compare_versions(hdp_stack_version, '2.2') >= 0:
+  slider_bin_dir = '/usr/hdp/current/slider-client/bin'
+else:
+  slider_bin_dir = "/usr/lib/slider/bin"
+
+slider_conf_dir = "/etc/slider/conf"
+hadoop_conf_dir = "/etc/hadoop/conf"
+smokeuser = config['configurations']['cluster-env']['smokeuser']
+security_enabled = config['configurations']['cluster-env']['security_enabled']
+smokeuser_keytab = config['configurations']['cluster-env']['smokeuser_keytab']
+kinit_path_local = functions.get_kinit_path(["/usr/bin", "/usr/kerberos/bin", "/usr/sbin"])
+slider_env_sh_template = config['configurations']['slider-env']['content']
+
+java64_home = config['hostLevelParams']['java_home']
+log4j_props = config['configurations']['slider-log4j']['content']
+slider_cmd = format("{slider_bin_dir}/slider")
+storm_slider_conf_dir= '/usr/hdp/current/storm-slider-client/conf'
+slider_home_dir= '/usr/hdp/current/slider-client'

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/service_check.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/service_check.py b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/service_check.py
new file mode 100644
index 0000000..bb54dc8
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/service_check.py
@@ -0,0 +1,45 @@
+#!/usr/bin/env python
+"""
+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.
+
+"""
+
+from resource_management import *
+
+
+class SliderServiceCheck(Script):
+  def service_check(self, env):
+    import params
+
+    env.set_params(params)
+
+    smokeuser_kinit_cmd = format(
+      "{kinit_path_local} -kt {smokeuser_keytab} {smokeuser};") if params.security_enabled else ""
+
+    servicecheckcmd = format("{smokeuser_kinit_cmd} {slider_cmd} list")
+
+    Execute(servicecheckcmd,
+            tries=3,
+            try_sleep=5,
+            user=params.smokeuser,
+            logoutput=True
+    )
+
+
+if __name__ == "__main__":
+  SliderServiceCheck().execute()
+  

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/slider.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/slider.py b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/slider.py
new file mode 100644
index 0000000..48c534e
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/slider.py
@@ -0,0 +1,62 @@
+"""
+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.
+
+Ambari Agent
+
+"""
+import os
+
+from resource_management import *
+
+
+def slider():
+  import params
+
+  Directory(params.slider_conf_dir,
+            recursive=True
+  )
+
+  slider_client_config = params.config['configurations']['slider-client'] if 'configurations' in params.config and 'slider-client' in params.config['configurations'] else {}
+
+  XmlConfig("slider-client.xml",
+            conf_dir=params.slider_conf_dir,
+            configurations=slider_client_config
+  )
+
+  File(format("{slider_conf_dir}/slider-env.sh"),
+       mode=0755,
+       content=InlineTemplate(params.slider_env_sh_template)
+  )
+
+  Directory(params.storm_slider_conf_dir,
+            recursive=True
+  )
+
+  File(format("{storm_slider_conf_dir}/storm-slider-env.sh"),
+       mode=0755,
+       content=Template('storm-slider-env.sh.j2')
+  )
+
+  if (params.log4j_props != None):
+    File(format("{params.slider_conf_dir}/log4j.properties"),
+         mode=0644,
+         content=params.log4j_props
+    )
+  elif (os.path.exists(format("{params.slider_conf_dir}/log4j.properties"))):
+    File(format("{params.slider_conf_dir}/log4j.properties"),
+         mode=0644
+    )

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/slider_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/slider_client.py b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/slider_client.py
new file mode 100644
index 0000000..cb22a99
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/slider_client.py
@@ -0,0 +1,43 @@
+#!/usr/bin/env python
+"""
+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.
+
+"""
+
+from resource_management import *
+
+from slider import slider
+
+
+class SliderClient(Script):
+  def install(self, env):
+    self.install_packages(env)
+    self.configure(env)
+
+  def configure(self, env):
+    import params
+
+    env.set_params(params)
+
+    slider()
+
+  def status(self, env):
+    raise ClientComponentHasNoStatus()
+
+
+if __name__ == "__main__":
+  SliderClient().execute()

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/templates/storm-slider-env.sh.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/templates/storm-slider-env.sh.j2 b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/templates/storm-slider-env.sh.j2
new file mode 100644
index 0000000..8022a4b
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/templates/storm-slider-env.sh.j2
@@ -0,0 +1,38 @@
+{#
+# 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.
+#}
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#/*
+# * 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.
+# */
+export JAVA_HOME={{java64_home}}
+export SLIDER_HOME={{slider_home_dir}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/alerts.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/alerts.json b/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/alerts.json
deleted file mode 100644
index 6febfd8..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/alerts.json
+++ /dev/null
@@ -1,155 +0,0 @@
-{
-  "AMS": {
-    "service": [
-      {
-        "name": "ams_metric_monitor_process_percent",
-        "label": "Percent AMS Metric Monitors Available",
-        "interval": 1,
-        "scope": "SERVICE",
-        "enabled": true,
-        "source": {
-          "type": "AGGREGATE",
-          "alert_name": "ams_metric_monitor_process",
-          "reporting": {
-            "ok": {
-              "text": "affected: [{1}], total: [{0}]"
-            },
-            "warning": {
-              "text": "affected: [{1}], total: [{0}]",
-              "value": 0.1
-            },
-            "critical": {
-              "text": "affected: [{1}], total: [{0}]",
-              "value": 0.3
-            }
-          }
-        }
-      }
-    ],
-    "METRIC_COLLECTOR": [
-      {
-        "name": "ams_metric_collector_process",
-        "label": "AMS Metric Collector Process",
-        "interval": 1,
-        "scope": "ANY",
-        "enabled": true,
-        "source": {
-          "type": "PORT",
-          "uri": "8188",
-          "default_port": 8188,
-          "reporting": {
-            "ok": {
-              "text": "TCP OK - {0:.3f}s response on port {1}"
-            },
-            "warning": {
-              "text": "TCP OK - {0:.3f}s response on port {1}",
-              "value": 1.5
-            },
-            "critical": {
-              "text": "Connection failed: {0} to {1}:{2}",
-              "value": 5.0
-            }
-          }
-        }
-      },
-      {
-        "name": "ams_metric_collector_hbase_master_process",
-        "label": "AMS Metric Collector HBase Master Process",
-        "interval": 1,
-        "scope": "ANY",
-        "source": {
-          "type": "PORT",
-          "uri": "{{ams-hbase-site/hbase.master.info.port}}",
-          "default_port": 61310,
-          "reporting": {
-            "ok": {
-              "text": "TCP OK - {0:.3f}s response on port {1}"
-            },
-            "warning": {
-              "text": "TCP OK - {0:.3f}s response on port {1}",
-              "value": 1.5
-            },
-            "critical": {
-              "text": "Connection failed: {0} to {1}:{2}",
-              "value": 5.0
-            }
-          }
-        }
-      },
-      {
-        "name": "ams_metric_collector_hbase_master_cpu",
-        "label": "AMS Metric Collector HBase Maser CPU Utilization",
-        "interval": 5,
-        "scope": "ANY",
-        "enabled": true,
-        "source": {
-          "type": "METRIC",
-          "uri": {
-            "http": "{{ams-hbase-site/hbase.master.info.port}}",
-            "https": "{{ams-hbase-site/hbase.master.info.port}}",
-            "https_property": "{{cluster-env/security_enabled}}",
-            "https_property_value": "true",
-            "default_port": 61310
-          },
-          "reporting": {
-            "ok": {
-              "text": "{1} CPU, load {0:.1%}"
-            },
-            "warning": {
-              "text": "{1} CPU, load {0:.1%}",
-              "value": 200
-            },
-            "critical": {
-              "text": "{1} CPU, load {0:.1%}",
-              "value": 250
-            },
-            "units" : "%"
-          },
-          "jmx": {
-            "property_list": [
-              "java.lang:type=OperatingSystem/SystemCpuLoad",
-              "java.lang:type=OperatingSystem/AvailableProcessors"
-            ],
-            "value": "{0} * 100"
-          }
-        }
-      },
-      {
-        "name": "ams_metric_collector_zookeeper_server_process",
-        "label": "AMS Metric Collector ZooKeeper Server Process",
-        "interval": 1,
-        "scope": "ANY",
-        "source": {
-          "type": "PORT",
-          "uri": "{{ams-hbase-site/hbase.zookeeper.property.clientPort}}",
-          "default_port": 61181,
-          "reporting": {
-            "ok": {
-              "text": "TCP OK - {0:.3f}s response on port {1}"
-            },
-            "warning": {
-              "text": "TCP OK - {0:.3f}s response on port {1}",
-              "value": 1.5
-            },
-            "critical": {
-              "text": "Connection failed: {0} to {1}:{2}",
-              "value": 5.0
-            }
-          }
-        }
-      }
-    ],
-    "METRIC_MONITOR": [
-      {
-        "name": "ams_metric_monitor_process",
-        "label": "AMS Metric Monitor Status",
-        "interval": 1,
-        "scope": "ANY",
-        "source": {
-          "type": "SCRIPT",
-          "path": "HDP/2.2/services/AMS/package/files/alert_ambari_metrics_monitor.py"
-        }
-      }
-    ]
-  }
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7fe6b5/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/configuration/ams-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/configuration/ams-env.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/configuration/ams-env.xml
deleted file mode 100644
index fda1df0..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/AMS/configuration/ams-env.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?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>ams_user</name>
-    <value>root</value>
-    <property-type>USER</property-type>
-    <description>AMS User Name.</description>
-  </property>
-
-  <property>
-    <name>content</name>
-    <value>
-      # Set environment variables here.
-
-      # The java implementation to use. Java 1.6 required.
-      export JAVA_HOME={{java64_home}}
-
-      #TODO
-    </value>
-  </property>
-
-</configuration>