You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ao...@apache.org on 2015/01/23 14:12:25 UTC

[1/5] ambari git commit: AMBARI-9296. Service versions do not need stack maj.min appended any longer (aonishuk)

Repository: ambari
Updated Branches:
  refs/heads/trunk 69bc4f02a -> fddf04318


http://git-wip-us.apache.org/repos/asf/ambari/blob/fddf0431/ambari-server/src/main/resources/stacks/HDP/2.2/services/ZOOKEEPER/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/ZOOKEEPER/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/ZOOKEEPER/metainfo.xml
index b503081..883a307 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/ZOOKEEPER/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/ZOOKEEPER/metainfo.xml
@@ -21,7 +21,7 @@
     <service>
       <name>ZOOKEEPER</name>
       <displayName>ZooKeeper</displayName>
-      <version>3.4.6.2.2</version>
+      <version>3.4.6</version>
       <osSpecifics>
         <osSpecific>
           <osFamily>redhat5,redhat6,suse11</osFamily>


[2/5] ambari git commit: AMBARI-9296. Service versions do not need stack maj.min appended any longer (aonishuk)

Posted by ao...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/fddf0431/ambari-server/src/main/resources/common-services/KNOX/0.5.0/package/scripts/setup_ranger_knox.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KNOX/0.5.0/package/scripts/setup_ranger_knox.py b/ambari-server/src/main/resources/common-services/KNOX/0.5.0/package/scripts/setup_ranger_knox.py
new file mode 100644
index 0000000..76185a8
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KNOX/0.5.0/package/scripts/setup_ranger_knox.py
@@ -0,0 +1,183 @@
+#!/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
+import fileinput
+import subprocess
+import json
+import re
+from resource_management import *
+from resource_management.libraries.functions.ranger_functions import Rangeradmin
+from resource_management.core.logger import Logger
+
+def setup_ranger_knox(env):
+    import params
+    env.set_params(params)
+
+    if params.has_ranger_admin:
+        try:
+            command = 'hdp-select status knox-server'
+            return_code, hdp_output = shell.call(command, timeout=20)
+        except Exception, e:
+            Logger.error(str(e))
+            raise Fail('Unable to execute hdp-select command to retrieve the version.')
+
+        if return_code != 0:
+            raise Fail('Unable to determine the current version because of a non-zero return code of {0}'.format(str(return_code)))
+
+        hdp_version = re.sub('knox-server - ', '', hdp_output)
+        match = re.match('[0-9]+.[0-9]+.[0-9]+.[0-9]+-[0-9]+', hdp_version)
+
+        if match is None:
+            raise Fail('Failed to get extracted version')
+
+        file_path = '/usr/hdp/'+ hdp_version +'/ranger-knox-plugin/install.properties'
+
+        ranger_knox_dict = ranger_knox_properties(params)
+        knox_repo_data = knox_repo_properties(params)       
+
+        write_properties_to_file(file_path, ranger_knox_dict)
+
+        if params.enable_ranger_knox:
+            cmd = format('cd /usr/hdp/{hdp_version}/ranger-knox-plugin/ && sh enable-knox-plugin.sh')
+            ranger_adm_obj = Rangeradmin(url=ranger_knox_dict['POLICY_MGR_URL'])
+            response_code, response_recieved = ranger_adm_obj.check_ranger_login_urllib2(ranger_knox_dict['POLICY_MGR_URL'] + '/login.jsp', 'test:test')
+
+            if response_code is not None and response_code == 200:
+                repo = ranger_adm_obj.get_repository_by_name_urllib2(ranger_knox_dict['REPOSITORY_NAME'], 'knox', 'true', 'admin:admin')
+
+                if repo and repo['name'] == ranger_knox_dict['REPOSITORY_NAME']:
+                    Logger.info('Knox Repository exist')
+                else:
+                    response = ranger_adm_obj.create_repository_urllib2(knox_repo_data, 'admin:admin')
+                    if response is not None:
+                        Logger.info('Knox Repository created in Ranger Admin')
+                    else:
+                        Logger.info('Knox Repository creation failed in Ranger Admin')
+            else:
+                Logger.info('Ranger service is not started on given host')
+        else:
+            cmd = format('cd /usr/hdp/{hdp_version}/ranger-knox-plugin/ && sh disable-knox-plugin.sh')
+
+        Execute(cmd, environment={'JAVA_HOME': params.java_home}, logoutput=True)
+    else:
+        Logger.info('Ranger admin not installed') 
+
+
+def write_properties_to_file(file_path, value):
+    for key in value:
+      modify_config(file_path, key, value[key])
+
+
+def modify_config(filepath, variable, setting):
+    var_found = False
+    already_set = False
+    V=str(variable)
+    S=str(setting)
+    # use quotes if setting has spaces #
+    if ' ' in S:
+        S = '%s' % S
+
+    for line in fileinput.input(filepath, inplace = 1):
+        # process lines that look like config settings #
+        if not line.lstrip(' ').startswith('#') and '=' in line:
+            _infile_var = str(line.split('=')[0].rstrip(' '))
+            _infile_set = str(line.split('=')[1].lstrip(' ').rstrip())
+            # only change the first matching occurrence #
+            if var_found == False and _infile_var.rstrip(' ') == V:
+                var_found = True
+                # don't change it if it is already set #
+                if _infile_set.lstrip(' ') == S:
+                    already_set = True
+                else:
+                    line = "%s=%s\n" % (V, S)
+
+        sys.stdout.write(line)
+
+    # Append the variable if it wasn't found #
+    if not var_found:
+        with open(filepath, "a") as f:
+            f.write("%s=%s\n" % (V, S))
+    elif already_set == True:
+        pass
+    else:
+        pass
+
+    return
+
+def ranger_knox_properties(params):
+    ranger_knox_properties = dict()
+
+    ranger_knox_properties['POLICY_MGR_URL']           = params.config['configurations']['admin-properties']['policymgr_external_url']
+    ranger_knox_properties['SQL_CONNECTOR_JAR']        = params.config['configurations']['admin-properties']['SQL_CONNECTOR_JAR']
+    ranger_knox_properties['XAAUDIT.DB.FLAVOUR']       = params.config['configurations']['admin-properties']['DB_FLAVOR']
+    ranger_knox_properties['XAAUDIT.DB.DATABASE_NAME'] = params.config['configurations']['admin-properties']['audit_db_name']
+    ranger_knox_properties['XAAUDIT.DB.USER_NAME']     = params.config['configurations']['admin-properties']['audit_db_user']
+    ranger_knox_properties['XAAUDIT.DB.PASSWORD']      = params.config['configurations']['admin-properties']['audit_db_password']
+    ranger_knox_properties['XAAUDIT.DB.HOSTNAME']      = params.config['configurations']['admin-properties']['db_host']
+    ranger_knox_properties['REPOSITORY_NAME']          = params.config['clusterName'] + '_knox'
+
+    ranger_knox_properties['KNOX_HOME'] = params.config['configurations']['ranger-knox-plugin-properties']['KNOX_HOME']
+
+    ranger_knox_properties['XAAUDIT.DB.IS_ENABLED']   = params.config['configurations']['ranger-knox-plugin-properties']['XAAUDIT.DB.IS_ENABLED']
+
+    ranger_knox_properties['XAAUDIT.HDFS.IS_ENABLED'] = params.config['configurations']['ranger-knox-plugin-properties']['XAAUDIT.HDFS.IS_ENABLED']
+    ranger_knox_properties['XAAUDIT.HDFS.DESTINATION_DIRECTORY'] = params.config['configurations']['ranger-knox-plugin-properties']['XAAUDIT.HDFS.DESTINATION_DIRECTORY']
+    ranger_knox_properties['XAAUDIT.HDFS.LOCAL_BUFFER_DIRECTORY'] = params.config['configurations']['ranger-knox-plugin-properties']['XAAUDIT.HDFS.LOCAL_BUFFER_DIRECTORY']
+    ranger_knox_properties['XAAUDIT.HDFS.LOCAL_ARCHIVE_DIRECTORY'] = params.config['configurations']['ranger-knox-plugin-properties']['XAAUDIT.HDFS.LOCAL_ARCHIVE_DIRECTORY']
+    ranger_knox_properties['XAAUDIT.HDFS.DESTINTATION_FILE'] = params.config['configurations']['ranger-knox-plugin-properties']['XAAUDIT.HDFS.DESTINTATION_FILE']
+    ranger_knox_properties['XAAUDIT.HDFS.DESTINTATION_FLUSH_INTERVAL_SECONDS'] = params.config['configurations']['ranger-knox-plugin-properties']['XAAUDIT.HDFS.DESTINTATION_FLUSH_INTERVAL_SECONDS']
+    ranger_knox_properties['XAAUDIT.HDFS.DESTINTATION_ROLLOVER_INTERVAL_SECONDS'] = params.config['configurations']['ranger-knox-plugin-properties']['XAAUDIT.HDFS.DESTINTATION_ROLLOVER_INTERVAL_SECONDS']
+    ranger_knox_properties['XAAUDIT.HDFS.DESTINTATION_OPEN_RETRY_INTERVAL_SECONDS'] = params.config['configurations']['ranger-knox-plugin-properties']['XAAUDIT.HDFS.DESTINTATION_OPEN_RETRY_INTERVAL_SECONDS']
+    ranger_knox_properties['XAAUDIT.HDFS.LOCAL_BUFFER_FILE'] = params.config['configurations']['ranger-knox-plugin-properties']['XAAUDIT.HDFS.LOCAL_BUFFER_FILE']
+    ranger_knox_properties['XAAUDIT.HDFS.LOCAL_BUFFER_FLUSH_INTERVAL_SECONDS'] = params.config['configurations']['ranger-knox-plugin-properties']['XAAUDIT.HDFS.LOCAL_BUFFER_FLUSH_INTERVAL_SECONDS']
+    ranger_knox_properties['XAAUDIT.HDFS.LOCAL_BUFFER_ROLLOVER_INTERVAL_SECONDS'] = params.config['configurations']['ranger-knox-plugin-properties']['XAAUDIT.HDFS.LOCAL_BUFFER_ROLLOVER_INTERVAL_SECONDS']
+    ranger_knox_properties['XAAUDIT.HDFS.LOCAL_ARCHIVE_MAX_FILE_COUNT'] = params.config['configurations']['ranger-knox-plugin-properties']['XAAUDIT.HDFS.LOCAL_ARCHIVE_MAX_FILE_COUNT']
+    
+
+    ranger_knox_properties['SSL_KEYSTORE_FILE_PATH'] = params.config['configurations']['ranger-knox-plugin-properties']['SSL_KEYSTORE_FILE_PATH']
+    ranger_knox_properties['SSL_KEYSTORE_PASSWORD'] = params.config['configurations']['ranger-knox-plugin-properties']['SSL_KEYSTORE_PASSWORD']
+    ranger_knox_properties['SSL_TRUSTSTORE_FILE_PATH'] = params.config['configurations']['ranger-knox-plugin-properties']['SSL_TRUSTSTORE_FILE_PATH']
+    ranger_knox_properties['SSL_TRUSTSTORE_PASSWORD'] = params.config['configurations']['ranger-knox-plugin-properties']['SSL_TRUSTSTORE_PASSWORD']
+    
+
+    return ranger_knox_properties    
+
+def knox_repo_properties(params):
+
+    knoxHost = params.config['clusterHostInfo']['knox_gateway_hosts'][0]
+    knoxPort = params.config['configurations']['gateway-site']['gateway.port']
+
+    config_dict = dict()
+    config_dict['username'] = params.config['configurations']['ranger-knox-plugin-properties']['REPOSITORY_CONFIG_USERNAME']
+    config_dict['password'] = params.config['configurations']['ranger-knox-plugin-properties']['REPOSITORY_CONFIG_USERNAME']
+    config_dict['knox.url'] = 'https://' + knoxHost + ':' + str(knoxPort) +'/gateway/admin/api/v1/topologies'
+    config_dict['commonNameForCertificate'] = params.config['configurations']['ranger-knox-plugin-properties']['common.name.for.certificate']
+
+    repo= dict()
+    repo['isActive']                = "true"
+    repo['config']                  = json.dumps(config_dict)
+    repo['description']             = "knox repo"
+    repo['name']                    = params.config['clusterName'] + "_knox"
+    repo['repositoryType']          = "Knox"
+    repo['assetType']               = '5'
+
+    data = json.dumps(repo)
+
+    return data

