You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by jl...@apache.org on 2014/12/17 21:05:47 UTC
[15/37] ambari git commit: AMBARI-8745: Common Services: Refactor
HDP2.0.6 FLUME, GANGLIA, HBASE services (Jayush Luniya)
http://git-wip-us.apache.org/repos/asf/ambari/blob/b4cd4cb7/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/files/draining_servers.rb
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/files/draining_servers.rb b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/files/draining_servers.rb
deleted file mode 100644
index 5bcb5b6..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/files/draining_servers.rb
+++ /dev/null
@@ -1,164 +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.
-#
-
-# Add or remove servers from draining mode via zookeeper
-
-require 'optparse'
-include Java
-
-import org.apache.hadoop.hbase.HBaseConfiguration
-import org.apache.hadoop.hbase.client.HBaseAdmin
-import org.apache.hadoop.hbase.zookeeper.ZKUtil
-import org.apache.commons.logging.Log
-import org.apache.commons.logging.LogFactory
-
-# Name of this script
-NAME = "draining_servers"
-
-# Do command-line parsing
-options = {}
-optparse = OptionParser.new do |opts|
- opts.banner = "Usage: ./hbase org.jruby.Main #{NAME}.rb [options] add|remove|list <hostname>|<host:port>|<servername> ..."
- opts.separator 'Add remove or list servers in draining mode. Can accept either hostname to drain all region servers' +
- 'in that host, a host:port pair or a host,port,startCode triplet. More than one server can be given separated by space'
- opts.on('-h', '--help', 'Display usage information') do
- puts opts
- exit
- end
- options[:debug] = false
- opts.on('-d', '--debug', 'Display extra debug logging') do
- options[:debug] = true
- end
-end
-optparse.parse!
-
-# Return array of servernames where servername is hostname+port+startcode
-# comma-delimited
-def getServers(admin)
- serverInfos = admin.getClusterStatus().getServerInfo()
- servers = []
- for server in serverInfos
- servers << server.getServerName()
- end
- return servers
-end
-
-def getServerNames(hostOrServers, config)
- ret = []
-
- for hostOrServer in hostOrServers
- # check whether it is already serverName. No need to connect to cluster
- parts = hostOrServer.split(',')
- if parts.size() == 3
- ret << hostOrServer
- else
- admin = HBaseAdmin.new(config) if not admin
- servers = getServers(admin)
-
- hostOrServer = hostOrServer.gsub(/:/, ",")
- for server in servers
- ret << server if server.start_with?(hostOrServer)
- end
- end
- end
-
- admin.close() if admin
- return ret
-end
-
-def addServers(options, hostOrServers)
- config = HBaseConfiguration.create()
- servers = getServerNames(hostOrServers, config)
-
- zkw = org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.new(config, "draining_servers", nil)
- parentZnode = zkw.drainingZNode
-
- begin
- for server in servers
- node = ZKUtil.joinZNode(parentZnode, server)
- ZKUtil.createAndFailSilent(zkw, node)
- end
- ensure
- zkw.close()
- end
-end
-
-def removeServers(options, hostOrServers)
- config = HBaseConfiguration.create()
- servers = getServerNames(hostOrServers, config)
-
- zkw = org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.new(config, "draining_servers", nil)
- parentZnode = zkw.drainingZNode
-
- begin
- for server in servers
- node = ZKUtil.joinZNode(parentZnode, server)
- ZKUtil.deleteNodeFailSilent(zkw, node)
- end
- ensure
- zkw.close()
- end
-end
-
-# list servers in draining mode
-def listServers(options)
- config = HBaseConfiguration.create()
-
- zkw = org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.new(config, "draining_servers", nil)
- parentZnode = zkw.drainingZNode
-
- servers = ZKUtil.listChildrenNoWatch(zkw, parentZnode)
- servers.each {|server| puts server}
-end
-
-hostOrServers = ARGV[1..ARGV.size()]
-
-# Create a logger and disable the DEBUG-level annoying client logging
-def configureLogging(options)
- apacheLogger = LogFactory.getLog(NAME)
- # Configure log4j to not spew so much
- unless (options[:debug])
- logger = org.apache.log4j.Logger.getLogger("org.apache.hadoop.hbase")
- logger.setLevel(org.apache.log4j.Level::WARN)
- logger = org.apache.log4j.Logger.getLogger("org.apache.zookeeper")
- logger.setLevel(org.apache.log4j.Level::WARN)
- end
- return apacheLogger
-end
-
-# Create a logger and save it to ruby global
-$LOG = configureLogging(options)
-case ARGV[0]
- when 'add'
- if ARGV.length < 2
- puts optparse
- exit 1
- end
- addServers(options, hostOrServers)
- when 'remove'
- if ARGV.length < 2
- puts optparse
- exit 1
- end
- removeServers(options, hostOrServers)
- when 'list'
- listServers(options)
- else
- puts optparse
- exit 3
-end
http://git-wip-us.apache.org/repos/asf/ambari/blob/b4cd4cb7/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/files/hbaseSmokeVerify.sh
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/files/hbaseSmokeVerify.sh b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/files/hbaseSmokeVerify.sh
deleted file mode 100644
index 5c320c0..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/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/b4cd4cb7/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/__init__.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/__init__.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/__init__.py
deleted file mode 100644
index 5561e10..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/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/b4cd4cb7/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/functions.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/functions.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/functions.py
deleted file mode 100644
index e6e7fb9..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/functions.py
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/usr/bin/env python
-"""
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-"""
-
-import os
-import re
-import math
-import datetime
-
-from resource_management.core.shell import checked_call
-
-def calc_xmn_from_xms(heapsize_str, xmn_percent, xmn_max):
- """
- @param heapsize_str: str (e.g '1000m')
- @param xmn_percent: float (e.g 0.2)
- @param xmn_max: integer (e.g 512)
- """
- heapsize = int(re.search('\d+',heapsize_str).group(0))
- heapsize_unit = re.search('\D+',heapsize_str).group(0)
- xmn_val = int(math.floor(heapsize*xmn_percent))
- xmn_val -= xmn_val % 8
-
- result_xmn_val = xmn_max if xmn_val > xmn_max else xmn_val
- return str(result_xmn_val) + heapsize_unit
http://git-wip-us.apache.org/repos/asf/ambari/blob/b4cd4cb7/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/hbase.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/hbase.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/hbase.py
deleted file mode 100644
index ea99288..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/hbase.py
+++ /dev/null
@@ -1,158 +0,0 @@
-#!/usr/bin/env python
-"""
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-"""
-import os
-
-from resource_management import *
-import sys
-
-def hbase(name=None # 'master' or 'regionserver' or 'client'
- ):
- import params
-
- Directory( params.hbase_conf_dir_prefix,
- mode=0755
- )
-
- Directory( params.hbase_conf_dir,
- owner = params.hbase_user,
- group = params.user_group,
- recursive = True
- )
-
- Directory (params.tmp_dir,
- owner = params.hbase_user,
- mode=0775,
- recursive = True,
- recursive_permission = True
- )
-
- Directory (params.local_dir,
- owner = params.hbase_user,
- group = params.user_group,
- mode=0775,
- recursive = True
- )
-
- Directory (os.path.join(params.local_dir, "jars"),
- owner = params.hbase_user,
- group = params.user_group,
- mode=0775,
- recursive = True
- )
-
- XmlConfig( "hbase-site.xml",
- conf_dir = params.hbase_conf_dir,
- configurations = params.config['configurations']['hbase-site'],
- configuration_attributes=params.config['configuration_attributes']['hbase-site'],
- owner = params.hbase_user,
- group = params.user_group
- )
-
- if 'hdfs-site' in params.config['configurations']:
- XmlConfig( "hdfs-site.xml",
- conf_dir = params.hbase_conf_dir,
- configurations = params.config['configurations']['hdfs-site'],
- configuration_attributes=params.config['configuration_attributes']['hdfs-site'],
- owner = params.hbase_user,
- group = params.user_group
- )
-
- XmlConfig("hdfs-site.xml",
- conf_dir=params.hadoop_conf_dir,
- configurations=params.config['configurations']['hdfs-site'],
- configuration_attributes=params.config['configuration_attributes']['hdfs-site'],
- owner=params.hdfs_user,
- group=params.user_group
- )
-
- if 'hbase-policy' in params.config['configurations']:
- XmlConfig( "hbase-policy.xml",
- conf_dir = params.hbase_conf_dir,
- configurations = params.config['configurations']['hbase-policy'],
- configuration_attributes=params.config['configuration_attributes']['hbase-policy'],
- owner = params.hbase_user,
- group = params.user_group
- )
- # Manually overriding ownership of file installed by hadoop package
- else:
- File( format("{params.hbase_conf_dir}/hbase-policy.xml"),
- owner = params.hbase_user,
- group = params.user_group
- )
-
- File(format("{hbase_conf_dir}/hbase-env.sh"),
- owner = params.hbase_user,
- content=InlineTemplate(params.hbase_env_sh_template)
- )
-
- hbase_TemplateConfig( params.metric_prop_file_name,
- tag = 'GANGLIA-MASTER' if name == 'master' else 'GANGLIA-RS'
- )
-
- hbase_TemplateConfig( 'regionservers')
-
- if params.security_enabled:
- hbase_TemplateConfig( format("hbase_{name}_jaas.conf"))
-
- if name != "client":
- Directory( params.pid_dir,
- owner = params.hbase_user,
- recursive = True
- )
-
- Directory (params.log_dir,
- owner = params.hbase_user,
- recursive = True
- )
-
- if (params.log4j_props != None):
- File(format("{params.hbase_conf_dir}/log4j.properties"),
- mode=0644,
- group=params.user_group,
- owner=params.hbase_user,
- content=params.log4j_props
- )
- elif (os.path.exists(format("{params.hbase_conf_dir}/log4j.properties"))):
- File(format("{params.hbase_conf_dir}/log4j.properties"),
- mode=0644,
- group=params.user_group,
- owner=params.hbase_user
- )
- if name in ["master","regionserver"]:
- params.HdfsDirectory(params.hbase_hdfs_root_dir,
- action="create_delayed",
- owner=params.hbase_user
- )
- params.HdfsDirectory(params.hbase_staging_dir,
- action="create_delayed",
- owner=params.hbase_user,
- mode=0711
- )
- params.HdfsDirectory(None, action="create")
-
-def hbase_TemplateConfig(name,
- tag=None
- ):
- import params
-
- TemplateConfig( format("{hbase_conf_dir}/{name}"),
- owner = params.hbase_user,
- template_tag = tag
- )
http://git-wip-us.apache.org/repos/asf/ambari/blob/b4cd4cb7/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/hbase_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/hbase_client.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/hbase_client.py
deleted file mode 100644
index 043ad11..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/hbase_client.py
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/usr/bin/env python
-"""
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-"""
-
-import sys
-from resource_management import *
-
-from hbase import hbase
-
-
-class HbaseClient(Script):
- def install(self, env):
- self.install_packages(env)
- self.configure(env)
-
- def configure(self, env):
- import params
- env.set_params(params)
-
- hbase(name='client')
-
- def status(self, env):
- raise ClientComponentHasNoStatus()
-
-
-if __name__ == "__main__":
- HbaseClient().execute()
http://git-wip-us.apache.org/repos/asf/ambari/blob/b4cd4cb7/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/hbase_decommission.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/hbase_decommission.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/hbase_decommission.py
deleted file mode 100644
index a623927..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/hbase_decommission.py
+++ /dev/null
@@ -1,74 +0,0 @@
-#!/usr/bin/env python
-"""
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-"""
-
-from resource_management import *
-
-
-def hbase_decommission(env):
- import params
-
- env.set_params(params)
- kinit_cmd = params.kinit_cmd
-
- File(params.region_drainer,
- content=StaticFile("draining_servers.rb"),
- mode=0755
- )
-
- if params.hbase_excluded_hosts and params.hbase_excluded_hosts.split(","):
- hosts = params.hbase_excluded_hosts.split(",")
- elif params.hbase_included_hosts and params.hbase_included_hosts.split(","):
- hosts = params.hbase_included_hosts.split(",")
-
- if params.hbase_drain_only:
- for host in hosts:
- if host:
- regiondrainer_cmd = format(
- "{kinit_cmd} {hbase_cmd} --config {hbase_conf_dir} org.jruby.Main {region_drainer} remove {host}")
- Execute(regiondrainer_cmd,
- user=params.hbase_user,
- logoutput=True
- )
- pass
- pass
-
- else:
- for host in hosts:
- if host:
- regiondrainer_cmd = format(
- "{kinit_cmd} {hbase_cmd} --config {hbase_conf_dir} org.jruby.Main {region_drainer} add {host}")
- regionmover_cmd = format(
- "{kinit_cmd} {hbase_cmd} --config {hbase_conf_dir} org.jruby.Main {region_mover} unload {host}")
-
- Execute(regiondrainer_cmd,
- user=params.hbase_user,
- logoutput=True
- )
-
- Execute(regionmover_cmd,
- user=params.hbase_user,
- logoutput=True
- )
- pass
- pass
- pass
-
-
- pass
http://git-wip-us.apache.org/repos/asf/ambari/blob/b4cd4cb7/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/hbase_master.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/hbase_master.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/hbase_master.py
deleted file mode 100644
index c0e84b4..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/hbase_master.py
+++ /dev/null
@@ -1,76 +0,0 @@
-#!/usr/bin/env python
-"""
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-"""
-
-import sys
-from resource_management import *
-
-from hbase import hbase
-from hbase_service import hbase_service
-from hbase_decommission import hbase_decommission
-import upgrade
-
-
-class HbaseMaster(Script):
- def install(self, env):
- self.install_packages(env)
-
- def configure(self, env):
- import params
- env.set_params(params)
-
- hbase(name='master')
-
- def pre_rolling_restart(self, env):
- import params
- env.set_params(params)
- upgrade.prestart(env, "hbase-master")
-
- def start(self, env, rolling_restart=False):
- import params
- env.set_params(params)
- self.configure(env) # for security
-
- hbase_service( 'master',
- action = 'start'
- )
-
- def stop(self, env, rolling_restart=False):
- import params
- env.set_params(params)
-
- hbase_service( 'master',
- action = 'stop'
- )
-
- def status(self, env):
- import status_params
- env.set_params(status_params)
- pid_file = format("{pid_dir}/hbase-{hbase_user}-master.pid")
- check_process_status(pid_file)
-
- def decommission(self, env):
- import params
- env.set_params(params)
-
- hbase_decommission(env)
-
-
-if __name__ == "__main__":
- HbaseMaster().execute()
http://git-wip-us.apache.org/repos/asf/ambari/blob/b4cd4cb7/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/hbase_regionserver.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/hbase_regionserver.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/hbase_regionserver.py
deleted file mode 100644
index ea8e3d4..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/hbase_regionserver.py
+++ /dev/null
@@ -1,78 +0,0 @@
-#!/usr/bin/env python
-"""
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-"""
-
-import sys
-from resource_management import *
-
-from hbase import hbase
-from hbase_service import hbase_service
-import upgrade
-
-
-class HbaseRegionServer(Script):
- def install(self, env):
- self.install_packages(env)
-
- def configure(self, env):
- import params
- env.set_params(params)
-
- hbase(name='regionserver')
-
- def pre_rolling_restart(self, env):
- import params
- env.set_params(params)
- upgrade.prestart(env, "hbase-regionserver")
-
- def post_rolling_restart(self, env):
- import params
- env.set_params(params)
- upgrade.post_regionserver(env)
-
- def start(self, env, rolling_restart=False):
- import params
- env.set_params(params)
- self.configure(env) # for security
-
- hbase_service( 'regionserver',
- action = 'start'
- )
-
-
- def stop(self, env, rolling_restart=False):
- import params
- env.set_params(params)
-
- hbase_service( 'regionserver',
- action = 'stop'
- )
-
- def status(self, env):
- import status_params
- env.set_params(status_params)
- pid_file = format("{pid_dir}/hbase-{hbase_user}-regionserver.pid")
- check_process_status(pid_file)
-
- def decommission(self, env):
- print "Decommission not yet implemented!"
-
-
-if __name__ == "__main__":
- HbaseRegionServer().execute()
http://git-wip-us.apache.org/repos/asf/ambari/blob/b4cd4cb7/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/hbase_service.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/hbase_service.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/hbase_service.py
deleted file mode 100644
index 99cae6a..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/hbase_service.py
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/usr/bin/env python
-"""
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-"""
-
-from resource_management import *
-
-def hbase_service(
- name,
- action = 'start'): # 'start' or 'stop' or 'status'
-
- import params
-
- role = name
- cmd = format("{daemon_script} --config {hbase_conf_dir}")
- pid_file = format("{pid_dir}/hbase-{hbase_user}-{role}.pid")
- no_op_test = format("ls {pid_file} >/dev/null 2>&1 && ps -p `cat {pid_file}` >/dev/null 2>&1")
-
- if action == 'start':
- daemon_cmd = format("{cmd} start {role}")
-
- Execute ( daemon_cmd,
- not_if = no_op_test,
- user = params.hbase_user
- )
- elif action == 'stop':
- daemon_cmd = format("{cmd} stop {role}")
-
- Execute ( daemon_cmd,
- user = params.hbase_user,
- # BUGFIX: hbase regionserver sometimes hangs when nn is in safemode
- timeout = 30,
- on_timeout = format("! ( {no_op_test} ) || sudo -H -E kill -9 `cat {pid_file}`"),
- )
-
- Execute (format("rm -f {pid_file}"))
http://git-wip-us.apache.org/repos/asf/ambari/blob/b4cd4cb7/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/params.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/params.py
deleted file mode 100644
index 79d47bf..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/params.py
+++ /dev/null
@@ -1,147 +0,0 @@
-#!/usr/bin/env python
-"""
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-"""
-
-from functions import calc_xmn_from_xms
-from resource_management.libraries.functions.version import format_hdp_stack_version, compare_versions
-from resource_management import *
-import status_params
-
-# server configurations
-config = Script.get_config()
-exec_tmp_dir = Script.get_tmp_dir()
-
-version = default("/commandParams/version", None)
-
-hdp_stack_version = str(config['hostLevelParams']['stack_version'])
-hdp_stack_version = format_hdp_stack_version(hdp_stack_version)
-
-#hadoop params
-if hdp_stack_version != "" and compare_versions(hdp_stack_version, '2.2') >= 0:
- hadoop_bin_dir = format("/usr/hdp/current/hadoop-client/bin")
- daemon_script = format('/usr/hdp/current/hbase-client/bin/hbase-daemon.sh')
- region_mover = format('/usr/hdp/current/hbase-client/bin/region_mover.rb')
- region_drainer = format('/usr/hdp/current/hbase-client/bin/draining_servers.rb')
- hbase_cmd = format('/usr/hdp/current/hbase-client/bin/hbase')
-else:
- hadoop_bin_dir = "/usr/bin"
- daemon_script = "/usr/lib/hbase/bin/hbase-daemon.sh"
- region_mover = "/usr/lib/hbase/bin/region_mover.rb"
- region_drainer = "/usr/lib/hbase/bin/draining_servers.rb"
- hbase_cmd = "/usr/lib/hbase/bin/hbase"
-
-hadoop_conf_dir = "/etc/hadoop/conf"
-hbase_conf_dir_prefix = "/etc/hbase"
-hbase_conf_dir = format("{hbase_conf_dir_prefix}/conf")
-hbase_excluded_hosts = config['commandParams']['excluded_hosts']
-hbase_drain_only = default("/commandParams/mark_draining_only",False)
-hbase_included_hosts = config['commandParams']['included_hosts']
-
-hbase_user = status_params.hbase_user
-hbase_principal_name = config['configurations']['hbase-env']['hbase_principal_name']
-smokeuser = config['configurations']['cluster-env']['smokeuser']
-_authentication = config['configurations']['core-site']['hadoop.security.authentication']
-security_enabled = config['configurations']['cluster-env']['security_enabled']
-
-# this is "hadoop-metrics.properties" for 1.x stacks
-metric_prop_file_name = "hadoop-metrics2-hbase.properties"
-
-# not supporting 32 bit jdk.
-java64_home = config['hostLevelParams']['java_home']
-
-log_dir = config['configurations']['hbase-env']['hbase_log_dir']
-master_heapsize = config['configurations']['hbase-env']['hbase_master_heapsize']
-
-regionserver_heapsize = config['configurations']['hbase-env']['hbase_regionserver_heapsize']
-regionserver_xmn_max = config['configurations']['hbase-env']['hbase_regionserver_xmn_max']
-regionserver_xmn_percent = config['configurations']['hbase-env']['hbase_regionserver_xmn_ratio']
-regionserver_xmn_size = calc_xmn_from_xms(regionserver_heapsize, regionserver_xmn_percent, regionserver_xmn_max)
-
-pid_dir = status_params.pid_dir
-tmp_dir = config['configurations']['hbase-site']['hbase.tmp.dir']
-# TODO UPGRADE default, update site during upgrade
-_local_dir_conf = default('/configurations/hbase-site/hbase.local.dir', "${hbase.tmp.dir}/local")
-local_dir = substitute_vars(_local_dir_conf, config['configurations']['hbase-site'])
-
-client_jaas_config_file = format("{hbase_conf_dir}/hbase_client_jaas.conf")
-master_jaas_config_file = format("{hbase_conf_dir}/hbase_master_jaas.conf")
-regionserver_jaas_config_file = format("{hbase_conf_dir}/hbase_regionserver_jaas.conf")
-
-ganglia_server_hosts = default('/clusterHostInfo/ganglia_server_host', []) # is not passed when ganglia is not present
-ganglia_server_host = '' if len(ganglia_server_hosts) == 0 else ganglia_server_hosts[0]
-
-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]
-
-# if hbase is selected the hbase_rs_hosts, should not be empty, but still default just in case
-if 'slave_hosts' in config['clusterHostInfo']:
- rs_hosts = default('/clusterHostInfo/hbase_rs_hosts', '/clusterHostInfo/slave_hosts') #if hbase_rs_hosts not given it is assumed that region servers on same nodes as slaves
-else:
- rs_hosts = default('/clusterHostInfo/hbase_rs_hosts', '/clusterHostInfo/all_hosts')
-
-smoke_test_user = config['configurations']['cluster-env']['smokeuser']
-smokeuser_permissions = "RWXCA"
-service_check_data = functions.get_unique_id_and_date()
-user_group = config['configurations']['cluster-env']["user_group"]
-
-if security_enabled:
- _hostname_lowercase = config['hostname'].lower()
- master_jaas_princ = config['configurations']['hbase-site']['hbase.master.kerberos.principal'].replace('_HOST',_hostname_lowercase)
- regionserver_jaas_princ = config['configurations']['hbase-site']['hbase.regionserver.kerberos.principal'].replace('_HOST',_hostname_lowercase)
-
-master_keytab_path = config['configurations']['hbase-site']['hbase.master.keytab.file']
-regionserver_keytab_path = config['configurations']['hbase-site']['hbase.regionserver.keytab.file']
-smoke_user_keytab = config['configurations']['cluster-env']['smokeuser_keytab']
-hbase_user_keytab = config['configurations']['hbase-env']['hbase_user_keytab']
-kinit_path_local = functions.get_kinit_path(["/usr/bin", "/usr/kerberos/bin", "/usr/sbin"])
-if security_enabled:
- kinit_cmd = format("{kinit_path_local} -kt {hbase_user_keytab} {hbase_principal_name};")
-else:
- kinit_cmd = ""
-
-#log4j.properties
-if (('hbase-log4j' in config['configurations']) and ('content' in config['configurations']['hbase-log4j'])):
- log4j_props = config['configurations']['hbase-log4j']['content']
-else:
- log4j_props = None
-
-hbase_env_sh_template = config['configurations']['hbase-env']['content']
-
-hbase_hdfs_root_dir = config['configurations']['hbase-site']['hbase.rootdir']
-hbase_staging_dir = "/apps/hbase/staging"
-#for create_hdfs_directory
-hostname = config["hostname"]
-hdfs_user_keytab = config['configurations']['hadoop-env']['hdfs_user_keytab']
-hdfs_user = config['configurations']['hadoop-env']['hdfs_user']
-hdfs_principal_name = config['configurations']['hadoop-env']['hdfs_principal_name']
-kinit_path_local = functions.get_kinit_path(["/usr/bin", "/usr/kerberos/bin", "/usr/sbin"])
-import functools
-#create partial functions with common arguments for every HdfsDirectory call
-#to create hdfs directory we need to call params.HdfsDirectory in code
-HdfsDirectory = functools.partial(
- HdfsDirectory,
- conf_dir=hadoop_conf_dir,
- hdfs_user=hdfs_user,
- security_enabled = security_enabled,
- keytab = hdfs_user_keytab,
- kinit_path_local = kinit_path_local,
- bin_dir = hadoop_bin_dir
-)
http://git-wip-us.apache.org/repos/asf/ambari/blob/b4cd4cb7/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/service_check.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/service_check.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/service_check.py
deleted file mode 100644
index 15a306b..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/service_check.py
+++ /dev/null
@@ -1,79 +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 functions
-
-
-class HbaseServiceCheck(Script):
- def service_check(self, env):
- import params
- env.set_params(params)
-
- output_file = "/apps/hbase/data/ambarismoketest"
- test_cmd = format("fs -test -e {output_file}")
- smokeuser_kinit_cmd = format("{kinit_path_local} -kt {smoke_user_keytab} {smoke_test_user};") if params.security_enabled else ""
- hbase_servicecheck_file = format("{exec_tmp_dir}/hbase-smoke.sh")
-
- File( format("{exec_tmp_dir}/hbaseSmokeVerify.sh"),
- content = StaticFile("hbaseSmokeVerify.sh"),
- mode = 0755
- )
-
- File( hbase_servicecheck_file,
- mode = 0755,
- content = Template('hbase-smoke.sh.j2')
- )
-
- if params.security_enabled:
- hbase_grant_premissions_file = format("{exec_tmp_dir}/hbase_grant_permissions.sh")
- grantprivelegecmd = format("{kinit_cmd} {hbase_cmd} shell {hbase_grant_premissions_file}")
-
- File( hbase_grant_premissions_file,
- owner = params.hbase_user,
- group = params.user_group,
- mode = 0644,
- content = Template('hbase_grant_permissions.j2')
- )
-
- Execute( grantprivelegecmd,
- user = params.hbase_user,
- )
-
- servicecheckcmd = format("{smokeuser_kinit_cmd} {hbase_cmd} --config {hbase_conf_dir} shell {hbase_servicecheck_file}")
- smokeverifycmd = format("{smokeuser_kinit_cmd} {exec_tmp_dir}/hbaseSmokeVerify.sh {hbase_conf_dir} {service_check_data} {hbase_cmd}")
-
- Execute( servicecheckcmd,
- tries = 3,
- try_sleep = 5,
- user = params.smoke_test_user,
- logoutput = True
- )
-
- Execute ( smokeverifycmd,
- tries = 3,
- try_sleep = 5,
- user = params.smoke_test_user,
- logoutput = True
- )
-
-if __name__ == "__main__":
- HbaseServiceCheck().execute()
-
http://git-wip-us.apache.org/repos/asf/ambari/blob/b4cd4cb7/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/status_params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/status_params.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/status_params.py
deleted file mode 100644
index 850ec8b..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/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()
-
-pid_dir = config['configurations']['hbase-env']['hbase_pid_dir']
-hbase_user = config['configurations']['hbase-env']['hbase_user']
http://git-wip-us.apache.org/repos/asf/ambari/blob/b4cd4cb7/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/upgrade.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/upgrade.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/upgrade.py
deleted file mode 100644
index 6f2e258..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/upgrade.py
+++ /dev/null
@@ -1,49 +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.core.shell import call
-from resource_management.libraries.functions.version import compare_versions, format_hdp_stack_version
-from resource_management.libraries.functions.decorator import retry
-
-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))
-
-def post_regionserver(env):
- import params
- env.set_params(params)
-
- check_cmd = "echo 'status \"simple\"' | {0} shell".format(params.hbase_cmd)
-
- exec_cmd = "{0} {1}".format(params.kinit_cmd, check_cmd)
- call_and_match(exec_cmd, params.hbase_user, params.hostname.lower() + ":")
-
-
-@retry(times=15, sleep_time=2, err_class=Fail)
-def call_and_match(cmd, user, regex):
-
- code, out = call(cmd, user=user)
-
- if not (out and re.search(regex, out)):
- raise Fail("Could not verify RS available")
http://git-wip-us.apache.org/repos/asf/ambari/blob/b4cd4cb7/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/templates/hadoop-metrics2-hbase.properties-GANGLIA-MASTER.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/templates/hadoop-metrics2-hbase.properties-GANGLIA-MASTER.j2 b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/templates/hadoop-metrics2-hbase.properties-GANGLIA-MASTER.j2
deleted file mode 100644
index b07378b..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/templates/hadoop-metrics2-hbase.properties-GANGLIA-MASTER.j2
+++ /dev/null
@@ -1,108 +0,0 @@
-{#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#}
-
-
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# See http://wiki.apache.org/hadoop/GangliaMetrics
-#
-# Make sure you know whether you are using ganglia 3.0 or 3.1.
-# If 3.1, you will have to patch your hadoop instance with HADOOP-4675
-# And, yes, this file is named hadoop-metrics.properties rather than
-# hbase-metrics.properties because we're leveraging the hadoop metrics
-# package and hadoop-metrics.properties is an hardcoded-name, at least
-# for the moment.
-#
-# See also http://hadoop.apache.org/hbase/docs/current/metrics.html
-
-# HBase-specific configuration to reset long-running stats (e.g. compactions)
-# If this variable is left out, then the default is no expiration.
-hbase.extendedperiod = 3600
-
-{% if has_metric_collector %}
-
-# HBase-specific configuration to reset long-running stats (e.g. compactions)
-# If this variable is left out, then the default is no expiration.
-hbase.extendedperiod = 3600
-
-*.sink.timline*.plugin.urls=file:///usr/lib/ambari-metrics-hadoop-sink/ambari-metrics-hadoop-sink.jar
-hbase.class=org.apache.hadoop.metrics2.sink.timeline.HadoopTimelineMetricsSink
-hbase.period=10
-hbase.collector={{metric_collector_host}}:8188
-
-jvm.class=org.apache.hadoop.metrics2.sink.timeline.HadoopTimelineMetricsSink
-jvm.period=10
-jvm.collector={{metric_collector_host}}:8188
-
-rpc.class=org.apache.hadoop.metrics2.sink.timeline.HadoopTimelineMetricsSink
-rpc.period=10
-rpc.collector={{metric_collector_host}}:8188
-
-hbase.sink.timeline.class=org.apache.hadoop.metrics2.sink.timeline.HadoopTimelineMetricsSink
-hbase.sink.timeline.period=10
-hbase.sink.timeline.collector={{metric_collector_host}}:8188
-
-{% else %}
-
-# Configuration of the "hbase" context for ganglia
-# Pick one: Ganglia 3.0 (former) or Ganglia 3.1 (latter)
-# hbase.class=org.apache.hadoop.metrics.ganglia.GangliaContext
-hbase.class=org.apache.hadoop.metrics.ganglia.GangliaContext31
-hbase.period=10
-hbase.servers={{ganglia_server_host}}:8663
-
-# Configuration of the "jvm" context for ganglia
-# Pick one: Ganglia 3.0 (former) or Ganglia 3.1 (latter)
-# jvm.class=org.apache.hadoop.metrics.ganglia.GangliaContext
-jvm.class=org.apache.hadoop.metrics.ganglia.GangliaContext31
-jvm.period=10
-jvm.servers={{ganglia_server_host}}:8663
-
-# Configuration of the "rpc" context for ganglia
-# Pick one: Ganglia 3.0 (former) or Ganglia 3.1 (latter)
-# rpc.class=org.apache.hadoop.metrics.ganglia.GangliaContext
-rpc.class=org.apache.hadoop.metrics.ganglia.GangliaContext31
-rpc.period=10
-rpc.servers={{ganglia_server_host}}:8663
-
-#Ganglia following hadoop example
-hbase.sink.ganglia.class=org.apache.hadoop.metrics2.sink.ganglia.GangliaSink31
-hbase.sink.ganglia.period=10
-
-# default for supportsparse is false
-*.sink.ganglia.supportsparse=true
-
-.sink.ganglia.slope=jvm.metrics.gcCount=zero,jvm.metrics.memHeapUsedM=both
-.sink.ganglia.dmax=jvm.metrics.threadsBlocked=70,jvm.metrics.memHeapUsedM=40
-
-hbase.sink.ganglia.servers={{ganglia_server_host}}:8663
-
-{% endif %}
http://git-wip-us.apache.org/repos/asf/ambari/blob/b4cd4cb7/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/templates/hadoop-metrics2-hbase.properties-GANGLIA-RS.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/templates/hadoop-metrics2-hbase.properties-GANGLIA-RS.j2 b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/templates/hadoop-metrics2-hbase.properties-GANGLIA-RS.j2
deleted file mode 100644
index d13540f..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/templates/hadoop-metrics2-hbase.properties-GANGLIA-RS.j2
+++ /dev/null
@@ -1,102 +0,0 @@
-{#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#}
-
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# See http://wiki.apache.org/hadoop/GangliaMetrics
-#
-# Make sure you know whether you are using ganglia 3.0 or 3.1.
-# If 3.1, you will have to patch your hadoop instance with HADOOP-4675
-# And, yes, this file is named hadoop-metrics.properties rather than
-# hbase-metrics.properties because we're leveraging the hadoop metrics
-# package and hadoop-metrics.properties is an hardcoded-name, at least
-# for the moment.
-#
-# See also http://hadoop.apache.org/hbase/docs/current/metrics.html
-
-# HBase-specific configuration to reset long-running stats (e.g. compactions)
-# If this variable is left out, then the default is no expiration.
-hbase.extendedperiod = 3600
-
-{% if has_metric_collector %}
-
-hbase.class=org.apache.hadoop.metrics2.sink.timeline.HadoopTimelineMetricsSink
-hbase.period=10
-hbase.collector={{metric_collector_host}}:8188
-
-jvm.class=org.apache.hadoop.metrics2.sink.timeline.HadoopTimelineMetricsSink
-jvm.period=10
-jvm.collector={{metric_collector_host}}:8188
-
-rpc.class=org.apache.hadoop.metrics2.sink.timeline.HadoopTimelineMetricsSink
-rpc.period=10
-rpc.collector={{metric_collector_host}}:8188
-
-hbase.sink.timeline.class=org.apache.hadoop.metrics2.sink.timeline.HadoopTimelineMetricsSink
-hbase.sink.timeline.period=10
-hbase.sink.timeline.collector={{metric_collector_host}}:8188
-
-{% else %}
-
-# Configuration of the "hbase" context for ganglia
-# Pick one: Ganglia 3.0 (former) or Ganglia 3.1 (latter)
-# hbase.class=org.apache.hadoop.metrics.ganglia.GangliaContext
-hbase.class=org.apache.hadoop.metrics.ganglia.GangliaContext31
-hbase.period=10
-hbase.servers={{ganglia_server_host}}:8656
-
-# Configuration of the "jvm" context for ganglia
-# Pick one: Ganglia 3.0 (former) or Ganglia 3.1 (latter)
-# jvm.class=org.apache.hadoop.metrics.ganglia.GangliaContext
-jvm.class=org.apache.hadoop.metrics.ganglia.GangliaContext31
-jvm.period=10
-jvm.servers={{ganglia_server_host}}:8656
-
-# Configuration of the "rpc" context for ganglia
-# Pick one: Ganglia 3.0 (former) or Ganglia 3.1 (latter)
-# rpc.class=org.apache.hadoop.metrics.ganglia.GangliaContext
-rpc.class=org.apache.hadoop.metrics.ganglia.GangliaContext31
-rpc.period=10
-rpc.servers={{ganglia_server_host}}:8656
-
-#Ganglia following hadoop example
-hbase.sink.ganglia.class=org.apache.hadoop.metrics2.sink.ganglia.GangliaSink31
-hbase.sink.ganglia.period=10
-
-# default for supportsparse is false
-*.sink.ganglia.supportsparse=true
-
-.sink.ganglia.slope=jvm.metrics.gcCount=zero,jvm.metrics.memHeapUsedM=both
-.sink.ganglia.dmax=jvm.metrics.threadsBlocked=70,jvm.metrics.memHeapUsedM=40
-
-hbase.sink.ganglia.servers={{ganglia_server_host}}:8656
-
-{% endif %}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/b4cd4cb7/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/templates/hbase-smoke.sh.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/templates/hbase-smoke.sh.j2 b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/templates/hbase-smoke.sh.j2
deleted file mode 100644
index 458da95..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/templates/hbase-smoke.sh.j2
+++ /dev/null
@@ -1,44 +0,0 @@
-{#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#}
-
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-disable 'ambarismoketest'
-drop 'ambarismoketest'
-create 'ambarismoketest','family'
-put 'ambarismoketest','row01','family:col01','{{service_check_data}}'
-scan 'ambarismoketest'
-exit
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/b4cd4cb7/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/templates/hbase_client_jaas.conf.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/templates/hbase_client_jaas.conf.j2 b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/templates/hbase_client_jaas.conf.j2
deleted file mode 100644
index 38f9721..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/templates/hbase_client_jaas.conf.j2
+++ /dev/null
@@ -1,23 +0,0 @@
-{#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#}
-
-Client {
-com.sun.security.auth.module.Krb5LoginModule required
-useKeyTab=false
-useTicketCache=true;
-};
http://git-wip-us.apache.org/repos/asf/ambari/blob/b4cd4cb7/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/templates/hbase_grant_permissions.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/templates/hbase_grant_permissions.j2 b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/templates/hbase_grant_permissions.j2
deleted file mode 100644
index 3378983..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/templates/hbase_grant_permissions.j2
+++ /dev/null
@@ -1,39 +0,0 @@
-{#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#}
-
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-grant '{{smoke_test_user}}', '{{smokeuser_permissions}}'
-exit
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/b4cd4cb7/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/templates/hbase_master_jaas.conf.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/templates/hbase_master_jaas.conf.j2 b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/templates/hbase_master_jaas.conf.j2
deleted file mode 100644
index a93c36c..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/templates/hbase_master_jaas.conf.j2
+++ /dev/null
@@ -1,26 +0,0 @@
-{#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#}
-
-Client {
-com.sun.security.auth.module.Krb5LoginModule required
-useKeyTab=true
-storeKey=true
-useTicketCache=false
-keyTab="{{master_keytab_path}}"
-principal="{{master_jaas_princ}}";
-};
http://git-wip-us.apache.org/repos/asf/ambari/blob/b4cd4cb7/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/templates/hbase_regionserver_jaas.conf.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/templates/hbase_regionserver_jaas.conf.j2 b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/templates/hbase_regionserver_jaas.conf.j2
deleted file mode 100644
index 7097481..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/templates/hbase_regionserver_jaas.conf.j2
+++ /dev/null
@@ -1,26 +0,0 @@
-{#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#}
-
-Client {
-com.sun.security.auth.module.Krb5LoginModule required
-useKeyTab=true
-storeKey=true
-useTicketCache=false
-keyTab="{{regionserver_keytab_path}}"
-principal="{{regionserver_jaas_princ}}";
-};
http://git-wip-us.apache.org/repos/asf/ambari/blob/b4cd4cb7/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/templates/regionservers.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/templates/regionservers.j2 b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/templates/regionservers.j2
deleted file mode 100644
index fc6cc37..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/templates/regionservers.j2
+++ /dev/null
@@ -1,20 +0,0 @@
-{#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#}
-
-{% for host in rs_hosts %}{{host}}
-{% endfor %}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/b4cd4cb7/ambari-server/src/test/python/stacks/2.0.6/FLUME/test_flume.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/FLUME/test_flume.py b/ambari-server/src/test/python/stacks/2.0.6/FLUME/test_flume.py
index 1a14b6a..7d97245 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/FLUME/test_flume.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/FLUME/test_flume.py
@@ -25,12 +25,16 @@ import os
class TestFlumeHandler(RMFTestCase):
-
+ COMMON_SERVICES_PACKAGE_DIR = "FLUME/1.4.0.2.0/package"
+ STACK_VERSION = "2.0.6"
+
def test_configure_default(self):
- self.executeScript("2.0.6/services/FLUME/package/scripts/flume_handler.py",
+ self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/flume_handler.py",
classname = "FlumeHandler",
command = "configure",
- config_file="default.json")
+ config_file="default.json",
+ hdp_stack_version = self.STACK_VERSION,
+ target = RMFTestCase.TARGET_COMMON_SERVICES)
self.assert_configure_default()
self.assertNoMoreResources()
@@ -44,9 +48,12 @@ class TestFlumeHandler(RMFTestCase):
os_path_isfile_mock.side_effect = [True, False]
cmd_target_names_mock.return_value = ["a1"]
- self.executeScript("2.0.6/services/FLUME/package/scripts/flume_handler.py",
- classname = "FlumeHandler", command = "start",
- config_file="default.json")
+ self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/flume_handler.py",
+ classname = "FlumeHandler",
+ command = "start",
+ config_file="default.json",
+ hdp_stack_version = self.STACK_VERSION,
+ target = RMFTestCase.TARGET_COMMON_SERVICES)
self.assert_configure_default()
@@ -70,10 +77,12 @@ class TestFlumeHandler(RMFTestCase):
def test_stop_default(self, set_desired_mock, glob_mock):
glob_mock.side_effect = [['/var/run/flume/a1/pid'], ['/etc/flume/conf/a1/ambari-meta.json']]
- self.executeScript("2.0.6/services/FLUME/package/scripts/flume_handler.py",
+ self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/flume_handler.py",
classname = "FlumeHandler",
command = "stop",
- config_file="default.json")
+ config_file="default.json",
+ hdp_stack_version = self.STACK_VERSION,
+ target = RMFTestCase.TARGET_COMMON_SERVICES)
self.assertTrue(glob_mock.called)
@@ -92,10 +101,12 @@ class TestFlumeHandler(RMFTestCase):
def test_status_default(self, sys_exit_mock, structured_out_mock):
try:
- self.executeScript("2.0.6/services/FLUME/package/scripts/flume_handler.py",
+ self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/flume_handler.py",
classname = "FlumeHandler",
command = "status",
- config_file="default.json")
+ config_file="default.json",
+ hdp_stack_version = self.STACK_VERSION,
+ target = RMFTestCase.TARGET_COMMON_SERVICES)
except:
# expected since ComponentIsNotRunning gets raised
pass
@@ -112,10 +123,12 @@ class TestFlumeHandler(RMFTestCase):
glob_mock.return_value = ['/etc/flume/conf/a1/ambari-meta.json']
try:
- self.executeScript("2.0.6/services/FLUME/package/scripts/flume_handler.py",
+ self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/flume_handler.py",
classname = "FlumeHandler",
command = "status",
- config_file="default.json")
+ config_file="default.json",
+ hdp_stack_version = self.STACK_VERSION,
+ target = RMFTestCase.TARGET_COMMON_SERVICES)
except:
# expected since ComponentIsNotRunning gets raised
pass
@@ -135,10 +148,12 @@ class TestFlumeHandler(RMFTestCase):
glob_mock.return_value = []
try:
- self.executeScript("2.0.6/services/FLUME/package/scripts/flume_handler.py",
+ self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/flume_handler.py",
classname = "FlumeHandler",
command = "status",
- config_file="default.json")
+ config_file="default.json",
+ hdp_stack_version = self.STACK_VERSION,
+ target = RMFTestCase.TARGET_COMMON_SERVICES)
except:
# expected since ComponentIsNotRunning gets raised
pass
@@ -230,10 +245,12 @@ class TestFlumeHandler(RMFTestCase):
# 2nd call is to check if the process is live - that should be False
os_path_isfile_mock.side_effect = [True, False]
- self.executeScript("2.0.6/services/FLUME/package/scripts/flume_handler.py",
+ self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/flume_handler.py",
classname = "FlumeHandler",
command = "start",
- config_file="flume_target.json")
+ config_file="flume_target.json",
+ hdp_stack_version = self.STACK_VERSION,
+ target = RMFTestCase.TARGET_COMMON_SERVICES)
self.assert_configure_many()
@@ -258,10 +275,12 @@ class TestFlumeHandler(RMFTestCase):
# 2nd call is to check if the process is live - that should be False
os_path_isfile_mock.side_effect = [True, False]
- self.executeScript("2.0.6/services/FLUME/package/scripts/flume_handler.py",
+ self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/flume_handler.py",
classname = "FlumeHandler",
command = "start",
- config_file="flume_target.json")
+ config_file="flume_target.json",
+ hdp_stack_version = self.STACK_VERSION,
+ target = RMFTestCase.TARGET_COMMON_SERVICES)
self.assert_configure_many()
@@ -282,10 +301,12 @@ class TestFlumeHandler(RMFTestCase):
def test_stop_single(self, glob_mock):
glob_mock.return_value = ['/var/run/flume/b1.pid']
- self.executeScript("2.0.6/services/FLUME/package/scripts/flume_handler.py",
+ self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/flume_handler.py",
classname = "FlumeHandler",
command = "stop",
- config_file="flume_target.json")
+ config_file="flume_target.json",
+ hdp_stack_version = self.STACK_VERSION,
+ target = RMFTestCase.TARGET_COMMON_SERVICES)
self.assertTrue(glob_mock.called)
@@ -301,10 +322,12 @@ class TestFlumeHandler(RMFTestCase):
def test_configure_with_existing(self, os_unlink_mock, expected_names_mock):
expected_names_mock.return_value = ["x1"]
- self.executeScript("2.0.6/services/FLUME/package/scripts/flume_handler.py",
+ self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/flume_handler.py",
classname = "FlumeHandler",
command = "configure",
- config_file="default.json")
+ config_file="default.json",
+ hdp_stack_version = self.STACK_VERSION,
+ target = RMFTestCase.TARGET_COMMON_SERVICES)
self.assertTrue(os_unlink_mock.called)
os_unlink_mock.assert_called_with('/etc/flume/conf/x1/ambari-meta.json')
@@ -314,10 +337,12 @@ class TestFlumeHandler(RMFTestCase):
def test_flume_env_not_22(self):
- self.executeScript("2.0.6/services/FLUME/package/scripts/flume_handler.py",
+ self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/flume_handler.py",
classname = "FlumeHandler",
command = "configure",
- config_file="default.json")
+ config_file="default.json",
+ hdp_stack_version = self.STACK_VERSION,
+ target = RMFTestCase.TARGET_COMMON_SERVICES)
self.assertResourceCalled('Directory', '/etc/flume/conf', recursive=True)
@@ -349,10 +374,12 @@ class TestFlumeHandler(RMFTestCase):
content=content)
def test_flume_env_with_22(self):
- self.executeScript("2.0.6/services/FLUME/package/scripts/flume_handler.py",
+ self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/flume_handler.py",
classname = "FlumeHandler",
command = "configure",
- config_file="flume_22.json")
+ config_file="flume_22.json",
+ hdp_stack_version = self.STACK_VERSION,
+ target = RMFTestCase.TARGET_COMMON_SERVICES)
self.assertResourceCalled('Directory', '/etc/flume/conf', recursive=True)
http://git-wip-us.apache.org/repos/asf/ambari/blob/b4cd4cb7/ambari-server/src/test/python/stacks/2.0.6/FLUME/test_service_check.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/FLUME/test_service_check.py b/ambari-server/src/test/python/stacks/2.0.6/FLUME/test_service_check.py
index 68acd37..c862880 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/FLUME/test_service_check.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/FLUME/test_service_check.py
@@ -22,12 +22,16 @@ from stacks.utils.RMFTestCase import *
class TestFlumeCheck(RMFTestCase):
+ COMMON_SERVICES_PACKAGE_DIR = "FLUME/1.4.0.2.0/package"
+ STACK_VERSION = "2.0.6"
def test_service_check(self):
- self.executeScript("2.0.6/services/FLUME/package/scripts/flume_check.py",
+ self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/flume_check.py",
classname="FlumeServiceCheck",
command="service_check",
- config_file="default.json"
+ config_file="default.json",
+ hdp_stack_version = self.STACK_VERSION,
+ target = RMFTestCase.TARGET_COMMON_SERVICES
)
self.assertResourceCalled('Execute', 'env JAVA_HOME=/usr/jdk64/jdk1.7.0_45 /usr/bin/flume-ng version',
http://git-wip-us.apache.org/repos/asf/ambari/blob/b4cd4cb7/ambari-server/src/test/python/stacks/2.0.6/GANGLIA/test_ganglia_monitor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/GANGLIA/test_ganglia_monitor.py b/ambari-server/src/test/python/stacks/2.0.6/GANGLIA/test_ganglia_monitor.py
index df15dff..67b88ca 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/GANGLIA/test_ganglia_monitor.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/GANGLIA/test_ganglia_monitor.py
@@ -22,12 +22,16 @@ from stacks.utils.RMFTestCase import *
class TestGangliaMonitor(RMFTestCase):
-
+ COMMON_SERVICES_PACKAGE_DIR = "GANGLIA/3.5.0/package"
+ STACK_VERSION = "2.0.6"
+
def test_configure_default(self):
- self.executeScript("2.0.6/services/GANGLIA/package/scripts/ganglia_monitor.py",
+ self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/ganglia_monitor.py",
classname="GangliaMonitor",
command="configure",
- config_file="default.json"
+ config_file="default.json",
+ hdp_stack_version = self.STACK_VERSION,
+ target = RMFTestCase.TARGET_COMMON_SERVICES
)
self.assert_configure_default()
self.assert_gmond_master_conf_generated()
@@ -35,20 +39,24 @@ class TestGangliaMonitor(RMFTestCase):
def test_configure_non_gmetad_node(self):
- self.executeScript("2.0.6/services/GANGLIA/package/scripts/ganglia_monitor.py",
+ self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/ganglia_monitor.py",
classname="GangliaMonitor",
command="configure",
config_file="default.non_gmetad_host.json",
+ hdp_stack_version = self.STACK_VERSION,
+ target = RMFTestCase.TARGET_COMMON_SERVICES
)
self.assert_configure_default()
self.assertNoMoreResources()
def test_start_default(self):
- self.executeScript("2.0.6/services/GANGLIA/package/scripts/ganglia_monitor.py",
+ self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/ganglia_monitor.py",
classname="GangliaMonitor",
command="start",
config_file="default.json",
+ hdp_stack_version = self.STACK_VERSION,
+ target = RMFTestCase.TARGET_COMMON_SERVICES
)
self.assert_configure_default()
self.assert_gmond_master_conf_generated()
@@ -59,10 +67,12 @@ class TestGangliaMonitor(RMFTestCase):
def test_stop_default(self):
- self.executeScript("2.0.6/services/GANGLIA/package/scripts/ganglia_monitor.py",
+ self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/ganglia_monitor.py",
classname="GangliaMonitor",
command="stop",
config_file="default.json",
+ hdp_stack_version = self.STACK_VERSION,
+ target = RMFTestCase.TARGET_COMMON_SERVICES
)
self.assertResourceCalled('Execute', 'service hdp-gmond stop >> /tmp/gmond.log 2>&1 ; /bin/ps auwx | /bin/grep [g]mond >> /tmp/gmond.log 2>&1',
path = ['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'],
@@ -71,10 +81,12 @@ class TestGangliaMonitor(RMFTestCase):
def test_install_default(self):
- self.executeScript("2.0.6/services/GANGLIA/package/scripts/ganglia_monitor.py",
+ self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/ganglia_monitor.py",
classname="GangliaMonitor",
command="install",
config_file="default.json",
+ hdp_stack_version = self.STACK_VERSION,
+ target = RMFTestCase.TARGET_COMMON_SERVICES
)
self.assert_configure_default()
self.assert_gmond_master_conf_generated()
http://git-wip-us.apache.org/repos/asf/ambari/blob/b4cd4cb7/ambari-server/src/test/python/stacks/2.0.6/GANGLIA/test_ganglia_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/GANGLIA/test_ganglia_server.py b/ambari-server/src/test/python/stacks/2.0.6/GANGLIA/test_ganglia_server.py
index b8050f4..470fcc7 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/GANGLIA/test_ganglia_server.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/GANGLIA/test_ganglia_server.py
@@ -22,21 +22,27 @@ from stacks.utils.RMFTestCase import *
from mock.mock import MagicMock, call, patch
class TestGangliaServer(RMFTestCase):
-
+ COMMON_SERVICES_PACKAGE_DIR = "GANGLIA/3.5.0/package"
+ STACK_VERSION = "2.0.6"
+
def test_configure_default(self):
- self.executeScript("2.0.6/services/GANGLIA/package/scripts/ganglia_server.py",
+ self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/ganglia_server.py",
classname="GangliaServer",
command="configure",
config_file="default.json",
+ hdp_stack_version = self.STACK_VERSION,
+ target = RMFTestCase.TARGET_COMMON_SERVICES
)
self.assert_configure_default()
self.assertNoMoreResources()
def test_start_default(self):
- self.executeScript("2.0.6/services/GANGLIA/package/scripts/ganglia_server.py",
+ self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/ganglia_server.py",
classname="GangliaServer",
command="start",
config_file="default.json",
+ hdp_stack_version = self.STACK_VERSION,
+ target = RMFTestCase.TARGET_COMMON_SERVICES
)
self.assert_configure_default()
self.assertResourceCalled('Execute', 'service hdp-gmetad start >> /tmp/gmetad.log 2>&1 ; /bin/ps auwx | /bin/grep [g]metad >> /tmp/gmetad.log 2>&1',
@@ -47,10 +53,12 @@ class TestGangliaServer(RMFTestCase):
self.assertNoMoreResources()
def test_stop_default(self):
- self.executeScript("2.0.6/services/GANGLIA/package/scripts/ganglia_server.py",
+ self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/ganglia_server.py",
classname="GangliaServer",
command="stop",
config_file="default.json",
+ hdp_stack_version = self.STACK_VERSION,
+ target = RMFTestCase.TARGET_COMMON_SERVICES
)
self.assertResourceCalled('Execute', 'service hdp-gmetad stop >> /tmp/gmetad.log 2>&1 ; /bin/ps auwx | /bin/grep [g]metad >> /tmp/gmetad.log 2>&1',
path = ['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'],
@@ -60,10 +68,12 @@ class TestGangliaServer(RMFTestCase):
self.assertNoMoreResources()
def test_install_default(self):
- self.executeScript("2.0.6/services/GANGLIA/package/scripts/ganglia_server.py",
+ self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/ganglia_server.py",
classname="GangliaServer",
command="install",
config_file="default.json",
+ hdp_stack_version = self.STACK_VERSION,
+ target = RMFTestCase.TARGET_COMMON_SERVICES
)
self.assert_configure_default()
http://git-wip-us.apache.org/repos/asf/ambari/blob/b4cd4cb7/ambari-server/src/test/python/stacks/2.0.6/HBASE/test_hbase_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/HBASE/test_hbase_client.py b/ambari-server/src/test/python/stacks/2.0.6/HBASE/test_hbase_client.py
index e1d52c5..9124d64 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HBASE/test_hbase_client.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HBASE/test_hbase_client.py
@@ -22,12 +22,16 @@ from stacks.utils.RMFTestCase import *
@patch("os.path.exists", new = MagicMock(return_value=True))
class TestHBaseClient(RMFTestCase):
-
+ COMMON_SERVICES_PACKAGE_DIR = "HBASE/0.96.0.2.0/package"
+ STACK_VERSION = "2.0.6"
+
def test_configure_secured(self):
- self.executeScript("2.0.6/services/HBASE/package/scripts/hbase_client.py",
+ self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/hbase_client.py",
classname = "HbaseClient",
command = "configure",
- config_file="secured.json"
+ config_file="secured.json",
+ hdp_stack_version = self.STACK_VERSION,
+ target = RMFTestCase.TARGET_COMMON_SERVICES
)
self.assertResourceCalled('Directory', '/etc/hbase',
@@ -107,10 +111,12 @@ class TestHBaseClient(RMFTestCase):
self.assertNoMoreResources()
def test_configure_default(self):
- self.executeScript("2.0.6/services/HBASE/package/scripts/hbase_client.py",
+ self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/hbase_client.py",
classname = "HbaseClient",
command = "configure",
- config_file="default.json"
+ config_file="default.json",
+ hdp_stack_version = self.STACK_VERSION,
+ target = RMFTestCase.TARGET_COMMON_SERVICES
)
self.assertResourceCalled('Directory', '/etc/hbase',
mode = 0755