http://git-wip-us.apache.org/repos/asf/ambari/blob/fddf0431/ambari-server/src/main/resources/common-services/KNOX/0.5.0/package/scripts/status_params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KNOX/0.5.0/package/scripts/status_params.py b/ambari-server/src/main/resources/common-services/KNOX/0.5.0/package/scripts/status_params.py
new file mode 100644
index 0000000..1bf7427
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KNOX/0.5.0/package/scripts/status_params.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.
+
+"""
+
+from resource_management import *
+
+config = Script.get_config()
+
+knox_conf_dir = '/etc/knox/conf'
+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")
+
+security_enabled = config['configurations']['cluster-env']['security_enabled']
+if security_enabled:
+    knox_keytab_path = config['configurations']['knox-env']['knox_keytab_path']
+    knox_principal_name = config['configurations']['knox-env']['knox_principal_name']
+else:
+    knox_keytab_path = None
+    knox_principal_name = None
+hostname = config['hostname'].lower()
+knox_user = default("/configurations/knox-env/knox_user", "knox")
+kinit_path_local = functions.get_kinit_path(["/usr/bin", "/usr/kerberos/bin", "/usr/sbin"])
+temp_dir = Script.get_tmp_dir()

http://git-wip-us.apache.org/repos/asf/ambari/blob/fddf0431/ambari-server/src/main/resources/common-services/KNOX/0.5.0/package/scripts/upgrade.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KNOX/0.5.0/package/scripts/upgrade.py b/ambari-server/src/main/resources/common-services/KNOX/0.5.0/package/scripts/upgrade.py
new file mode 100644
index 0000000..9976cb2
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KNOX/0.5.0/package/scripts/upgrade.py
@@ -0,0 +1,71 @@
+
+#!/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 tarfile
+import tempfile
+
+from resource_management.core.logger import Logger
+from resource_management.core.exceptions import Fail
+
+BACKUP_TEMP_DIR = "knox-upgrade-backup"
+BACKUP_DATA_ARCHIVE = "knox-data-backup.tar"
+BACKUP_CONF_ARCHIVE = "knox-conf-backup.tar"
+
+def backup_data():
+  """
+  Backs up the knox data as part of the upgrade process.
+  :return:
+  """
+  Logger.info('Backing up Knox data directory before upgrade...')
+  directoryMappings = _get_directory_mappings()
+
+  absolute_backup_dir = os.path.join(tempfile.gettempdir(), BACKUP_TEMP_DIR)
+  if not os.path.isdir(absolute_backup_dir):
+    os.makedirs(absolute_backup_dir)
+
+  for directory in directoryMappings:
+    if not os.path.isdir(directory):
+      raise Fail("Unable to backup missing directory {0}".format(directory))
+
+    archive = os.path.join(absolute_backup_dir, directoryMappings[directory])
+    Logger.info('Compressing {0} to {1}'.format(directory, archive))
+
+    if os.path.exists(archive):
+      os.remove(archive)
+
+    tarball = None
+    try:
+      tarball = tarfile.open(archive, "w")
+      tarball.add(directory, arcname=os.path.basename(directory))
+    finally:
+      if tarball:
+        tarball.close()
+
+def _get_directory_mappings():
+  """
+  Gets a dictionary of directory to archive name that represents the
+  directories that need to be backed up and their output tarball archive targets
+  :return:  the dictionary of directory to tarball mappings
+  """
+  import params
+
+  return { params.knox_data_dir : BACKUP_DATA_ARCHIVE, params.knox_conf_dir : BACKUP_CONF_ARCHIVE }
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/fddf0431/ambari-server/src/main/resources/common-services/KNOX/0.5.0/package/templates/krb5JAASLogin.conf.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KNOX/0.5.0/package/templates/krb5JAASLogin.conf.j2 b/ambari-server/src/main/resources/common-services/KNOX/0.5.0/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/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/fddf0431/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
deleted file mode 100644
index fdeceae..0000000
--- a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/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/fddf0431/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
deleted file mode 100644
index 80c3af1..0000000
--- a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/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/fddf0431/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
deleted file mode 100644
index 709867c..0000000
--- a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/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/fddf0431/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
deleted file mode 100644
index 1c6fb75..0000000
--- a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/metainfo.xml
+++ /dev/null
@@ -1,132 +0,0 @@
-<?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>1200</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/fddf0431/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
deleted file mode 100644
index 5c320c0..0000000
--- a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/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/fddf0431/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
deleted file mode 100644
index 5561e10..0000000
--- a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/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/fddf0431/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
deleted file mode 100644
index fbb1973..0000000
--- a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/params.py
+++ /dev/null
@@ -1,55 +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.libraries.functions.default import default
-from resource_management import *
-
-# server configurations
-config = Script.get_config()
-
-stack_name = default("/hostLevelParams/stack_name", None)
-
-# New Cluster Stack Version that is defined during the RESTART of a Rolling Upgrade
-version = default("/commandParams/version", None)
-
-stack_version_unformatted = str(config['hostLevelParams']['stack_version'])
-hdp_stack_version = format_hdp_stack_version(stack_version_unformatted)
-
-#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']
-smokeuser_principal = config['configurations']['cluster-env']['smokeuser_principal_name']
-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/fddf0431/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
deleted file mode 100644
index af085b8..0000000
--- a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/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_principal};") 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/fddf0431/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
deleted file mode 100644
index 48c534e..0000000
--- a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/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/fddf0431/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
deleted file mode 100644
index 2c99c54..0000000
--- a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/slider_client.py
+++ /dev/null
@@ -1,59 +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 get_stack_to_component(self):
-    return {"HDP": "slider-client"}
-
-  def pre_rolling_restart(self, env):
-    import params
-    env.set_params(params)
-
-    if params.version and compare_versions(format_hdp_stack_version(params.version), '2.2.0.0') >= 0:
-      Execute(format("hdp-select set slider-client {version}"))
-
-      # also set all of the hadoop clients since slider client is upgraded as
-      # part of the final "CLIENTS" group and we need to ensure that
-      # hadoop-client is also set
-      Execute(format("hdp-select set hadoop-client {version}"))
-
-  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/fddf0431/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
deleted file mode 100644
index 8022a4b..0000000
--- a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/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/fddf0431/ambari-server/src/main/resources/common-services/SLIDER/0.60.0/configuration/slider-client.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0/configuration/slider-client.xml b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0/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/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/fddf0431/ambari-server/src/main/resources/common-services/SLIDER/0.60.0/configuration/slider-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0/configuration/slider-env.xml b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0/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/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/fddf0431/ambari-server/src/main/resources/common-services/SLIDER/0.60.0/configuration/slider-log4j.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0/configuration/slider-log4j.xml b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0/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/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/fddf0431/ambari-server/src/main/resources/common-services/SLIDER/0.60.0/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0/metainfo.xml b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0/metainfo.xml
new file mode 100644
index 0000000..537d594
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0/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</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>1200</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/fddf0431/ambari-server/src/main/resources/common-services/SLIDER/0.60.0/package/files/hbaseSmokeVerify.sh
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0/package/files/hbaseSmokeVerify.sh b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0/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/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/fddf0431/ambari-server/src/main/resources/common-services/SLIDER/0.60.0/package/scripts/__init__.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0/package/scripts/__init__.py b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0/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/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/fddf0431/ambari-server/src/main/resources/common-services/SLIDER/0.60.0/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0/package/scripts/params.py b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0/package/scripts/params.py
new file mode 100644
index 0000000..fbb1973
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0/package/scripts/params.py
@@ -0,0 +1,55 @@
+#!/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.libraries.functions.default import default
+from resource_management import *
+
+# server configurations
+config = Script.get_config()
+
+stack_name = default("/hostLevelParams/stack_name", None)
+
+# New Cluster Stack Version that is defined during the RESTART of a Rolling Upgrade
+version = default("/commandParams/version", None)
+
+stack_version_unformatted = str(config['hostLevelParams']['stack_version'])
+hdp_stack_version = format_hdp_stack_version(stack_version_unformatted)
+
+#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']
+smokeuser_principal = config['configurations']['cluster-env']['smokeuser_principal_name']
+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/fddf0431/ambari-server/src/main/resources/common-services/SLIDER/0.60.0/package/scripts/service_check.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0/package/scripts/service_check.py b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0/package/scripts/service_check.py
new file mode 100644
index 0000000..af085b8
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0/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_principal};") 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/fddf0431/ambari-server/src/main/resources/common-services/SLIDER/0.60.0/package/scripts/slider.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0/package/scripts/slider.py b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0/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/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/fddf0431/ambari-server/src/main/resources/common-services/SLIDER/0.60.0/package/scripts/slider_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0/package/scripts/slider_client.py b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0/package/scripts/slider_client.py
new file mode 100644
index 0000000..2c99c54
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0/package/scripts/slider_client.py
@@ -0,0 +1,59 @@
+#!/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 get_stack_to_component(self):
+    return {"HDP": "slider-client"}
+
+  def pre_rolling_restart(self, env):
+    import params
+    env.set_params(params)
+
+    if params.version and compare_versions(format_hdp_stack_version(params.version), '2.2.0.0') >= 0:
+      Execute(format("hdp-select set slider-client {version}"))
+
+      # also set all of the hadoop clients since slider client is upgraded as
+      # part of the final "CLIENTS" group and we need to ensure that
+      # hadoop-client is also set
+      Execute(format("hdp-select set hadoop-client {version}"))
+
+  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/fddf0431/ambari-server/src/main/resources/common-services/SLIDER/0.60.0/package/templates/storm-slider-env.sh.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0/package/templates/storm-slider-env.sh.j2 b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0/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/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/fddf0431/ambari-server/src/main/resources/stacks/HDP/2.2/services/FALCON/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/FALCON/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/FALCON/metainfo.xml
index fe41949..d783e88 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/FALCON/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/FALCON/metainfo.xml
@@ -21,7 +21,7 @@
     <service>
       <name>FALCON</name>
       <displayName>Falcon</displayName>
-      <version>0.6.0.2.2</version>
+      <version>0.6.0</version>
       <osSpecifics>
         <osSpecific>
           <osFamily>redhat5,redhat6,suse11</osFamily>

http://git-wip-us.apache.org/repos/asf/ambari/blob/fddf0431/ambari-server/src/main/resources/stacks/HDP/2.2/services/FLUME/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/FLUME/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/FLUME/metainfo.xml
index 77afa94..f58008d 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/FLUME/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/FLUME/metainfo.xml
@@ -21,7 +21,7 @@
     <service>
       <name>FLUME</name>
       <displayName>Flume</displayName>
-      <version>1.5.2.2.2</version>
+      <version>1.5.2</version>
 
       <osSpecifics>
         <osSpecific>

http://git-wip-us.apache.org/repos/asf/ambari/blob/fddf0431/ambari-server/src/main/resources/stacks/HDP/2.2/services/HBASE/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HBASE/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HBASE/metainfo.xml
index 8918adb..62e3fe8 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HBASE/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HBASE/metainfo.xml
@@ -21,7 +21,7 @@
     <service>
       <name>HBASE</name>
       <displayName>HBase</displayName>
-      <version>0.98.4.2.2</version>
+      <version>0.98.4</version>
 
       <osSpecifics>
         <osSpecific>

http://git-wip-us.apache.org/repos/asf/ambari/blob/fddf0431/ambari-server/src/main/resources/stacks/HDP/2.2/services/HDFS/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HDFS/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HDFS/metainfo.xml
index a6dc0b9..75d67ce 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HDFS/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HDFS/metainfo.xml
@@ -21,7 +21,7 @@
     <service>
       <name>HDFS</name>
       <displayName>HDFS</displayName>
-      <version>2.6.0.2.2</version>
+      <version>2.6.0</version>
 
       <osSpecifics>
         <osSpecific>

http://git-wip-us.apache.org/repos/asf/ambari/blob/fddf0431/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/metainfo.xml
index 9831195..577605b 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/metainfo.xml
@@ -20,7 +20,7 @@
   <services>
     <service>
       <name>HIVE</name>
-      <version>0.14.0.2.2</version>
+      <version>0.14.0</version>
       <components>
         <component>
             <name>HIVE_METASTORE</name>

http://git-wip-us.apache.org/repos/asf/ambari/blob/fddf0431/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 24e4ac8..8045a6d 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,7 +20,7 @@
   <services>
     <service>
       <name>KAFKA</name>
-      <extends>common-services/KAFKA/0.8.1.2.2</extends>
+      <extends>common-services/KAFKA/0.8.1</extends>
     </service>
   </services>
 </metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/fddf0431/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 e3adf17..7b9e05f 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,7 +20,7 @@
   <services>
     <service>
       <name>KNOX</name>
-      <extends>common-services/KNOX/0.5.0.2.2</extends>
+      <extends>common-services/KNOX/0.5.0</extends>
     </service>
   </services>
 </metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/fddf0431/ambari-server/src/main/resources/stacks/HDP/2.2/services/OOZIE/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/OOZIE/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/OOZIE/metainfo.xml
index 53a88d4..d4c5ed7 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/OOZIE/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/OOZIE/metainfo.xml
@@ -20,7 +20,7 @@
   <services>
     <service>
       <name>OOZIE</name>
-      <version>4.1.0.2.2</version>
+      <version>4.1.0</version>
       <components>
         <component>
             <name>OOZIE_SERVER</name>

http://git-wip-us.apache.org/repos/asf/ambari/blob/fddf0431/ambari-server/src/main/resources/stacks/HDP/2.2/services/PIG/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/PIG/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/PIG/metainfo.xml
index 72e1b4d..4e5a5e3 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/PIG/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/PIG/metainfo.xml
@@ -21,7 +21,7 @@
     <service>
       <name>PIG</name>
       <displayName>Pig</displayName>
-      <version>0.14.0.2.2</version>
+      <version>0.14.0</version>
       <osSpecifics>
         <osSpecific>
           <osFamily>redhat5,redhat6,suse11</osFamily>

http://git-wip-us.apache.org/repos/asf/ambari/blob/fddf0431/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 d0e1346..e8eca42 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,7 +20,7 @@
   <services>
     <service>
       <name>SLIDER</name>
-      <extends>common-services/SLIDER/0.60.0.2.2</extends>
+      <extends>common-services/SLIDER/0.60.0</extends>
     </service>
   </services>
 </metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/fddf0431/ambari-server/src/main/resources/stacks/HDP/2.2/services/SQOOP/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/SQOOP/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/SQOOP/metainfo.xml
index b81a5a2..a915d03 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/SQOOP/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/SQOOP/metainfo.xml
@@ -20,7 +20,7 @@
   <services>
     <service>
       <name>SQOOP</name>
-      <version>1.4.5.2.2</version>
+      <version>1.4.5</version>
       <osSpecifics>
         <osSpecific>
           <osFamily>any</osFamily>

http://git-wip-us.apache.org/repos/asf/ambari/blob/fddf0431/ambari-server/src/main/resources/stacks/HDP/2.2/services/STORM/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/STORM/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/STORM/metainfo.xml
index c86c0fd..09d817e 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/STORM/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/STORM/metainfo.xml
@@ -22,7 +22,7 @@
     <service>
       <name>STORM</name>
       <displayName>Storm</displayName>
-      <version>0.9.3.2.2</version>
+      <version>0.9.3</version>
       <components>
         <component>
           <name>STORM_REST_API</name>

http://git-wip-us.apache.org/repos/asf/ambari/blob/fddf0431/ambari-server/src/main/resources/stacks/HDP/2.2/services/TEZ/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/TEZ/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/TEZ/metainfo.xml
index dd24383..41fcb7e 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/TEZ/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/TEZ/metainfo.xml
@@ -21,7 +21,7 @@
     <service>
       <name>TEZ</name>
       <displayName>Tez</displayName>
-      <version>0.5.2.2.2</version>
+      <version>0.5.2</version>
 
       <osSpecifics>
         <osSpecific>

http://git-wip-us.apache.org/repos/asf/ambari/blob/fddf0431/ambari-server/src/main/resources/stacks/HDP/2.2/services/YARN/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/YARN/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/YARN/metainfo.xml
index a8fc6ea..ce8018c 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/YARN/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/YARN/metainfo.xml
@@ -22,7 +22,7 @@
     <service>
       <name>YARN</name>
       <displayName>YARN</displayName>
-      <version>2.6.0.2.2</version>
+      <version>2.6.0</version>
       <components>
         <component>
           <name>APP_TIMELINE_SERVER</name>
@@ -62,7 +62,7 @@
     <service>
       <name>MAPREDUCE2</name>
       <displayName>MapReduce2</displayName>
-      <version>2.6.0.2.2</version>
+      <version>2.6.0</version>
       <osSpecifics>
         <osSpecific>
           <osFamily>redhat5,redhat6,suse11</osFamily>


[3/5] ambari git commit: AMBARI-9296. Service versions do not need stack maj.min appended any longer (aonishuk)

Posted by ao...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/fddf0431/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
deleted file mode 100644
index 28fabe5..0000000
--- a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/params.py
+++ /dev/null
@@ -1,161 +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.libraries.functions.default import default
-from resource_management import *
-import status_params
-
-config = Script.get_config()
-tmp_dir = Script.get_tmp_dir()
-
-stack_name = default("/hostLevelParams/stack_name", None)
-
-version = default("/commandParams/version", None)
-
-stack_version_unformatted = str(config['hostLevelParams']['stack_version'])
-hdp_stack_version = format_hdp_stack_version(stack_version_unformatted)
-
-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'
-  knox_data_dir = '/usr/hdp/current/knox-server/data'
-  knox_conf_dir = '/usr/hdp/current/knox-server/conf'
-else:
-  knox_bin = '/usr/bin/gateway'
-  ldap_bin = '/usr/lib/knox/bin/ldap.sh'
-  knox_client_bin = '/usr/lib/knox/bin/knoxcli.sh'
-  knox_data_dir = '/usr/lib/knox/data'
-  knox_conf_dir = '/usr/lib/knox/conf'
-
-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']
-smokeuser_principal = config['configurations']['cluster-env']['smokeuser_principal_name']
-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)
-
-# ranger host
-ranger_admin_hosts = default("/clusterHostInfo/ranger_admin_hosts", [])
-has_ranger_admin = not len(ranger_admin_hosts) == 0
-
-if hdp_stack_version != "" and compare_versions(hdp_stack_version, '2.2') >= 0:
-    # Setting Flag value for ranger hbase plugin
-    enable_ranger_knox = False
-    user_input = config['configurations']['ranger-knox-plugin-properties']['ranger-knox-plugin-enabled']
-    if user_input.lower() == 'yes':
-      enable_ranger_knox = True
-    elif user_input.lower() == 'no':
-      enable_ranger_knox = False
-      
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/fddf0431/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
deleted file mode 100644
index e05262f..0000000
--- a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/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_principal};")
-          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/fddf0431/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/setup_ranger_knox.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/setup_ranger_knox.py b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/setup_ranger_knox.py
deleted file mode 100644
index 76185a8..0000000
--- a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/setup_ranger_knox.py
+++ /dev/null
@@ -1,183 +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
-import fileinput
-import subprocess
-import json
-import re
-from resource_management import *
-from resource_management.libraries.functions.ranger_functions import Rangeradmin
-from resource_management.core.logger import Logger
-
-def setup_ranger_knox(env):
-    import params
-    env.set_params(params)
-
-    if params.has_ranger_admin:
-        try:
-            command = 'hdp-select status knox-server'
-            return_code, hdp_output = shell.call(command, timeout=20)
-        except Exception, e:
-            Logger.error(str(e))
-            raise Fail('Unable to execute hdp-select command to retrieve the version.')
-
-        if return_code != 0:
-            raise Fail('Unable to determine the current version because of a non-zero return code of {0}'.format(str(return_code)))
-
-        hdp_version = re.sub('knox-server - ', '', hdp_output)
-        match = re.match('[0-9]+.[0-9]+.[0-9]+.[0-9]+-[0-9]+', hdp_version)
-
-        if match is None:
-            raise Fail('Failed to get extracted version')
-
-        file_path = '/usr/hdp/'+ hdp_version +'/ranger-knox-plugin/install.properties'
-
-        ranger_knox_dict = ranger_knox_properties(params)
-        knox_repo_data = knox_repo_properties(params)       
-
-        write_properties_to_file(file_path, ranger_knox_dict)
-
-        if params.enable_ranger_knox:
-            cmd = format('cd /usr/hdp/{hdp_version}/ranger-knox-plugin/ && sh enable-knox-plugin.sh')
-            ranger_adm_obj = Rangeradmin(url=ranger_knox_dict['POLICY_MGR_URL'])
-            response_code, response_recieved = ranger_adm_obj.check_ranger_login_urllib2(ranger_knox_dict['POLICY_MGR_URL'] + '/login.jsp', 'test:test')
-
-            if response_code is not None and response_code == 200:
-                repo = ranger_adm_obj.get_repository_by_name_urllib2(ranger_knox_dict['REPOSITORY_NAME'], 'knox', 'true', 'admin:admin')
-
-                if repo and repo['name'] == ranger_knox_dict['REPOSITORY_NAME']:
-                    Logger.info('Knox Repository exist')
-                else:
-                    response = ranger_adm_obj.create_repository_urllib2(knox_repo_data, 'admin:admin')
-                    if response is not None:
-                        Logger.info('Knox Repository created in Ranger Admin')
-                    else:
-                        Logger.info('Knox Repository creation failed in Ranger Admin')
-            else:
-                Logger.info('Ranger service is not started on given host')
-        else:
-            cmd = format('cd /usr/hdp/{hdp_version}/ranger-knox-plugin/ && sh disable-knox-plugin.sh')
-
-        Execute(cmd, environment={'JAVA_HOME': params.java_home}, logoutput=True)
-    else:
-        Logger.info('Ranger admin not installed') 
-
-
-def write_properties_to_file(file_path, value):
-    for key in value:
-      modify_config(file_path, key, value[key])
-
-
-def modify_config(filepath, variable, setting):
-    var_found = False
-    already_set = False
-    V=str(variable)
-    S=str(setting)
-    # use quotes if setting has spaces #
-    if ' ' in S:
-        S = '%s' % S
-
-    for line in fileinput.input(filepath, inplace = 1):
-        # process lines that look like config settings #
-        if not line.lstrip(' ').startswith('#') and '=' in line:
-            _infile_var = str(line.split('=')[0].rstrip(' '))
-            _infile_set = str(line.split('=')[1].lstrip(' ').rstrip())
-            # only change the first matching occurrence #
-            if var_found == False and _infile_var.rstrip(' ') == V:
-                var_found = True
-                # don't change it if it is already set #
-                if _infile_set.lstrip(' ') == S:
-                    already_set = True
-                else:
-                    line = "%s=%s\n" % (V, S)
-
-        sys.stdout.write(line)
-
-    # Append the variable if it wasn't found #
-    if not var_found:
-        with open(filepath, "a") as f:
-            f.write("%s=%s\n" % (V, S))
-    elif already_set == True:
-        pass
-    else:
-        pass
-
-    return
-
-def ranger_knox_properties(params):
-    ranger_knox_properties = dict()
-
-    ranger_knox_properties['POLICY_MGR_URL']           = params.config['configurations']['admin-properties']['policymgr_external_url']
-    ranger_knox_properties['SQL_CONNECTOR_JAR']        = params.config['configurations']['admin-properties']['SQL_CONNECTOR_JAR']
-    ranger_knox_properties['XAAUDIT.DB.FLAVOUR']       = params.config['configurations']['admin-properties']['DB_FLAVOR']
-    ranger_knox_properties['XAAUDIT.DB.DATABASE_NAME'] = params.config['configurations']['admin-properties']['audit_db_name']
-    ranger_knox_properties['XAAUDIT.DB.USER_NAME']     = params.config['configurations']['admin-properties']['audit_db_user']
-    ranger_knox_properties['XAAUDIT.DB.PASSWORD']      = params.config['configurations']['admin-properties']['audit_db_password']
-    ranger_knox_properties['XAAUDIT.DB.HOSTNAME']      = params.config['configurations']['admin-properties']['db_host']
-    ranger_knox_properties['REPOSITORY_NAME']          = params.config['clusterName'] + '_knox'
-
-    ranger_knox_properties['KNOX_HOME'] = params.config['configurations']['ranger-knox-plugin-properties']['KNOX_HOME']
-
-    ranger_knox_properties['XAAUDIT.DB.IS_ENABLED']   = params.config['configurations']['ranger-knox-plugin-properties']['XAAUDIT.DB.IS_ENABLED']
-
-    ranger_knox_properties['XAAUDIT.HDFS.IS_ENABLED'] = params.config['configurations']['ranger-knox-plugin-properties']['XAAUDIT.HDFS.IS_ENABLED']
-    ranger_knox_properties['XAAUDIT.HDFS.DESTINATION_DIRECTORY'] = params.config['configurations']['ranger-knox-plugin-properties']['XAAUDIT.HDFS.DESTINATION_DIRECTORY']
-    ranger_knox_properties['XAAUDIT.HDFS.LOCAL_BUFFER_DIRECTORY'] = params.config['configurations']['ranger-knox-plugin-properties']['XAAUDIT.HDFS.LOCAL_BUFFER_DIRECTORY']
-    ranger_knox_properties['XAAUDIT.HDFS.LOCAL_ARCHIVE_DIRECTORY'] = params.config['configurations']['ranger-knox-plugin-properties']['XAAUDIT.HDFS.LOCAL_ARCHIVE_DIRECTORY']
-    ranger_knox_properties['XAAUDIT.HDFS.DESTINTATION_FILE'] = params.config['configurations']['ranger-knox-plugin-properties']['XAAUDIT.HDFS.DESTINTATION_FILE']
-    ranger_knox_properties['XAAUDIT.HDFS.DESTINTATION_FLUSH_INTERVAL_SECONDS'] = params.config['configurations']['ranger-knox-plugin-properties']['XAAUDIT.HDFS.DESTINTATION_FLUSH_INTERVAL_SECONDS']
-    ranger_knox_properties['XAAUDIT.HDFS.DESTINTATION_ROLLOVER_INTERVAL_SECONDS'] = params.config['configurations']['ranger-knox-plugin-properties']['XAAUDIT.HDFS.DESTINTATION_ROLLOVER_INTERVAL_SECONDS']
-    ranger_knox_properties['XAAUDIT.HDFS.DESTINTATION_OPEN_RETRY_INTERVAL_SECONDS'] = params.config['configurations']['ranger-knox-plugin-properties']['XAAUDIT.HDFS.DESTINTATION_OPEN_RETRY_INTERVAL_SECONDS']
-    ranger_knox_properties['XAAUDIT.HDFS.LOCAL_BUFFER_FILE'] = params.config['configurations']['ranger-knox-plugin-properties']['XAAUDIT.HDFS.LOCAL_BUFFER_FILE']
-    ranger_knox_properties['XAAUDIT.HDFS.LOCAL_BUFFER_FLUSH_INTERVAL_SECONDS'] = params.config['configurations']['ranger-knox-plugin-properties']['XAAUDIT.HDFS.LOCAL_BUFFER_FLUSH_INTERVAL_SECONDS']
-    ranger_knox_properties['XAAUDIT.HDFS.LOCAL_BUFFER_ROLLOVER_INTERVAL_SECONDS'] = params.config['configurations']['ranger-knox-plugin-properties']['XAAUDIT.HDFS.LOCAL_BUFFER_ROLLOVER_INTERVAL_SECONDS']
-    ranger_knox_properties['XAAUDIT.HDFS.LOCAL_ARCHIVE_MAX_FILE_COUNT'] = params.config['configurations']['ranger-knox-plugin-properties']['XAAUDIT.HDFS.LOCAL_ARCHIVE_MAX_FILE_COUNT']
-    
-
-    ranger_knox_properties['SSL_KEYSTORE_FILE_PATH'] = params.config['configurations']['ranger-knox-plugin-properties']['SSL_KEYSTORE_FILE_PATH']
-    ranger_knox_properties['SSL_KEYSTORE_PASSWORD'] = params.config['configurations']['ranger-knox-plugin-properties']['SSL_KEYSTORE_PASSWORD']
-    ranger_knox_properties['SSL_TRUSTSTORE_FILE_PATH'] = params.config['configurations']['ranger-knox-plugin-properties']['SSL_TRUSTSTORE_FILE_PATH']
-    ranger_knox_properties['SSL_TRUSTSTORE_PASSWORD'] = params.config['configurations']['ranger-knox-plugin-properties']['SSL_TRUSTSTORE_PASSWORD']
-    
-
-    return ranger_knox_properties    
-
-def knox_repo_properties(params):
-
-    knoxHost = params.config['clusterHostInfo']['knox_gateway_hosts'][0]
-    knoxPort = params.config['configurations']['gateway-site']['gateway.port']
-
-    config_dict = dict()
-    config_dict['username'] = params.config['configurations']['ranger-knox-plugin-properties']['REPOSITORY_CONFIG_USERNAME']
-    config_dict['password'] = params.config['configurations']['ranger-knox-plugin-properties']['REPOSITORY_CONFIG_USERNAME']
-    config_dict['knox.url'] = 'https://' + knoxHost + ':' + str(knoxPort) +'/gateway/admin/api/v1/topologies'
-    config_dict['commonNameForCertificate'] = params.config['configurations']['ranger-knox-plugin-properties']['common.name.for.certificate']
-
-    repo= dict()
-    repo['isActive']                = "true"
-    repo['config']                  = json.dumps(config_dict)
-    repo['description']             = "knox repo"
-    repo['name']                    = params.config['clusterName'] + "_knox"
-    repo['repositoryType']          = "Knox"
-    repo['assetType']               = '5'
-
-    data = json.dumps(repo)
-
-    return data

http://git-wip-us.apache.org/repos/asf/ambari/blob/fddf0431/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
deleted file mode 100644
index 1bf7427..0000000
--- a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/status_params.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.
-
-"""
-
-from resource_management import *
-
-config = Script.get_config()
-
-knox_conf_dir = '/etc/knox/conf'
-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")
-
-security_enabled = config['configurations']['cluster-env']['security_enabled']
-if security_enabled:
-    knox_keytab_path = config['configurations']['knox-env']['knox_keytab_path']
-    knox_principal_name = config['configurations']['knox-env']['knox_principal_name']
-else:
-    knox_keytab_path = None
-    knox_principal_name = None
-hostname = config['hostname'].lower()
-knox_user = default("/configurations/knox-env/knox_user", "knox")
-kinit_path_local = functions.get_kinit_path(["/usr/bin", "/usr/kerberos/bin", "/usr/sbin"])
-temp_dir = Script.get_tmp_dir()

http://git-wip-us.apache.org/repos/asf/ambari/blob/fddf0431/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/upgrade.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/upgrade.py b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/upgrade.py
deleted file mode 100644
index 9976cb2..0000000
--- a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/upgrade.py
+++ /dev/null
@@ -1,71 +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 tarfile
-import tempfile
-
-from resource_management.core.logger import Logger
-from resource_management.core.exceptions import Fail
-
-BACKUP_TEMP_DIR = "knox-upgrade-backup"
-BACKUP_DATA_ARCHIVE = "knox-data-backup.tar"
-BACKUP_CONF_ARCHIVE = "knox-conf-backup.tar"
-
-def backup_data():
-  """
-  Backs up the knox data as part of the upgrade process.
-  :return:
-  """
-  Logger.info('Backing up Knox data directory before upgrade...')
-  directoryMappings = _get_directory_mappings()
-
-  absolute_backup_dir = os.path.join(tempfile.gettempdir(), BACKUP_TEMP_DIR)
-  if not os.path.isdir(absolute_backup_dir):
-    os.makedirs(absolute_backup_dir)
-
-  for directory in directoryMappings:
-    if not os.path.isdir(directory):
-      raise Fail("Unable to backup missing directory {0}".format(directory))
-
-    archive = os.path.join(absolute_backup_dir, directoryMappings[directory])
-    Logger.info('Compressing {0} to {1}'.format(directory, archive))
-
-    if os.path.exists(archive):
-      os.remove(archive)
-
-    tarball = None
-    try:
-      tarball = tarfile.open(archive, "w")
-      tarball.add(directory, arcname=os.path.basename(directory))
-    finally:
-      if tarball:
-        tarball.close()
-
-def _get_directory_mappings():
-  """
-  Gets a dictionary of directory to archive name that represents the
-  directories that need to be backed up and their output tarball archive targets
-  :return:  the dictionary of directory to tarball mappings
-  """
-  import params
-
-  return { params.knox_data_dir : BACKUP_DATA_ARCHIVE, params.knox_conf_dir : BACKUP_CONF_ARCHIVE }
-

http://git-wip-us.apache.org/repos/asf/ambari/blob/fddf0431/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
deleted file mode 100644
index fa3237b..0000000
--- a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/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/fddf0431/ambari-server/src/main/resources/common-services/KNOX/0.5.0/alerts.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KNOX/0.5.0/alerts.json b/ambari-server/src/main/resources/common-services/KNOX/0.5.0/alerts.json
new file mode 100644
index 0000000..e063da7
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KNOX/0.5.0/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
+            }
+          }
+        }
+      }
+    ]
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/fddf0431/ambari-server/src/main/resources/common-services/KNOX/0.5.0/configuration/gateway-log4j.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KNOX/0.5.0/configuration/gateway-log4j.xml b/ambari-server/src/main/resources/common-services/KNOX/0.5.0/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/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/fddf0431/ambari-server/src/main/resources/common-services/KNOX/0.5.0/configuration/gateway-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KNOX/0.5.0/configuration/gateway-site.xml b/ambari-server/src/main/resources/common-services/KNOX/0.5.0/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/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/fddf0431/ambari-server/src/main/resources/common-services/KNOX/0.5.0/configuration/knox-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KNOX/0.5.0/configuration/knox-env.xml b/ambari-server/src/main/resources/common-services/KNOX/0.5.0/configuration/knox-env.xml
new file mode 100644
index 0000000..bbd3d12
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KNOX/0.5.0/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="false">
+    <!-- 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/fddf0431/ambari-server/src/main/resources/common-services/KNOX/0.5.0/configuration/ldap-log4j.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KNOX/0.5.0/configuration/ldap-log4j.xml b/ambari-server/src/main/resources/common-services/KNOX/0.5.0/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/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/fddf0431/ambari-server/src/main/resources/common-services/KNOX/0.5.0/configuration/ranger-knox-plugin-properties.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KNOX/0.5.0/configuration/ranger-knox-plugin-properties.xml b/ambari-server/src/main/resources/common-services/KNOX/0.5.0/configuration/ranger-knox-plugin-properties.xml
new file mode 100644
index 0000000..b744658
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KNOX/0.5.0/configuration/ranger-knox-plugin-properties.xml
@@ -0,0 +1,156 @@
+<?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.
+ */
+-->
+<configuration supports_final="true">
+
+	<property>
+		<name>common.name.for.certificate</name>
+		<value>-</value>
+		<description>Used for repository creation on ranger admin</description>
+	</property>
+
+    <property>
+        <name>ranger-knox-plugin-enabled</name>
+        <value>No</value>
+        <description>Enable ranger knox plugin ?</description>
+    </property>
+
+	<property>
+		<name>REPOSITORY_CONFIG_USERNAME</name>
+		<value>admin</value>
+		<description>Used for repository creation on ranger admin</description>
+	</property>	
+
+	<property>
+		<name>REPOSITORY_CONFIG_PASSWORD</name>
+		<value>admin-password</value>
+		<property-type>PASSWORD</property-type>
+		<description>Used for repository creation on ranger admin</description>
+	</property>	
+
+	<property>
+		<name>KNOX_HOME</name>
+		<value>/usr/hdp/current/knox-server</value>
+		<description></description>
+	</property>
+
+	<property>
+		<name>XAAUDIT.DB.IS_ENABLED</name>
+		<value>true</value>
+		<description></description>
+	</property>
+
+	<property>
+		<name>XAAUDIT.HDFS.IS_ENABLED</name>
+		<value>false</value>
+		<description></description>
+	</property>
+
+	<property>
+		<name>XAAUDIT.HDFS.DESTINATION_DIRECTORY</name>
+		<value>hdfs://__REPLACE__NAME_NODE_HOST:8020/ranger/audit/%app-type%/%time:yyyyMMdd%</value>
+		<description></description>
+	</property>
+
+	<property>
+		<name>XAAUDIT.HDFS.LOCAL_BUFFER_DIRECTORY</name>
+		<value>__REPLACE__LOG_DIR/hadoop/%app-type%/audit</value>
+		<description></description>
+	</property>
+
+	<property>
+		<name>XAAUDIT.HDFS.LOCAL_ARCHIVE_DIRECTORY</name>
+		<value>__REPLACE__LOG_DIR/hadoop/%app-type%/audit/archive</value>
+		<description></description>
+	</property>
+
+	<property>
+		<name>XAAUDIT.HDFS.DESTINTATION_FILE</name>
+		<value>%hostname%-audit.log</value>
+		<description></description>
+	</property>
+
+	<property>
+		<name>XAAUDIT.HDFS.DESTINTATION_FLUSH_INTERVAL_SECONDS</name>
+		<value>900</value>
+		<description></description>
+	</property>
+
+	<property>
+		<name>XAAUDIT.HDFS.DESTINTATION_ROLLOVER_INTERVAL_SECONDS</name>
+		<value>86400</value>
+		<description></description>
+	</property>
+
+	<property>
+		<name>XAAUDIT.HDFS.DESTINTATION_OPEN_RETRY_INTERVAL_SECONDS</name>
+		<value>60</value>
+		<description></description>
+	</property>
+
+	<property>
+		<name>XAAUDIT.HDFS.LOCAL_BUFFER_FILE</name>
+		<value>%time:yyyyMMdd-HHmm.ss%.log</value>
+		<description></description>
+	</property>
+
+	<property>
+		<name>XAAUDIT.HDFS.LOCAL_BUFFER_FLUSH_INTERVAL_SECONDS</name>
+		<value>60</value>
+		<description></description>
+	</property>
+
+	<property>
+		<name>XAAUDIT.HDFS.LOCAL_BUFFER_ROLLOVER_INTERVAL_SECONDS</name>
+		<value>600</value>
+		<description></description>
+	</property>
+
+	<property>
+		<name>XAAUDIT.HDFS.LOCAL_ARCHIVE_MAX_FILE_COUNT</name>
+		<value>10</value>
+		<description></description>
+	</property>
+
+	<property>
+		<name>SSL_KEYSTORE_FILE_PATH</name>
+		<value>/etc/hadoop/conf/ranger-plugin-keystore.jks</value>
+		<description></description>
+	</property>
+
+	<property>
+		<name>SSL_KEYSTORE_PASSWORD</name>
+		<value>myKeyFilePassword</value>
+		<description></description>
+	</property>
+
+	<property>
+		<name>SSL_TRUSTSTORE_FILE_PATH</name>
+		<value>/etc/hadoop/conf/ranger-plugin-truststore.jks</value>
+		<description></description>
+	</property>
+
+	<property>
+		<name>SSL_TRUSTSTORE_PASSWORD</name>
+		<value>changeit</value>
+		<description></description>
+	</property>
+
+</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/fddf0431/ambari-server/src/main/resources/common-services/KNOX/0.5.0/configuration/topology.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KNOX/0.5.0/configuration/topology.xml b/ambari-server/src/main/resources/common-services/KNOX/0.5.0/configuration/topology.xml
new file mode 100644
index 0000000..db16a21
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KNOX/0.5.0/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/fddf0431/ambari-server/src/main/resources/common-services/KNOX/0.5.0/configuration/users-ldif.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KNOX/0.5.0/configuration/users-ldif.xml b/ambari-server/src/main/resources/common-services/KNOX/0.5.0/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/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/fddf0431/ambari-server/src/main/resources/common-services/KNOX/0.5.0/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KNOX/0.5.0/metainfo.xml b/ambari-server/src/main/resources/common-services/KNOX/0.5.0/metainfo.xml
new file mode 100644
index 0000000..0e91081
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KNOX/0.5.0/metainfo.xml
@@ -0,0 +1,88 @@
+<?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</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>1200</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>
+        <config-type>ranger-knox-plugin-properties</config-type>
+      </configuration-dependencies>
+    </service>
+  </services>
+</metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/fddf0431/ambari-server/src/main/resources/common-services/KNOX/0.5.0/package/files/validateKnoxStatus.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KNOX/0.5.0/package/files/validateKnoxStatus.py b/ambari-server/src/main/resources/common-services/KNOX/0.5.0/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/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/fddf0431/ambari-server/src/main/resources/common-services/KNOX/0.5.0/package/scripts/knox.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KNOX/0.5.0/package/scripts/knox.py b/ambari-server/src/main/resources/common-services/KNOX/0.5.0/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/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/fddf0431/ambari-server/src/main/resources/common-services/KNOX/0.5.0/package/scripts/knox_gateway.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KNOX/0.5.0/package/scripts/knox_gateway.py b/ambari-server/src/main/resources/common-services/KNOX/0.5.0/package/scripts/knox_gateway.py
new file mode 100644
index 0000000..8593c5a
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KNOX/0.5.0/package/scripts/knox_gateway.py
@@ -0,0 +1,183 @@
+"""
+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 resource_management.libraries.functions.security_commons import build_expectations, \
+  cached_kinit_executor, validate_security_config_properties, get_params_from_filesystem, \
+  FILE_TYPE_XML
+import sys
+import upgrade
+
+from knox import knox
+from ldap import ldap
+from setup_ranger_knox import setup_ranger_knox
+
+class KnoxGateway(Script):
+
+  def get_stack_to_component(self):
+    return {"HDP": "knox-server"}
+
+  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 pre_rolling_restart(self, env):
+    import params
+    env.set_params(params)
+
+    if params.version and compare_versions(format_hdp_stack_version(params.version), '2.2.0.0') >= 0:
+      upgrade.backup_data()
+      Execute(format("hdp-select set knox-server {version}"))
+
+
+  def start(self, env, rolling_restart=False):
+    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')
+    setup_ranger_knox(env)
+    Execute(daemon_cmd,
+            user=params.knox_user,
+            environment={'JAVA_HOME': params.java_home},
+            not_if=no_op_test
+    )
+
+  def stop(self, env, rolling_restart=False):
+    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}"))
+
+  def security_status(self, env):
+    import status_params
+
+    env.set_params(status_params)
+
+    if status_params.security_enabled:
+      expectations = {}
+      expectations.update(build_expectations(
+        'krb5JAASLogin',
+        None,
+        ['keytab', 'principal'],
+        None
+      ))
+      expectations.update(build_expectations(
+        'gateway-site',
+        {
+          "gateway.hadoop.kerberos.secured" : "true"
+        },
+        None,
+        None
+      ))
+
+      security_params = {
+        "krb5JAASLogin":
+          {
+            'keytab': status_params.knox_keytab_path,
+            'principal': status_params.knox_principal_name
+          }
+      }
+      security_params.update(get_params_from_filesystem(status_params.knox_conf_dir,
+        {"gateway-site.xml" : FILE_TYPE_XML}))
+
+      result_issues = validate_security_config_properties(security_params, expectations)
+      if not result_issues:  # If all validations passed successfully
+        try:
+          # Double check the dict before calling execute
+          if ( 'krb5JAASLogin' not in security_params
+               or 'keytab' not in security_params['krb5JAASLogin']
+               or 'principal' not in security_params['krb5JAASLogin']):
+            self.put_structured_out({"securityState": "UNSECURED"})
+            self.put_structured_out({"securityIssuesFound": "Keytab file and principal are not set."})
+            return
+
+          cached_kinit_executor(status_params.kinit_path_local,
+                                status_params.knox_user,
+                                security_params['krb5JAASLogin']['keytab'],
+                                security_params['krb5JAASLogin']['principal'],
+                                status_params.hostname,
+                                status_params.temp_dir)
+          self.put_structured_out({"securityState": "SECURED_KERBEROS"})
+        except Exception as e:
+          self.put_structured_out({"securityState": "ERROR"})
+          self.put_structured_out({"securityStateErrorInfo": str(e)})
+      else:
+        issues = []
+        for cf in result_issues:
+          issues.append("Configuration file %s did not pass the validation. Reason: %s" % (cf, result_issues[cf]))
+        self.put_structured_out({"securityIssuesFound": ". ".join(issues)})
+        self.put_structured_out({"securityState": "UNSECURED"})
+    else:
+      self.put_structured_out({"securityState": "UNSECURED"})
+
+
+if __name__ == "__main__":
+  KnoxGateway().execute()

http://git-wip-us.apache.org/repos/asf/ambari/blob/fddf0431/ambari-server/src/main/resources/common-services/KNOX/0.5.0/package/scripts/ldap.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KNOX/0.5.0/package/scripts/ldap.py b/ambari-server/src/main/resources/common-services/KNOX/0.5.0/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/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/fddf0431/ambari-server/src/main/resources/common-services/KNOX/0.5.0/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KNOX/0.5.0/package/scripts/params.py b/ambari-server/src/main/resources/common-services/KNOX/0.5.0/package/scripts/params.py
new file mode 100644
index 0000000..28fabe5
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KNOX/0.5.0/package/scripts/params.py
@@ -0,0 +1,161 @@
+"""
+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.libraries.functions.default import default
+from resource_management import *
+import status_params
+
+config = Script.get_config()
+tmp_dir = Script.get_tmp_dir()
+
+stack_name = default("/hostLevelParams/stack_name", None)
+
+version = default("/commandParams/version", None)
+
+stack_version_unformatted = str(config['hostLevelParams']['stack_version'])
+hdp_stack_version = format_hdp_stack_version(stack_version_unformatted)
+
+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'
+  knox_data_dir = '/usr/hdp/current/knox-server/data'
+  knox_conf_dir = '/usr/hdp/current/knox-server/conf'
+else:
+  knox_bin = '/usr/bin/gateway'
+  ldap_bin = '/usr/lib/knox/bin/ldap.sh'
+  knox_client_bin = '/usr/lib/knox/bin/knoxcli.sh'
+  knox_data_dir = '/usr/lib/knox/data'
+  knox_conf_dir = '/usr/lib/knox/conf'
+
+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']
+smokeuser_principal = config['configurations']['cluster-env']['smokeuser_principal_name']
+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)
+
+# ranger host
+ranger_admin_hosts = default("/clusterHostInfo/ranger_admin_hosts", [])
+has_ranger_admin = not len(ranger_admin_hosts) == 0
+
+if hdp_stack_version != "" and compare_versions(hdp_stack_version, '2.2') >= 0:
+    # Setting Flag value for ranger hbase plugin
+    enable_ranger_knox = False
+    user_input = config['configurations']['ranger-knox-plugin-properties']['ranger-knox-plugin-enabled']
+    if user_input.lower() == 'yes':
+      enable_ranger_knox = True
+    elif user_input.lower() == 'no':
+      enable_ranger_knox = False
+      
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/fddf0431/ambari-server/src/main/resources/common-services/KNOX/0.5.0/package/scripts/service_check.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KNOX/0.5.0/package/scripts/service_check.py b/ambari-server/src/main/resources/common-services/KNOX/0.5.0/package/scripts/service_check.py
new file mode 100644
index 0000000..e05262f
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KNOX/0.5.0/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_principal};")
+          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


[4/5] ambari git commit: AMBARI-9296. Service versions do not need stack maj.min appended any longer (aonishuk)

Posted by ao...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/fddf0431/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/configuration/kafka-log4j.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/configuration/kafka-log4j.xml b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/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/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/fddf0431/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/metainfo.xml b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/metainfo.xml
new file mode 100644
index 0000000..b2d83fe
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/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</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>1200</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/fddf0431/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/metrics.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/metrics.json b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/metrics.json
new file mode 100644
index 0000000..826c0e8
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/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/fddf0431/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/kafka.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/kafka.py b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/kafka.py
new file mode 100644
index 0000000..f00575e
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/kafka.py
@@ -0,0 +1,75 @@
+#!/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_server_config['kafka.metrics.reporters'] = params.kafka_metrics_reporters
+    if(params.has_metric_collector):
+            kafka_server_config['kafka.timeline.metrics.host'] = params.metric_collector_host
+            kafka_server_config['kafka.timeline.metrics.port'] = params.metric_collector_port
+
+    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/fddf0431/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/kafka_broker.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/kafka_broker.py b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/kafka_broker.py
new file mode 100644
index 0000000..ce72353
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/kafka_broker.py
@@ -0,0 +1,73 @@
+"""
+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
+import upgrade
+
+from kafka import kafka
+
+class KafkaBroker(Script):
+
+  def get_stack_to_component(self):
+    return {"HDP": "kafka-broker"}
+
+  def install(self, env):
+    self.install_packages(env)
+    self.configure(env)
+
+  def configure(self, env):
+    import params
+    env.set_params(params)
+    kafka()
+
+  def pre_rolling_restart(self, env):
+    import params
+    env.set_params(params)
+    upgrade.prestart(env, "kafka-broker")
+
+  def start(self, env, rolling_restart=False):
+    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, rolling_restart=False):
+    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/fddf0431/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/params.py b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/params.py
new file mode 100644
index 0000000..39bec56
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/params.py
@@ -0,0 +1,91 @@
+#!/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.libraries.functions.default import default
+from resource_management import *
+import status_params
+
+# server configurations
+config = Script.get_config()
+
+stack_name = default("/hostLevelParams/stack_name", None)
+
+version = default("/commandParams/version", None)
+
+stack_version_unformatted = str(config['hostLevelParams']['stack_version'])
+hdp_stack_version = format_hdp_stack_version(stack_version_unformatted)
+
+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
+
+if 'ganglia_server_host' in config['clusterHostInfo'] and \
+    len(config['clusterHostInfo']['ganglia_server_host'])>0:
+  ganglia_installed = True
+  ganglia_server = config['clusterHostInfo']['ganglia_server_host'][0]
+  ganglia_report_interval = 60
+else:
+  ganglia_installed = False
+
+kafka_metrics_reporters=""
+metric_collector_host = ""
+metric_collector_port = ""
+
+if ganglia_installed:
+  kafka_metrics_reporters = "kafka.ganglia.KafkaGangliaMetricsReporter"
+
+ams_collector_hosts = default("/clusterHostInfo/metric_collector_hosts", [])
+has_metric_collector = not len(ams_collector_hosts) == 0
+
+if has_metric_collector:
+  metric_collector_host = ams_collector_hosts[0]
+  metric_collector_port = default("/configurations/ams-site/timeline.metrics.service.webapp.address", "0.0.0.0:8188")
+  if metric_collector_port and metric_collector_port.find(':') != -1:
+    metric_collector_port = metric_collector_port.split(':')[1]
+
+  if not len(kafka_metrics_reporters) == 0:
+      kafka_metrics_reporters = kafka_metrics_reporters + ','
+
+  kafka_metrics_reporters = kafka_metrics_reporters + "org.apache.hadoop.metrics2.sink.kafka.KafkaTimelineMetricsReporter"

http://git-wip-us.apache.org/repos/asf/ambari/blob/fddf0431/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/properties_config.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/properties_config.py b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/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/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/fddf0431/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/service_check.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/service_check.py b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/service_check.py
new file mode 100644
index 0000000..b10b602
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/service_check.py
@@ -0,0 +1,52 @@
+#!/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 ServiceCheck(Script):
+  def service_check(self, env):
+      import params
+      env.set_params(params)
+      
+      kafka_config = self.read_kafka_config()
+      
+      create_topic_cmd_created_output = "Created topic \"ambari_kafka_service_check\"."
+      create_topic_cmd_exists_output = "Topic \"ambari_kafka_service_check\" already exists."
+      
+      source_cmd = format("source {conf_dir}/kafka-env.sh")
+      create_topic_cmd = format("{kafka_home}/bin/kafka-topics.sh --zookeeper {kafka_config[zookeeper.connect]} --create --topic ambari_kafka_service_check --partitions 1 --replication-factor 1")
+      
+      print "Running kafka create topic command"
+      Execute(format("{source_cmd} ; {create_topic_cmd} | grep '{create_topic_cmd_created_output}\|{create_topic_cmd_exists_output}'"),
+              logoutput=True,
+      )
+
+  def read_kafka_config(self):
+    import params
+    
+    kafka_config = {}
+    with open(params.conf_dir+"/server.properties","r") as conf_file:
+      for line in conf_file:
+          key,value = line.split("=")
+          kafka_config[key] = value.replace("\n","")
+    
+    return kafka_config
+
+if __name__ == "__main__":
+    ServiceCheck().execute()

http://git-wip-us.apache.org/repos/asf/ambari/blob/fddf0431/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/status_params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/status_params.py b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/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/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/fddf0431/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/upgrade.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/upgrade.py b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/upgrade.py
new file mode 100644
index 0000000..c031fa6
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/upgrade.py
@@ -0,0 +1,29 @@
+
+#!/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 resource_management.core.resources.system import Execute
+from resource_management.libraries.functions.version import compare_versions, format_hdp_stack_version
+
+def prestart(env, hdp_component):
+  import params
+
+  if params.version and compare_versions(format_hdp_stack_version(params.version), '2.2.0.0') >= 0:
+    Execute("hdp-select set {0} {1}".format(hdp_component, params.version))

http://git-wip-us.apache.org/repos/asf/ambari/blob/fddf0431/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
deleted file mode 100644
index e063da7..0000000
--- a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/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/fddf0431/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
deleted file mode 100644
index 370f786..0000000
--- a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/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/fddf0431/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
deleted file mode 100644
index 4d4c4ed..0000000
--- a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/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/fddf0431/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
deleted file mode 100644
index bbd3d12..0000000
--- a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/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="false">
-    <!-- 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/fddf0431/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
deleted file mode 100644
index a0cf658..0000000
--- a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/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/fddf0431/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/ranger-knox-plugin-properties.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/ranger-knox-plugin-properties.xml b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/ranger-knox-plugin-properties.xml
deleted file mode 100644
index b744658..0000000
--- a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/ranger-knox-plugin-properties.xml
+++ /dev/null
@@ -1,156 +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.
- */
--->
-<configuration supports_final="true">
-
-	<property>
-		<name>common.name.for.certificate</name>
-		<value>-</value>
-		<description>Used for repository creation on ranger admin</description>
-	</property>
-
-    <property>
-        <name>ranger-knox-plugin-enabled</name>
-        <value>No</value>
-        <description>Enable ranger knox plugin ?</description>
-    </property>
-
-	<property>
-		<name>REPOSITORY_CONFIG_USERNAME</name>
-		<value>admin</value>
-		<description>Used for repository creation on ranger admin</description>
-	</property>	
-
-	<property>
-		<name>REPOSITORY_CONFIG_PASSWORD</name>
-		<value>admin-password</value>
-		<property-type>PASSWORD</property-type>
-		<description>Used for repository creation on ranger admin</description>
-	</property>	
-
-	<property>
-		<name>KNOX_HOME</name>
-		<value>/usr/hdp/current/knox-server</value>
-		<description></description>
-	</property>
-
-	<property>
-		<name>XAAUDIT.DB.IS_ENABLED</name>
-		<value>true</value>
-		<description></description>
-	</property>
-
-	<property>
-		<name>XAAUDIT.HDFS.IS_ENABLED</name>
-		<value>false</value>
-		<description></description>
-	</property>
-
-	<property>
-		<name>XAAUDIT.HDFS.DESTINATION_DIRECTORY</name>
-		<value>hdfs://__REPLACE__NAME_NODE_HOST:8020/ranger/audit/%app-type%/%time:yyyyMMdd%</value>
-		<description></description>
-	</property>
-
-	<property>
-		<name>XAAUDIT.HDFS.LOCAL_BUFFER_DIRECTORY</name>
-		<value>__REPLACE__LOG_DIR/hadoop/%app-type%/audit</value>
-		<description></description>
-	</property>
-
-	<property>
-		<name>XAAUDIT.HDFS.LOCAL_ARCHIVE_DIRECTORY</name>
-		<value>__REPLACE__LOG_DIR/hadoop/%app-type%/audit/archive</value>
-		<description></description>
-	</property>
-
-	<property>
-		<name>XAAUDIT.HDFS.DESTINTATION_FILE</name>
-		<value>%hostname%-audit.log</value>
-		<description></description>
-	</property>
-
-	<property>
-		<name>XAAUDIT.HDFS.DESTINTATION_FLUSH_INTERVAL_SECONDS</name>
-		<value>900</value>
-		<description></description>
-	</property>
-
-	<property>
-		<name>XAAUDIT.HDFS.DESTINTATION_ROLLOVER_INTERVAL_SECONDS</name>
-		<value>86400</value>
-		<description></description>
-	</property>
-
-	<property>
-		<name>XAAUDIT.HDFS.DESTINTATION_OPEN_RETRY_INTERVAL_SECONDS</name>
-		<value>60</value>
-		<description></description>
-	</property>
-
-	<property>
-		<name>XAAUDIT.HDFS.LOCAL_BUFFER_FILE</name>
-		<value>%time:yyyyMMdd-HHmm.ss%.log</value>
-		<description></description>
-	</property>
-
-	<property>
-		<name>XAAUDIT.HDFS.LOCAL_BUFFER_FLUSH_INTERVAL_SECONDS</name>
-		<value>60</value>
-		<description></description>
-	</property>
-
-	<property>
-		<name>XAAUDIT.HDFS.LOCAL_BUFFER_ROLLOVER_INTERVAL_SECONDS</name>
-		<value>600</value>
-		<description></description>
-	</property>
-
-	<property>
-		<name>XAAUDIT.HDFS.LOCAL_ARCHIVE_MAX_FILE_COUNT</name>
-		<value>10</value>
-		<description></description>
-	</property>
-
-	<property>
-		<name>SSL_KEYSTORE_FILE_PATH</name>
-		<value>/etc/hadoop/conf/ranger-plugin-keystore.jks</value>
-		<description></description>
-	</property>
-
-	<property>
-		<name>SSL_KEYSTORE_PASSWORD</name>
-		<value>myKeyFilePassword</value>
-		<description></description>
-	</property>
-
-	<property>
-		<name>SSL_TRUSTSTORE_FILE_PATH</name>
-		<value>/etc/hadoop/conf/ranger-plugin-truststore.jks</value>
-		<description></description>
-	</property>
-
-	<property>
-		<name>SSL_TRUSTSTORE_PASSWORD</name>
-		<value>changeit</value>
-		<description></description>
-	</property>
-
-</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/fddf0431/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
deleted file mode 100644
index db16a21..0000000
--- a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/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>

http://git-wip-us.apache.org/repos/asf/ambari/blob/fddf0431/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
deleted file mode 100644
index ace4858..0000000
--- a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/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/fddf0431/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
deleted file mode 100644
index 810d3ff..0000000
--- a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/metainfo.xml
+++ /dev/null
@@ -1,88 +0,0 @@
-<?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>1200</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>
-        <config-type>ranger-knox-plugin-properties</config-type>
-      </configuration-dependencies>
-    </service>
-  </services>
-</metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/fddf0431/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
deleted file mode 100644
index 257abfb..0000000
--- a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/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/fddf0431/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
deleted file mode 100644
index 7d7d20c..0000000
--- a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/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/fddf0431/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
deleted file mode 100644
index 8593c5a..0000000
--- a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/knox_gateway.py
+++ /dev/null
@@ -1,183 +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 *
-from resource_management.libraries.functions.security_commons import build_expectations, \
-  cached_kinit_executor, validate_security_config_properties, get_params_from_filesystem, \
-  FILE_TYPE_XML
-import sys
-import upgrade
-
-from knox import knox
-from ldap import ldap
-from setup_ranger_knox import setup_ranger_knox
-
-class KnoxGateway(Script):
-
-  def get_stack_to_component(self):
-    return {"HDP": "knox-server"}
-
-  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 pre_rolling_restart(self, env):
-    import params
-    env.set_params(params)
-
-    if params.version and compare_versions(format_hdp_stack_version(params.version), '2.2.0.0') >= 0:
-      upgrade.backup_data()
-      Execute(format("hdp-select set knox-server {version}"))
-
-
-  def start(self, env, rolling_restart=False):
-    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')
-    setup_ranger_knox(env)
-    Execute(daemon_cmd,
-            user=params.knox_user,
-            environment={'JAVA_HOME': params.java_home},
-            not_if=no_op_test
-    )
-
-  def stop(self, env, rolling_restart=False):
-    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}"))
-
-  def security_status(self, env):
-    import status_params
-
-    env.set_params(status_params)
-
-    if status_params.security_enabled:
-      expectations = {}
-      expectations.update(build_expectations(
-        'krb5JAASLogin',
-        None,
-        ['keytab', 'principal'],
-        None
-      ))
-      expectations.update(build_expectations(
-        'gateway-site',
-        {
-          "gateway.hadoop.kerberos.secured" : "true"
-        },
-        None,
-        None
-      ))
-
-      security_params = {
-        "krb5JAASLogin":
-          {
-            'keytab': status_params.knox_keytab_path,
-            'principal': status_params.knox_principal_name
-          }
-      }
-      security_params.update(get_params_from_filesystem(status_params.knox_conf_dir,
-        {"gateway-site.xml" : FILE_TYPE_XML}))
-
-      result_issues = validate_security_config_properties(security_params, expectations)
-      if not result_issues:  # If all validations passed successfully
-        try:
-          # Double check the dict before calling execute
-          if ( 'krb5JAASLogin' not in security_params
-               or 'keytab' not in security_params['krb5JAASLogin']
-               or 'principal' not in security_params['krb5JAASLogin']):
-            self.put_structured_out({"securityState": "UNSECURED"})
-            self.put_structured_out({"securityIssuesFound": "Keytab file and principal are not set."})
-            return
-
-          cached_kinit_executor(status_params.kinit_path_local,
-                                status_params.knox_user,
-                                security_params['krb5JAASLogin']['keytab'],
-                                security_params['krb5JAASLogin']['principal'],
-                                status_params.hostname,
-                                status_params.temp_dir)
-          self.put_structured_out({"securityState": "SECURED_KERBEROS"})
-        except Exception as e:
-          self.put_structured_out({"securityState": "ERROR"})
-          self.put_structured_out({"securityStateErrorInfo": str(e)})
-      else:
-        issues = []
-        for cf in result_issues:
-          issues.append("Configuration file %s did not pass the validation. Reason: %s" % (cf, result_issues[cf]))
-        self.put_structured_out({"securityIssuesFound": ". ".join(issues)})
-        self.put_structured_out({"securityState": "UNSECURED"})
-    else:
-      self.put_structured_out({"securityState": "UNSECURED"})
-
-
-if __name__ == "__main__":
-  KnoxGateway().execute()

http://git-wip-us.apache.org/repos/asf/ambari/blob/fddf0431/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
deleted file mode 100644
index 2ff8297..0000000
--- a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/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
-    )
-


[5/5] ambari git commit: AMBARI-9296. Service versions do not need stack maj.min appended any longer (aonishuk)

Posted by ao...@apache.org.
AMBARI-9296. Service versions do not need stack maj.min appended any longer (aonishuk)


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

Branch: refs/heads/trunk
Commit: fddf04318cfc7e6111f433fcd47e99bdc652a49f
Parents: 69bc4f0
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Fri Jan 23 15:09:14 2015 +0200
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Fri Jan 23 15:09:14 2015 +0200

----------------------------------------------------------------------
 .../common-services/KAFKA/0.8.1.2.2/alerts.json |  32 --
 .../0.8.1.2.2/configuration/kafka-broker.xml    | 346 -------------------
 .../KAFKA/0.8.1.2.2/configuration/kafka-env.xml |  61 ----
 .../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    |  75 ----
 .../0.8.1.2.2/package/scripts/kafka_broker.py   |  73 ----
 .../KAFKA/0.8.1.2.2/package/scripts/params.py   |  91 -----
 .../package/scripts/properties_config.py        |  32 --
 .../0.8.1.2.2/package/scripts/service_check.py  |  52 ---
 .../0.8.1.2.2/package/scripts/status_params.py  |  26 --
 .../KAFKA/0.8.1.2.2/package/scripts/upgrade.py  |  29 --
 .../common-services/KAFKA/0.8.1/alerts.json     |  32 ++
 .../KAFKA/0.8.1/configuration/kafka-broker.xml  | 346 +++++++++++++++++++
 .../KAFKA/0.8.1/configuration/kafka-env.xml     |  61 ++++
 .../KAFKA/0.8.1/configuration/kafka-log4j.xml   | 116 +++++++
 .../common-services/KAFKA/0.8.1/metainfo.xml    |  82 +++++
 .../common-services/KAFKA/0.8.1/metrics.json    | 262 ++++++++++++++
 .../KAFKA/0.8.1/package/scripts/kafka.py        |  75 ++++
 .../KAFKA/0.8.1/package/scripts/kafka_broker.py |  73 ++++
 .../KAFKA/0.8.1/package/scripts/params.py       |  91 +++++
 .../0.8.1/package/scripts/properties_config.py  |  32 ++
 .../0.8.1/package/scripts/service_check.py      |  52 +++
 .../0.8.1/package/scripts/status_params.py      |  26 ++
 .../KAFKA/0.8.1/package/scripts/upgrade.py      |  29 ++
 .../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 ----
 .../ranger-knox-plugin-properties.xml           | 156 ---------
 .../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 |  88 -----
 .../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   | 183 ----------
 .../KNOX/0.5.0.2.2/package/scripts/ldap.py      |  39 ---
 .../KNOX/0.5.0.2.2/package/scripts/params.py    | 161 ---------
 .../0.5.0.2.2/package/scripts/service_check.py  |  58 ----
 .../package/scripts/setup_ranger_knox.py        | 183 ----------
 .../0.5.0.2.2/package/scripts/status_params.py  |  40 ---
 .../KNOX/0.5.0.2.2/package/scripts/upgrade.py   |  71 ----
 .../package/templates/krb5JAASLogin.conf.j2     |  30 --
 .../common-services/KNOX/0.5.0/alerts.json      |  32 ++
 .../KNOX/0.5.0/configuration/gateway-log4j.xml  |  83 +++++
 .../KNOX/0.5.0/configuration/gateway-site.xml   |  72 ++++
 .../KNOX/0.5.0/configuration/knox-env.xml       |  53 +++
 .../KNOX/0.5.0/configuration/ldap-log4j.xml     |  66 ++++
 .../ranger-knox-plugin-properties.xml           | 156 +++++++++
 .../KNOX/0.5.0/configuration/topology.xml       | 116 +++++++
 .../KNOX/0.5.0/configuration/users-ldif.xml     | 135 ++++++++
 .../common-services/KNOX/0.5.0/metainfo.xml     |  88 +++++
 .../0.5.0/package/files/validateKnoxStatus.py   |  43 +++
 .../KNOX/0.5.0/package/scripts/knox.py          |  85 +++++
 .../KNOX/0.5.0/package/scripts/knox_gateway.py  | 183 ++++++++++
 .../KNOX/0.5.0/package/scripts/ldap.py          |  39 +++
 .../KNOX/0.5.0/package/scripts/params.py        | 161 +++++++++
 .../KNOX/0.5.0/package/scripts/service_check.py |  58 ++++
 .../0.5.0/package/scripts/setup_ranger_knox.py  | 183 ++++++++++
 .../KNOX/0.5.0/package/scripts/status_params.py |  40 +++
 .../KNOX/0.5.0/package/scripts/upgrade.py       |  71 ++++
 .../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 |  55 ---
 .../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 |  59 ----
 .../package/templates/storm-slider-env.sh.j2    |  38 --
 .../0.60.0/configuration/slider-client.xml      |  60 ++++
 .../SLIDER/0.60.0/configuration/slider-env.xml  |  43 +++
 .../0.60.0/configuration/slider-log4j.xml       |  89 +++++
 .../common-services/SLIDER/0.60.0/metainfo.xml  | 132 +++++++
 .../0.60.0/package/files/hbaseSmokeVerify.sh    |  34 ++
 .../SLIDER/0.60.0/package/scripts/__init__.py   |  19 +
 .../SLIDER/0.60.0/package/scripts/params.py     |  55 +++
 .../0.60.0/package/scripts/service_check.py     |  45 +++
 .../SLIDER/0.60.0/package/scripts/slider.py     |  62 ++++
 .../0.60.0/package/scripts/slider_client.py     |  59 ++++
 .../package/templates/storm-slider-env.sh.j2    |  38 ++
 .../stacks/HDP/2.2/services/FALCON/metainfo.xml |   2 +-
 .../stacks/HDP/2.2/services/FLUME/metainfo.xml  |   2 +-
 .../stacks/HDP/2.2/services/HBASE/metainfo.xml  |   2 +-
 .../stacks/HDP/2.2/services/HDFS/metainfo.xml   |   2 +-
 .../stacks/HDP/2.2/services/HIVE/metainfo.xml   |   2 +-
 .../stacks/HDP/2.2/services/KAFKA/metainfo.xml  |   2 +-
 .../stacks/HDP/2.2/services/KNOX/metainfo.xml   |   2 +-
 .../stacks/HDP/2.2/services/OOZIE/metainfo.xml  |   2 +-
 .../stacks/HDP/2.2/services/PIG/metainfo.xml    |   2 +-
 .../stacks/HDP/2.2/services/SLIDER/metainfo.xml |   2 +-
 .../stacks/HDP/2.2/services/SQOOP/metainfo.xml  |   2 +-
 .../stacks/HDP/2.2/services/STORM/metainfo.xml  |   2 +-
 .../stacks/HDP/2.2/services/TEZ/metainfo.xml    |   2 +-
 .../stacks/HDP/2.2/services/YARN/metainfo.xml   |   4 +-
 .../HDP/2.2/services/ZOOKEEPER/metainfo.xml     |   2 +-
 101 files changed, 3623 insertions(+), 3623 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/fddf0431/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
deleted file mode 100644
index 4c9884c..0000000
--- a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/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/fddf0431/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
deleted file mode 100644
index 9c11007..0000000
--- a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/configuration/kafka-broker.xml
+++ /dev/null
@@ -1,346 +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_metrics_reporters}}</value>
-    <description>
-      kafka ganglia metrics reporter and kafka timeline 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>
-  <property>
-    <name>kafka.timeline.metrics.reporter.enabled</name>
-    <value>true</value>
-    <description>Kafka timeline metrics reporter enable</description>
-  </property>
-  <property>
-    <name>kafka.timeline.metrics.host</name>
-    <value>{{metric_collector_host}}</value>
-    <description>Timeline host</description>
-  </property>
-  <property>
-    <name>kafka.timeline.metrics.port</name>
-    <value>{{metric_collector_port}}</value>
-    <description>Timeline port</description>
-  </property>
-  <property>
-    <name>kafka.timeline.metrics.reporter.sendInterval</name>
-    <value>5900</value>
-    <description>Timeline metrics reporter send interval</description>
-  </property>
-    <property>
-    <name>kafka.timeline.metrics.maxRowCacheSize</name>
-    <value>10000</value>
-    <description>Timeline metrics reporter send interval</description>
-  </property>
-</configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/fddf0431/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
deleted file mode 100644
index f322406..0000000
--- a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/configuration/kafka-env.xml
+++ /dev/null
@@ -1,61 +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
-
-# Add kafka sink to classpath and related depenencies
-if [ -e "/usr/lib/ambari-metrics-kafka-sink/ambari-metrics-kafka-sink.jar" ]; then
-  export CLASSPATH=$CLASSPATH:/usr/lib/ambari-metrics-kafka-sink/ambari-metrics-kafka-sink.jar
-  export CLASSPATH=$CLASSPATH:/usr/lib/ambari-metrics-kafka-sink/lib/*
-fi
-    </value>
-  </property>
-</configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/fddf0431/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
deleted file mode 100644
index 901859e..0000000
--- a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/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/fddf0431/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
deleted file mode 100644
index 0552ada..0000000
--- a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/metainfo.xml
+++ /dev/null
@@ -1,82 +0,0 @@
-<?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>1200</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/fddf0431/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
deleted file mode 100644
index 826c0e8..0000000
--- a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/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/fddf0431/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
deleted file mode 100644
index f00575e..0000000
--- a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/kafka.py
+++ /dev/null
@@ -1,75 +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_server_config['kafka.metrics.reporters'] = params.kafka_metrics_reporters
-    if(params.has_metric_collector):
-            kafka_server_config['kafka.timeline.metrics.host'] = params.metric_collector_host
-            kafka_server_config['kafka.timeline.metrics.port'] = params.metric_collector_port
-
-    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/fddf0431/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
deleted file mode 100644
index ce72353..0000000
--- a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/kafka_broker.py
+++ /dev/null
@@ -1,73 +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
-import upgrade
-
-from kafka import kafka
-
-class KafkaBroker(Script):
-
-  def get_stack_to_component(self):
-    return {"HDP": "kafka-broker"}
-
-  def install(self, env):
-    self.install_packages(env)
-    self.configure(env)
-
-  def configure(self, env):
-    import params
-    env.set_params(params)
-    kafka()
-
-  def pre_rolling_restart(self, env):
-    import params
-    env.set_params(params)
-    upgrade.prestart(env, "kafka-broker")
-
-  def start(self, env, rolling_restart=False):
-    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, rolling_restart=False):
-    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/fddf0431/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
deleted file mode 100644
index 39bec56..0000000
--- a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/params.py
+++ /dev/null
@@ -1,91 +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.libraries.functions.default import default
-from resource_management import *
-import status_params
-
-# server configurations
-config = Script.get_config()
-
-stack_name = default("/hostLevelParams/stack_name", None)
-
-version = default("/commandParams/version", None)
-
-stack_version_unformatted = str(config['hostLevelParams']['stack_version'])
-hdp_stack_version = format_hdp_stack_version(stack_version_unformatted)
-
-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
-
-if 'ganglia_server_host' in config['clusterHostInfo'] and \
-    len(config['clusterHostInfo']['ganglia_server_host'])>0:
-  ganglia_installed = True
-  ganglia_server = config['clusterHostInfo']['ganglia_server_host'][0]
-  ganglia_report_interval = 60
-else:
-  ganglia_installed = False
-
-kafka_metrics_reporters=""
-metric_collector_host = ""
-metric_collector_port = ""
-
-if ganglia_installed:
-  kafka_metrics_reporters = "kafka.ganglia.KafkaGangliaMetricsReporter"
-
-ams_collector_hosts = default("/clusterHostInfo/metric_collector_hosts", [])
-has_metric_collector = not len(ams_collector_hosts) == 0
-
-if has_metric_collector:
-  metric_collector_host = ams_collector_hosts[0]
-  metric_collector_port = default("/configurations/ams-site/timeline.metrics.service.webapp.address", "0.0.0.0:8188")
-  if metric_collector_port and metric_collector_port.find(':') != -1:
-    metric_collector_port = metric_collector_port.split(':')[1]
-
-  if not len(kafka_metrics_reporters) == 0:
-      kafka_metrics_reporters = kafka_metrics_reporters + ','
-
-  kafka_metrics_reporters = kafka_metrics_reporters + "org.apache.hadoop.metrics2.sink.kafka.KafkaTimelineMetricsReporter"

http://git-wip-us.apache.org/repos/asf/ambari/blob/fddf0431/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
deleted file mode 100644
index 56bab2c..0000000
--- a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/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/fddf0431/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
deleted file mode 100644
index b10b602..0000000
--- a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/service_check.py
+++ /dev/null
@@ -1,52 +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 ServiceCheck(Script):
-  def service_check(self, env):
-      import params
-      env.set_params(params)
-      
-      kafka_config = self.read_kafka_config()
-      
-      create_topic_cmd_created_output = "Created topic \"ambari_kafka_service_check\"."
-      create_topic_cmd_exists_output = "Topic \"ambari_kafka_service_check\" already exists."
-      
-      source_cmd = format("source {conf_dir}/kafka-env.sh")
-      create_topic_cmd = format("{kafka_home}/bin/kafka-topics.sh --zookeeper {kafka_config[zookeeper.connect]} --create --topic ambari_kafka_service_check --partitions 1 --replication-factor 1")
-      
-      print "Running kafka create topic command"
-      Execute(format("{source_cmd} ; {create_topic_cmd} | grep '{create_topic_cmd_created_output}\|{create_topic_cmd_exists_output}'"),
-              logoutput=True,
-      )
-
-  def read_kafka_config(self):
-    import params
-    
-    kafka_config = {}
-    with open(params.conf_dir+"/server.properties","r") as conf_file:
-      for line in conf_file:
-          key,value = line.split("=")
-          kafka_config[key] = value.replace("\n","")
-    
-    return kafka_config
-
-if __name__ == "__main__":
-    ServiceCheck().execute()

http://git-wip-us.apache.org/repos/asf/ambari/blob/fddf0431/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
deleted file mode 100644
index fcb0816..0000000
--- a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/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/fddf0431/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/upgrade.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/upgrade.py b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/upgrade.py
deleted file mode 100644
index c031fa6..0000000
--- a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/upgrade.py
+++ /dev/null
@@ -1,29 +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 resource_management.core.resources.system import Execute
-from resource_management.libraries.functions.version import compare_versions, format_hdp_stack_version
-
-def prestart(env, hdp_component):
-  import params
-
-  if params.version and compare_versions(format_hdp_stack_version(params.version), '2.2.0.0') >= 0:
-    Execute("hdp-select set {0} {1}".format(hdp_component, params.version))

http://git-wip-us.apache.org/repos/asf/ambari/blob/fddf0431/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/alerts.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/alerts.json b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/alerts.json
new file mode 100644
index 0000000..4c9884c
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/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/fddf0431/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/configuration/kafka-broker.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/configuration/kafka-broker.xml b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/configuration/kafka-broker.xml
new file mode 100644
index 0000000..9c11007
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/configuration/kafka-broker.xml
@@ -0,0 +1,346 @@
+<?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_metrics_reporters}}</value>
+    <description>
+      kafka ganglia metrics reporter and kafka timeline 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>
+  <property>
+    <name>kafka.timeline.metrics.reporter.enabled</name>
+    <value>true</value>
+    <description>Kafka timeline metrics reporter enable</description>
+  </property>
+  <property>
+    <name>kafka.timeline.metrics.host</name>
+    <value>{{metric_collector_host}}</value>
+    <description>Timeline host</description>
+  </property>
+  <property>
+    <name>kafka.timeline.metrics.port</name>
+    <value>{{metric_collector_port}}</value>
+    <description>Timeline port</description>
+  </property>
+  <property>
+    <name>kafka.timeline.metrics.reporter.sendInterval</name>
+    <value>5900</value>
+    <description>Timeline metrics reporter send interval</description>
+  </property>
+    <property>
+    <name>kafka.timeline.metrics.maxRowCacheSize</name>
+    <value>10000</value>
+    <description>Timeline metrics reporter send interval</description>
+  </property>
+</configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/fddf0431/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/configuration/kafka-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/configuration/kafka-env.xml b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/configuration/kafka-env.xml
new file mode 100644
index 0000000..f322406
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/configuration/kafka-env.xml
@@ -0,0 +1,61 @@
+<?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
+
+# Add kafka sink to classpath and related depenencies
+if [ -e "/usr/lib/ambari-metrics-kafka-sink/ambari-metrics-kafka-sink.jar" ]; then
+  export CLASSPATH=$CLASSPATH:/usr/lib/ambari-metrics-kafka-sink/ambari-metrics-kafka-sink.jar
+  export CLASSPATH=$CLASSPATH:/usr/lib/ambari-metrics-kafka-sink/lib/*
+fi
+    </value>
+  </property>
+</configuration>