You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ma...@apache.org on 2016/08/17 05:41:23 UTC
[34/51] [partial] ambari git commit: Revert "[RTC 136620]: Introduce
BigInsights stacks on Ambari 2.4 branch"
http://git-wip-us.apache.org/repos/asf/ambari/blob/44e21f8e/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/files/draining_servers.rb
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/files/draining_servers.rb b/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/files/draining_servers.rb
deleted file mode 100644
index 5bcb5b6..0000000
--- a/ambari-server/src/main/resources/stacks/BigInsights/4.2/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/44e21f8e/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/files/hbaseSmokeVerify.sh
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/files/hbaseSmokeVerify.sh b/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/files/hbaseSmokeVerify.sh
deleted file mode 100644
index 19276f3..0000000
--- a/ambari-server/src/main/resources/stacks/BigInsights/4.2/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"
-awk '/id/,/date/' /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/44e21f8e/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/__init__.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/__init__.py b/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/__init__.py
deleted file mode 100644
index 5561e10..0000000
--- a/ambari-server/src/main/resources/stacks/BigInsights/4.2/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/44e21f8e/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/functions.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/functions.py b/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/functions.py
deleted file mode 100644
index f98b9b9..0000000
--- a/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/functions.py
+++ /dev/null
@@ -1,54 +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
-
-def ensure_unit_for_memory(memory_size):
- memory_size_values = re.findall('\d+', str(memory_size))
- memory_size_unit = re.findall('\D+', str(memory_size))
-
- if len(memory_size_values) > 0:
- unit = 'm'
- if len(memory_size_unit) > 0:
- unit = memory_size_unit[0]
- if unit not in ['b', 'k', 'm', 'g', 't', 'p']:
- raise Exception("Memory size unit error. %s - wrong unit" % unit)
- return "%s%s" % (memory_size_values[0], unit)
- else:
- raise Exception('Memory size can not be calculated')
http://git-wip-us.apache.org/repos/asf/ambari/blob/44e21f8e/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/hbase.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/hbase.py b/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/hbase.py
deleted file mode 100644
index 6921057..0000000
--- a/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/hbase.py
+++ /dev/null
@@ -1,226 +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
-import fileinput
-import shutil
-from resource_management.core.exceptions import ComponentIsNotRunning
-from resource_management.core.logger import Logger
-from resource_management.core import shell
-
-def hbase(name=None # 'master' or 'regionserver' or 'client'
- ):
- import params
-
- #Directory( params.hbase_conf_dir_prefix,
- # mode=0755
- #)
-
- # On some OS this folder could be not exists, so we will create it before pushing there files
- Directory(params.limits_conf_dir,
- recursive=True,
- owner='root',
- group='root'
- )
-
- File(os.path.join(params.limits_conf_dir, 'hbase.conf'),
- owner='root',
- group='root',
- mode=0644,
- content=Template("hbase.conf.j2")
- )
-
- 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,
- cd_access="a",
- )
-
- 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
- )
-
- XmlConfig( "core-site.xml",
- conf_dir = params.hbase_conf_dir,
- configurations = params.config['configurations']['core-site'],
- configuration_attributes=params.config['configuration_attributes']['core-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":
- hbase_TemplateConfig( format("hbase_client_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 == "master":
- params.HdfsResource(params.hbase_hdfs_root_dir,
- type="directory",
- action="create_on_execute",
- owner=params.hbase_user
- )
- params.HdfsResource(params.hbase_staging_dir,
- type="directory",
- action="create_on_execute",
- owner=params.hbase_user,
- mode=0711
- )
- params.HdfsResource(params.hbase_hdfs_user_dir,
- type="directory",
- action="create_on_execute",
- owner=params.hbase_user,
- mode=params.hbase_hdfs_user_mode
- )
- params.HdfsResource(None, action="execute")
-
-# create java-opts in etc/hbase/conf dir for iop.version
- File(format("{params.hbase_conf_dir}/java-opts"),
- mode=0644,
- group=params.user_group,
- owner=params.hbase_user,
- content=params.hbase_javaopts_properties
- )
-
-def hbase_TemplateConfig(name,
- tag=None
- ):
- import params
-
- TemplateConfig( format("{hbase_conf_dir}/{name}"),
- owner = params.hbase_user,
- template_tag = tag
- )
-
-def get_iop_version():
- try:
- command = 'iop-select status hadoop-client'
- return_code, iop_output = shell.call(command, timeout=20)
- except Exception, e:
- Logger.error(str(e))
- raise Fail('Unable to execute iop-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)))
-
- iop_version = re.sub('hadoop-client - ', '', iop_output)
- match = re.match('[0-9]+.[0-9]+.[0-9]+.[0-9]+', iop_version)
-
- if match is None:
- raise Fail('Failed to get extracted version')
-
- return iop_version
-
http://git-wip-us.apache.org/repos/asf/ambari/blob/44e21f8e/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/hbase_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/hbase_client.py b/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/hbase_client.py
deleted file mode 100644
index 9075605..0000000
--- a/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/hbase_client.py
+++ /dev/null
@@ -1,72 +0,0 @@
-#!/usr/bin/env python
-"""
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-"""
-
-import sys
-from resource_management import *
-from resource_management.libraries.functions import conf_select
-from resource_management.libraries.functions import iop_select
-
-from hbase import hbase
-
-
-class HbaseClient(Script):
-
- def get_stack_to_component(self):
- return {"BigInsights": "hbase-client"}
-
- def pre_upgrade_restart(self, env, upgrade_type=None):
- import params
- env.set_params(params)
-
- if params.version and compare_versions(format_hdp_stack_version(params.version), '4.0.0.0') >= 0:
- conf_select.select(params.stack_name, "hbase", params.version)
- iop_select.select("hbase-client", params.version)
- #Execute(format("iop-select set hbase-client {version}"))
-
- # phoenix may not always be deployed
- try:
- iop_select.select("phoenix-client", params.version)
- except Exception as e:
- print "Ignoring error due to missing phoenix-client"
- print str(e)
-
- # set all of the hadoop clients since hbase client is upgraded as part
- # of the final "CLIENTS" group and we need to ensure that hadoop-client
- # is also set
- conf_select.select(params.stack_name, "hadoop", params.version)
- iop_select.select("hadoop-client", params.version)
- #Execute(format("iop-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)
-
- hbase(name='client')
-
- def status(self, env):
- raise ClientComponentHasNoStatus()
-
-
-if __name__ == "__main__":
- HbaseClient().execute()
http://git-wip-us.apache.org/repos/asf/ambari/blob/44e21f8e/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/hbase_decommission.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/hbase_decommission.py b/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/hbase_decommission.py
deleted file mode 100644
index 07020e8..0000000
--- a/ambari-server/src/main/resources/stacks/BigInsights/4.2/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_decommission = params.kinit_cmd_decommission
-
- 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_decommission} {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_decommission} {hbase_cmd} --config {hbase_conf_dir} org.jruby.Main {region_drainer} add {host}")
- regionmover_cmd = format(
- "{kinit_cmd_decommission} {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/44e21f8e/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/hbase_master.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/hbase_master.py b/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/hbase_master.py
deleted file mode 100644
index 226dc0f..0000000
--- a/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/hbase_master.py
+++ /dev/null
@@ -1,131 +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 resource_management.libraries.functions.security_commons import build_expectations, \
- cached_kinit_executor, get_params_from_filesystem, validate_security_config_properties, \
- FILE_TYPE_XML
-from hbase import hbase
-from hbase_service import hbase_service
-from hbase_decommission import hbase_decommission
-import upgrade
-from setup_ranger_hbase import setup_ranger_hbase
-
-class HbaseMaster(Script):
-
- def get_stack_to_component(self):
- return {"BigInsights": "hbase-master"}
-
- def install(self, env):
- self.install_packages(env)
-
- def configure(self, env):
- import params
- env.set_params(params)
-
- hbase(name='master')
-
- def pre_upgrade_restart(self, env, upgrade_type=None):
- import params
- env.set_params(params)
- upgrade.prestart(env, "hbase-master")
-
- def start(self, env, upgrade_type=None):
- import params
- env.set_params(params)
- self.configure(env) # for security
- setup_ranger_hbase(upgrade_type=upgrade_type)
- hbase_service( 'master',
- action = 'start'
- )
-
- def stop(self, env, upgrade_type=None):
- 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 security_status(self, env):
- import status_params
-
- env.set_params(status_params)
- if status_params.security_enabled:
- props_value_check = {"hbase.security.authentication" : "kerberos",
- "hbase.security.authorization": "true"}
- props_empty_check = ['hbase.master.keytab.file',
- 'hbase.master.kerberos.principal']
- props_read_check = ['hbase.master.keytab.file']
- hbase_site_expectations = build_expectations('hbase-site', props_value_check, props_empty_check,
- props_read_check)
-
- hbase_expectations = {}
- hbase_expectations.update(hbase_site_expectations)
-
- security_params = get_params_from_filesystem(status_params.hbase_conf_dir,
- {'hbase-site.xml': FILE_TYPE_XML})
- result_issues = validate_security_config_properties(security_params, hbase_expectations)
- if not result_issues: # If all validations passed successfully
- try:
- # Double check the dict before calling execute
- if ( 'hbase-site' not in security_params
- or 'hbase.master.keytab.file' not in security_params['hbase-site']
- or 'hbase.master.kerberos.principal' not in security_params['hbase-site']):
- self.put_structured_out({"securityState": "UNSECURED"})
- self.put_structured_out(
- {"securityIssuesFound": "Keytab file or principal are not set property."})
- return
-
- cached_kinit_executor(status_params.kinit_path_local,
- status_params.hbase_user,
- security_params['hbase-site']['hbase.master.keytab.file'],
- security_params['hbase-site']['hbase.master.kerberos.principal'],
- status_params.hostname,
- status_params.tmp_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"})
-
- 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/44e21f8e/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/hbase_regionserver.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/hbase_regionserver.py b/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/hbase_regionserver.py
deleted file mode 100644
index ebe1fe1..0000000
--- a/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/hbase_regionserver.py
+++ /dev/null
@@ -1,132 +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 resource_management.libraries.functions.security_commons import build_expectations, \
- cached_kinit_executor, get_params_from_filesystem, validate_security_config_properties, \
- FILE_TYPE_XML
-from hbase import hbase
-from hbase_service import hbase_service
-import upgrade
-from setup_ranger_hbase import setup_ranger_hbase
-
-class HbaseRegionServer(Script):
-
- def get_stack_to_component(self):
- return {"BigInsights": "hbase-regionserver"}
-
- def install(self, env):
- self.install_packages(env)
-
- def configure(self, env):
- import params
- env.set_params(params)
-
- hbase(name='regionserver')
-
- def pre_upgrade_restart(self, env, upgrade_type=None):
- import params
- env.set_params(params)
- upgrade.prestart(env, "hbase-regionserver")
-
- def post_upgrade_restart(self, env, upgrade_type=None):
- import params
- env.set_params(params)
- upgrade.post_regionserver(env)
-
- def start(self, env, upgrade_type=None):
- import params
- env.set_params(params)
- self.configure(env) # for security
- setup_ranger_hbase(upgrade_type=upgrade_type)
- hbase_service( 'regionserver',
- action = 'start'
- )
-
- def stop(self, env, upgrade_type=None):
- 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 security_status(self, env):
- import status_params
-
- env.set_params(status_params)
- if status_params.security_enabled:
- props_value_check = {"hbase.security.authentication" : "kerberos",
- "hbase.security.authorization": "true"}
- props_empty_check = ['hbase.regionserver.keytab.file',
- 'hbase.regionserver.kerberos.principal']
- props_read_check = ['hbase.regionserver.keytab.file']
- hbase_site_expectations = build_expectations('hbase-site', props_value_check, props_empty_check,
- props_read_check)
-
- hbase_expectations = {}
- hbase_expectations.update(hbase_site_expectations)
-
- security_params = get_params_from_filesystem(status_params.hbase_conf_dir,
- {'hbase-site.xml': FILE_TYPE_XML})
- result_issues = validate_security_config_properties(security_params, hbase_expectations)
- if not result_issues: # If all validations passed successfully
- try:
- # Double check the dict before calling execute
- if ( 'hbase-site' not in security_params
- or 'hbase.regionserver.keytab.file' not in security_params['hbase-site']
- or 'hbase.regionserver.kerberos.principal' not in security_params['hbase-site']):
- self.put_structured_out({"securityState": "UNSECURED"})
- self.put_structured_out(
- {"securityIssuesFound": "Keytab file or principal are not set property."})
- return
-
- cached_kinit_executor(status_params.kinit_path_local,
- status_params.hbase_user,
- security_params['hbase-site']['hbase.regionserver.keytab.file'],
- security_params['hbase-site']['hbase.regionserver.kerberos.principal'],
- status_params.hostname,
- status_params.tmp_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"})
-
- def decommission(self, env):
- print "Decommission not yet implemented!"
-
-
-if __name__ == "__main__":
- HbaseRegionServer().execute()
http://git-wip-us.apache.org/repos/asf/ambari/blob/44e21f8e/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/hbase_restgatewayserver.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/hbase_restgatewayserver.py b/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/hbase_restgatewayserver.py
deleted file mode 100644
index 985b877..0000000
--- a/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/hbase_restgatewayserver.py
+++ /dev/null
@@ -1,85 +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 HbaseRestGatewayServer(Script):
- def get_stack_to_component(self):
- return {"BigInsights": "hbase-restserver"}
-
- def install(self, env):
- self.install_packages(env)
-
- def configure(self, env):
- import params
- env.set_params(params)
-
- hbase(name='rest')
-
- def pre_upgrade_restart(self, env, upgrade_type=None):
- import params
- env.set_params(params)
- upgrade.prestart(env, "hbase-restserver")
-
- def post_upgrade_restart(self, env, upgrade_type=None):
- import params
- env.set_params(params)
-
- def start(self, env, upgrade_type=None):
- import params
- env.set_params(params)
- self.configure(env) # for security
-
- hbase_service( 'rest',
- action = 'start'
- )
-
- def stop(self, env, upgrade_type=None):
- import params
- env.set_params(params)
-
- hbase_service( 'rest',
- action = 'stop'
- )
-
- def status(self, env):
- import status_params
- env.set_params(status_params)
- pid_file = format("{pid_dir}/hbase-{hbase_user}-rest.pid")
- check_process_status(pid_file)
-
- def decommission(self, env):
- import params
- env.set_params(params)
-
- hbase_decommission(env)
-
-
-if __name__ == "__main__":
- HbaseRestGatewayServer().execute()
-
http://git-wip-us.apache.org/repos/asf/ambari/blob/44e21f8e/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/hbase_service.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/hbase_service.py b/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/hbase_service.py
deleted file mode 100644
index fb565a7..0000000
--- a/ambari-server/src/main/resources/stacks/BigInsights/4.2/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/44e21f8e/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/hbase_upgrade.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/hbase_upgrade.py b/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/hbase_upgrade.py
deleted file mode 100644
index 610f527..0000000
--- a/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/hbase_upgrade.py
+++ /dev/null
@@ -1,37 +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.libraries.script import Script
-from resource_management.core.resources.system import Execute
-
-class HbaseMasterUpgrade(Script):
-
- def snapshot(self, env):
- import params
-
- snap_cmd = "echo 'snapshot_all' | {0} shell".format(params.hbase_cmd)
-
- exec_cmd = "{0} {1}".format(params.kinit_cmd, snap_cmd)
-
- Execute(exec_cmd, user=params.hbase_user)
-
-if __name__ == "__main__":
- HbaseMasterUpgrade().execute()
http://git-wip-us.apache.org/repos/asf/ambari/blob/44e21f8e/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/params.py b/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/params.py
deleted file mode 100644
index 96644b9..0000000
--- a/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/params.py
+++ /dev/null
@@ -1,340 +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 ambari_simplejson as json # simplejson is much faster comparing to Python 2.6 json module and has the same functions set.
-from ambari_commons.constants import AMBARI_SUDO_BINARY
-from functions import calc_xmn_from_xms, ensure_unit_for_memory
-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 *
-from resource_management.libraries.functions import conf_select
-import status_params
-from hbase import *
-
-def treat_value_as_mb(value1):
- value = str(value1)
- try:
- part = int(value.strip()[:-1]) if value.lower().strip()[-1:] == 'm' else int(value)
- return str(part) + 'm'
- except:
- return None
-
-# server configurations
-config = Script.get_config()
-exec_tmp_dir = Script.get_tmp_dir()
-sudo = AMBARI_SUDO_BINARY
-
-stack_name = default("/hostLevelParams/stack_name", None)
-retryAble = default("/commandParams/command_retry_enabled", False)
-
-version = default("/commandParams/version", None)
-
-stack_version_unformatted = str(config['hostLevelParams']['stack_version'])
-stack_version = format_hdp_stack_version(stack_version_unformatted)
-
-component_directory = status_params.component_directory
-
-#hadoop params
-hadoop_bin_dir = conf_select.get_hadoop_dir("bin")
-hadoop_conf_dir = conf_select.get_hadoop_conf_dir()
-daemon_script = format('/usr/iop/current/{component_directory}/bin/hbase-daemon.sh')
-region_mover = format('/usr/iop/current/{component_directory}/bin/region_mover.rb')
-region_drainer = format('/usr/iop/current/{component_directory}/bin/draining_servers.rb')
-hbase_cmd = format('/usr/iop/current/{component_directory}/bin/hbase')
-
-limits_conf_dir = "/etc/security/limits.d"
-hbase_conf_dir = status_params.hbase_conf_dir
-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']
-
-hbase_hdfs_user_dir = format("/user/{hbase_user}")
-hbase_hdfs_user_mode = 0755
-
-# 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']
-
-# no symlink for phoenix-server at this point
-phx_daemon_script = '/usr/iop/current/phoenix-server/bin/queryserver.py'
-
-log_dir = config['configurations']['hbase-env']['hbase_log_dir']
-master_heapsize_cfg = config['configurations']['hbase-env']['hbase_master_heapsize']
-master_heapsize = treat_value_as_mb(master_heapsize_cfg)
-
-hbase_javaopts_properties = config['configurations']['hbase-javaopts-properties']['content']
-
-iop_full_version = get_iop_version()
-
-hbase_javaopts_properties = str(hbase_javaopts_properties)
-if hbase_javaopts_properties.find('-Diop.version') == -1:
- hbase_javaopts_properties = hbase_javaopts_properties+ ' -Diop.version=' + str(iop_full_version)
-
-regionserver_heapsize = ensure_unit_for_memory(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)
-
-phoenix_hosts = default('/clusterHostInfo/phoenix_query_server_hosts', [])
-phoenix_enabled = default('/configurations/hbase-env/phoenix_sql_enabled', False)
-has_phoenix = len(phoenix_hosts) > 0
-
-if not has_phoenix and not phoenix_enabled:
- exclude_packages = ['phoenix*']
-else:
- exclude_packages = []
-
-
-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")
-queryserver_jaas_config_file = format("{hbase_conf_dir}/hbase_queryserver_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/metrics_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:6188")
- if metric_collector_port and metric_collector_port.find(':') != -1:
- metric_collector_port = metric_collector_port.split(':')[1]
- pass
-
-# 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_principal = config['configurations']['cluster-env']['smokeuser_principal_name']
-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)
- rest_server_jaas_princ = config['configurations']['hbase-site']['hbase.rest.kerberos.principal'].replace('_HOST',_hostname_lowercase)
- rest_server_spnego_jaas_princ = config['configurations']['hbase-site']['hbase.rest.authentication.kerberos.principal'].replace('_HOST',_hostname_lowercase)
- if has_phoenix:
- queryserver_jaas_princ = config['configurations']['hbase-site']['phoenix.queryserver.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']
-rest_server_keytab_path = config['configurations']['hbase-site']['hbase.rest.keytab.file']
-rest_server_spnego_keytab_path = config['configurations']['hbase-site']['hbase.rest.authentication.kerberos.keytab']
-queryserver_keytab_path = config['configurations']['hbase-site']['phoenix.queryserver.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()
-if security_enabled:
- kinit_cmd = format("{kinit_path_local} -kt {hbase_user_keytab} {hbase_principal_name};")
- kinit_cmd_decommission = format("{kinit_path_local} -kt {master_keytab_path} {master_jaas_princ};")
-
-else:
- kinit_cmd = ""
- kinit_cmd_decommission = ""
-
-#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()
-hdfs_site = config['configurations']['hdfs-site']
-default_fs = config['configurations']['core-site']['fs.defaultFS']
-
-import functools
-#create partial functions with common arguments for every HdfsDirectory call
-#to create hdfs directory we need to call params.HdfsDirectory in code
-HdfsResource = functools.partial(
- HdfsResource,
- user=hdfs_user,
- security_enabled = security_enabled,
- keytab = hdfs_user_keytab,
- kinit_path_local = kinit_path_local,
- hadoop_bin_dir = hadoop_bin_dir,
- hadoop_conf_dir = hadoop_conf_dir,
- principal_name = hdfs_principal_name,
- hdfs_site = hdfs_site,
- default_fs = default_fs
-)
-
-if stack_version != "" and compare_versions(stack_version, '4.0') >= 0:
- command_role = default("/role", "")
- if command_role == "HBASE_MASTER" or command_role == "HBASE_REGIONSERVER" or command_role == "HBASE_REST_SERVER":
- if command_role == "HBASE_MASTER":
- role_root = "master"
- elif command_role == "HBASE_REGIONSERVER":
- role_root = "regionserver"
- elif command_role == "HBASE_REST_SERVER":
- role_root = "restserver"
-
- daemon_script=format("/usr/iop/current/hbase-{role_root}/bin/hbase-daemon.sh")
- region_mover = format("/usr/iop/current/hbase-{role_root}/bin/region_mover.rb")
- region_drainer = format("/usr/iop/current/hbase-{role_root}/bin/draining_servers.rb")
- hbase_cmd = format("/usr/iop/current/hbase-{role_root}/bin/hbase")
-
-# ranger host
-ranger_admin_hosts = default("/clusterHostInfo/ranger_admin_hosts", [])
-has_ranger_admin = not len(ranger_admin_hosts) == 0
-xml_configurations_supported = config['configurations']['ranger-env']['xml_configurations_supported']
-ambari_server_hostname = config['clusterHostInfo']['ambari_server_host'][0]
-
-# ranger hbase properties
-policymgr_mgr_url = config['configurations']['admin-properties']['policymgr_external_url']
-sql_connector_jar = config['configurations']['admin-properties']['SQL_CONNECTOR_JAR']
-xa_audit_db_name = config['configurations']['admin-properties']['audit_db_name']
-xa_audit_db_user = config['configurations']['admin-properties']['audit_db_user']
-xa_db_host = config['configurations']['admin-properties']['db_host']
-repo_name = str(config['clusterName']) + '_hbase'
-
-common_name_for_certificate = config['configurations']['ranger-hbase-plugin-properties']['common.name.for.certificate']
-
-zookeeper_znode_parent = config['configurations']['hbase-site']['zookeeper.znode.parent']
-hbase_zookeeper_quorum = config['configurations']['hbase-site']['hbase.zookeeper.quorum']
-hbase_zookeeper_property_clientPort = config['configurations']['hbase-site']['hbase.zookeeper.property.clientPort']
-hbase_security_authentication = config['configurations']['hbase-site']['hbase.security.authentication']
-hadoop_security_authentication = config['configurations']['core-site']['hadoop.security.authentication']
-
-repo_config_username = config['configurations']['ranger-hbase-plugin-properties']['REPOSITORY_CONFIG_USERNAME']
-
-ranger_env = config['configurations']['ranger-env']
-ranger_plugin_properties = config['configurations']['ranger-hbase-plugin-properties']
-policy_user = config['configurations']['ranger-hbase-plugin-properties']['policy_user']
-
-#For curl command in ranger plugin to get db connector
-jdk_location = config['hostLevelParams']['jdk_location']
-java_share_dir = '/usr/share/java'
-enable_ranger_hbase = False
-if has_ranger_admin:
- enable_ranger_hbase = (config['configurations']['ranger-hbase-plugin-properties']['ranger-hbase-plugin-enabled'].lower() == 'yes')
- xa_audit_db_password = unicode(config['configurations']['admin-properties']['audit_db_password'])
- repo_config_password = unicode(config['configurations']['ranger-hbase-plugin-properties']['REPOSITORY_CONFIG_PASSWORD'])
- xa_audit_db_flavor = (config['configurations']['admin-properties']['DB_FLAVOR']).lower()
-
- if xa_audit_db_flavor == 'mysql':
- jdbc_symlink_name = "mysql-jdbc-driver.jar"
- jdbc_jar_name = "mysql-connector-java.jar"
- audit_jdbc_url = format('jdbc:mysql://{xa_db_host}/{xa_audit_db_name}')
- jdbc_driver = "com.mysql.jdbc.Driver"
- elif xa_audit_db_flavor == 'oracle':
- jdbc_jar_name = "ojdbc6.jar"
- jdbc_symlink_name = "oracle-jdbc-driver.jar"
- colon_count = xa_db_host.count(':')
- if colon_count == 2 or colon_count == 0:
- audit_jdbc_url = format('jdbc:oracle:thin:@{xa_db_host}')
- else:
- audit_jdbc_url = format('jdbc:oracle:thin:@//{xa_db_host}')
- jdbc_driver = "oracle.jdbc.OracleDriver"
- elif xa_audit_db_flavor == 'postgres':
- jdbc_jar_name = "postgresql.jar"
- jdbc_symlink_name = "postgres-jdbc-driver.jar"
- audit_jdbc_url = format('jdbc:postgresql://{xa_db_host}/{xa_audit_db_name}')
- jdbc_driver = "org.postgresql.Driver"
- elif xa_audit_db_flavor == 'mssql':
- jdbc_jar_name = "sqljdbc4.jar"
- jdbc_symlink_name = "mssql-jdbc-driver.jar"
- audit_jdbc_url = format('jdbc:sqlserver://{xa_db_host};databaseName={xa_audit_db_name}')
- jdbc_driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver"
- elif xa_audit_db_flavor == 'sqla':
- jdbc_jar_name = "sajdbc4.jar"
- jdbc_symlink_name = "sqlanywhere-jdbc-driver.tar.gz"
- audit_jdbc_url = format('jdbc:sqlanywhere:database={xa_audit_db_name};host={xa_db_host}')
- jdbc_driver = "sap.jdbc4.sqlanywhere.IDriver"
-
- downloaded_custom_connector = format("{exec_tmp_dir}/{jdbc_jar_name}")
- driver_curl_source = format("{jdk_location}/{jdbc_symlink_name}")
- driver_curl_target = format("/usr/iop/current/{component_directory}/lib/{jdbc_jar_name}")
-
- hbase_ranger_plugin_config = {
- 'username': repo_config_username,
- 'password': repo_config_password,
- 'hadoop.security.authentication': hadoop_security_authentication,
- 'hbase.security.authentication': hbase_security_authentication,
- 'hbase.zookeeper.property.clientPort': hbase_zookeeper_property_clientPort,
- 'hbase.zookeeper.quorum': hbase_zookeeper_quorum,
- 'zookeeper.znode.parent': zookeeper_znode_parent,
- 'commonNameForCertificate': common_name_for_certificate,
- 'hbase.master.kerberos.principal': master_jaas_princ if security_enabled else ''
- }
-
- hbase_ranger_plugin_repo = {
- 'isActive': 'true',
- 'config': json.dumps(hbase_ranger_plugin_config),
- 'description': 'hbase repo',
- 'name': repo_name,
- 'repositoryType': 'hbase',
- 'assetType': '2'
- }
-
- ranger_audit_solr_urls = config['configurations']['ranger-admin-site']['ranger.audit.solr.urls']
- xa_audit_db_is_enabled = config['configurations']['ranger-hbase-audit']['xasecure.audit.destination.db'] if xml_configurations_supported else None
- xa_audit_hdfs_is_enabled = config['configurations']['ranger-hbase-audit']['xasecure.audit.destination.hdfs'] if xml_configurations_supported else None
- ssl_keystore_password = unicode(config['configurations']['ranger-hbase-policymgr-ssl']['xasecure.policymgr.clientssl.keystore.password']) if xml_configurations_supported else None
- ssl_truststore_password = unicode(config['configurations']['ranger-hbase-policymgr-ssl']['xasecure.policymgr.clientssl.truststore.password']) if xml_configurations_supported else None
- credential_file = format('/etc/ranger/{repo_name}/cred.jceks') if xml_configurations_supported else None
-
- #For SQLA explicitly disable audit to DB for Ranger
- if xa_audit_db_flavor == 'sqla':
- xa_audit_db_is_enabled = False
-
-# Used to dynamically set the hbase-site props that are referenced during Kerberization
-if security_enabled:
- if not enable_ranger_hbase: # Default props, no ranger plugin
- hbase_coprocessor_master_classes = "org.apache.hadoop.hbase.security.access.AccessController"
- hbase_coprocessor_regionserver_classes = "org.apache.hadoop.hbase.security.access.AccessController"
- hbase_coprocessor_region_classes = "org.apache.hadoop.hbase.security.token.TokenProvider,org.apache.hadoop.hbase.security.access.SecureBulkLoadEndpoint,org.apache.hadoop.hbase.security.access.AccessController"
- elif xml_configurations_supported: # HDP stack 2.3+ ranger plugin enabled
- hbase_coprocessor_master_classes = "org.apache.ranger.authorization.hbase.RangerAuthorizationCoprocessor "
- hbase_coprocessor_regionserver_classes = "org.apache.ranger.authorization.hbase.RangerAuthorizationCoprocessor"
- hbase_coprocessor_region_classes = "org.apache.hadoop.hbase.security.token.TokenProvider,org.apache.hadoop.hbase.security.access.SecureBulkLoadEndpoint,org.apache.ranger.authorization.hbase.RangerAuthorizationCoprocessor"
- else: # HDP Stack 2.2 and less / ranger plugin enabled
- hbase_coprocessor_master_classes = "com.xasecure.authorization.hbase.XaSecureAuthorizationCoprocessor"
- hbase_coprocessor_regionserver_classes = "com.xasecure.authorization.hbase.XaSecureAuthorizationCoprocessor"
- hbase_coprocessor_region_classes = "org.apache.hadoop.hbase.security.token.TokenProvider,org.apache.hadoop.hbase.security.access.SecureBulkLoadEndpoint,com.xasecure.authorization.hbase.XaSecureAuthorizationCoprocessor"
http://git-wip-us.apache.org/repos/asf/ambari/blob/44e21f8e/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/phoenix_queryserver.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/phoenix_queryserver.py b/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/phoenix_queryserver.py
deleted file mode 100644
index 052dfbf..0000000
--- a/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/phoenix_queryserver.py
+++ /dev/null
@@ -1,77 +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.libraries.functions import conf_select
-from resource_management.libraries.functions import iop_select
-from resource_management.libraries.functions.version import compare_versions
-from resource_management.libraries.script import Script
-from phoenix_service import phoenix_service
-from hbase import hbase
-
-class PhoenixQueryServer(Script):
-
- def install(self, env):
- import params
- self.install_packages(env, params.exclude_packages)
-
-
- def get_stack_to_component(self):
- return {"BigInsights": "phoenix-server"}
-
-
- def configure(self, env):
- import params
- env.set_params(params)
- hbase(name='queryserver')
-
-
- def start(self, env, upgrade_type=None):
- import params
- env.set_params(params)
- self.configure(env)
- phoenix_service('start')
-
-
- def stop(self, env, upgrade_type=None):
- import params
- env.set_params(params)
- phoenix_service('stop')
-
-
- def pre_upgrade_restart(self, env, upgrade_type=None):
- import params
- env.set_params(params)
-
- if Script.is_hdp_stack_greater_or_equal("4.2"):
- # phoenix uses hbase configs
- conf_select.select(params.stack_name, "hbase", params.version)
- iop_select.select("phoenix-server", params.version)
-
-
- def status(self, env):
- import status_params
- env.set_params(status_params)
- phoenix_service('status')
-
-
- def security_status(self, env):
- self.put_structured_out({"securityState": "UNSECURED"})
-
-if __name__ == "__main__":
- PhoenixQueryServer().execute()
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/44e21f8e/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/phoenix_service.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/phoenix_service.py b/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/phoenix_service.py
deleted file mode 100644
index a410a3d..0000000
--- a/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/phoenix_service.py
+++ /dev/null
@@ -1,50 +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.core.resources.system import Execute
-from resource_management.core.resources.system import File
-from resource_management.libraries.functions import check_process_status, format
-
-
-def phoenix_service(action = 'start'): # 'start', 'stop', 'status'
- # Note: params/status_params should already be imported before calling phoenix_service()
- pid_file = format("{pid_dir}/phoenix-{hbase_user}-server.pid")
- no_op_test = format("ls {pid_file} >/dev/null 2>&1 && ps -p `cat {pid_file}` >/dev/null 2>&1")
-
- if action == "status":
- check_process_status(pid_file)
- else:
- env = {'JAVA_HOME': format("{java64_home}"), 'HBASE_CONF_DIR': format("{hbase_conf_dir}")}
- daemon_cmd = format("{phx_daemon_script} {action}")
- if action == 'start':
- Execute(daemon_cmd,
- user=format("{hbase_user}"),
- environment=env)
-
- elif action == 'stop':
- Execute(daemon_cmd,
- timeout = 30,
- on_timeout = format("! ( {no_op_test} ) || {sudo} -H -E kill -9 `cat {pid_file}`"),
- user=format("{hbase_user}"),
- environment=env
- )
- File(pid_file,
- action = "delete"
- )
http://git-wip-us.apache.org/repos/asf/ambari/blob/44e21f8e/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/service_check.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/service_check.py b/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/service_check.py
deleted file mode 100644
index eea1cd1..0000000
--- a/ambari-server/src/main/resources/stacks/BigInsights/4.2/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} {smokeuser_principal};") 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/44e21f8e/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/setup_ranger_hbase.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/setup_ranger_hbase.py b/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/setup_ranger_hbase.py
deleted file mode 100644
index 5c68583..0000000
--- a/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/setup_ranger_hbase.py
+++ /dev/null
@@ -1,85 +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.core.logger import Logger
-
-def setup_ranger_hbase(upgrade_type=None):
- import params
-
- if params.has_ranger_admin:
-
- if params.xml_configurations_supported:
- from resource_management.libraries.functions.setup_ranger_plugin_xml import setup_ranger_plugin
- else:
- from resource_management.libraries.functions.setup_ranger_plugin import setup_ranger_plugin
-
- hdp_version = None
-
- if upgrade_type is not None:
- hdp_version = params.version
-
- if params.retryAble:
- Logger.info("HBase: Setup ranger: command retry enables thus retrying if ranger admin is down !")
- else:
- Logger.info("HBase: Setup ranger: command retry not enabled thus skipping if ranger admin is down !")
-
- if params.xml_configurations_supported and params.enable_ranger_hbase and params.xa_audit_hdfs_is_enabled:
- params.HdfsResource("/ranger/audit",
- type="directory",
- action="create_on_execute",
- owner=params.hdfs_user,
- group=params.hdfs_user,
- mode=0755,
- recursive_chmod=True
- )
- params.HdfsResource("/ranger/audit/hbaseMaster",
- type="directory",
- action="create_on_execute",
- owner=params.hbase_user,
- group=params.hbase_user,
- mode=0700,
- recursive_chmod=True
- )
- params.HdfsResource("/ranger/audit/hbaseRegional",
- type="directory",
- action="create_on_execute",
- owner=params.hbase_user,
- group=params.hbase_user,
- mode=0700,
- recursive_chmod=True
- )
- params.HdfsResource(None, action="execute")
-
- setup_ranger_plugin('hbase-client', 'hbase',
- params.downloaded_custom_connector, params.driver_curl_source,
- params.driver_curl_target, params.java64_home,
- params.repo_name, params.hbase_ranger_plugin_repo,
- params.ranger_env, params.ranger_plugin_properties,
- params.policy_user, params.policymgr_mgr_url,
- params.enable_ranger_hbase, conf_dict=params.hbase_conf_dir,
- component_user=params.hbase_user, component_group=params.user_group, cache_service_list=['hbaseMaster', 'hbaseRegional'],
- plugin_audit_properties=params.config['configurations']['ranger-hbase-audit'], plugin_audit_attributes=params.config['configuration_attributes']['ranger-hbase-audit'],
- plugin_security_properties=params.config['configurations']['ranger-hbase-security'], plugin_security_attributes=params.config['configuration_attributes']['ranger-hbase-security'],
- plugin_policymgr_ssl_properties=params.config['configurations']['ranger-hbase-policymgr-ssl'], plugin_policymgr_ssl_attributes=params.config['configuration_attributes']['ranger-hbase-policymgr-ssl'],
- component_list=['hbase-client', 'hbase-master', 'hbase-regionserver'], audit_db_is_enabled=params.xa_audit_db_is_enabled,
- credential_file=params.credential_file, xa_audit_db_password=params.xa_audit_db_password,
- ssl_truststore_password=params.ssl_truststore_password, ssl_keystore_password=params.ssl_keystore_password,
- hdp_version_override = hdp_version, skip_if_rangeradmin_down= not params.retryAble)
- else:
- Logger.info('Ranger admin not installed')
http://git-wip-us.apache.org/repos/asf/ambari/blob/44e21f8e/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/status_params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/status_params.py b/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/status_params.py
deleted file mode 100644
index d5c46fc..0000000
--- a/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/status_params.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 *
-
-# a map of the Ambari role to the component name
-# for use with /usr/iop/current/<component>
-SERVER_ROLE_DIRECTORY_MAP = {
- 'HBASE_MASTER' : 'hbase-master',
- 'HBASE_REGIONSERVER' : 'hbase-regionserver',
- 'HBASE_REST_SERVER' : 'hbase-restserver',
- 'HBASE_CLIENT' : 'hbase-client'
-}
-
-component_directory = Script.get_component_from_role(SERVER_ROLE_DIRECTORY_MAP, "HBASE_CLIENT")
-
-config = Script.get_config()
-
-pid_dir = config['configurations']['hbase-env']['hbase_pid_dir']
-hbase_user = config['configurations']['hbase-env']['hbase_user']
-
-# Security related/required params
-hostname = config['hostname']
-security_enabled = config['configurations']['cluster-env']['security_enabled']
-kinit_path_local = functions.get_kinit_path()
-tmp_dir = Script.get_tmp_dir()
-
-hbase_conf_dir = format("/usr/iop/current/{component_directory}/conf")
http://git-wip-us.apache.org/repos/asf/ambari/blob/44e21f8e/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/upgrade.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/upgrade.py b/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/upgrade.py
deleted file mode 100644
index 4dd9fa7..0000000
--- a/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/scripts/upgrade.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 *
-from resource_management.core.resources.system import Execute
-from resource_management.core import shell
-from resource_management.libraries.functions import conf_select
-from resource_management.libraries.functions import iop_select
-from resource_management.libraries.functions.version import compare_versions, format_hdp_stack_version
-from resource_management.libraries.functions.decorator import retry
-
-def prestart(env, component):
- import params
-
- if params.version and compare_versions(format_hdp_stack_version(params.version), '4.0.0.0') >= 0:
- conf_select.select(params.stack_name, "hbase", params.version)
- iop_select.select(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() + ":", re.IGNORECASE)
-
-
-@retry(times=15, sleep_time=2, err_class=Fail)
-def call_and_match(cmd, user, regex, regex_search_flags):
-
- code, out = shell.call(cmd, user=user)
-
- if not (out and re.search(regex, out, regex_search_flags)):
- raise Fail("Could not verify RS available")
http://git-wip-us.apache.org/repos/asf/ambari/blob/44e21f8e/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/templates/hadoop-metrics2-hbase.properties-GANGLIA-MASTER.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/templates/hadoop-metrics2-hbase.properties-GANGLIA-MASTER.j2 b/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/templates/hadoop-metrics2-hbase.properties-GANGLIA-MASTER.j2
deleted file mode 100644
index 78ee5fa..0000000
--- a/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HBASE/package/templates/hadoop-metrics2-hbase.properties-GANGLIA-MASTER.j2
+++ /dev/null
@@ -1,109 +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 %}
-
-*.timeline.plugin.urls=file:///usr/lib/ambari-metrics-hadoop-sink/ambari-metrics-hadoop-sink.jar
-*.sink.timeline.slave.host.name={{hostname}}
-hbase.class=org.apache.hadoop.metrics2.sink.timeline.HadoopTimelineMetricsSink
-hbase.period=10
-hbase.collector={{metric_collector_host}}:{{metric_collector_port}}
-
-jvm.class=org.apache.hadoop.metrics2.sink.timeline.HadoopTimelineMetricsSink
-jvm.period=10
-jvm.collector={{metric_collector_host}}:{{metric_collector_port}}
-
-rpc.class=org.apache.hadoop.metrics2.sink.timeline.HadoopTimelineMetricsSink
-rpc.period=10
-rpc.collector={{metric_collector_host}}:{{metric_collector_port}}
-
-hbase.sink.timeline.class=org.apache.hadoop.metrics2.sink.timeline.HadoopTimelineMetricsSink
-hbase.sink.timeline.period=10
-hbase.sink.timeline.collector={{metric_collector_host}}:{{metric_collector_port}}
-
-{% 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 %}
-
-# Disable HBase metrics for regions/tables/regionservers by default.
-*.source.filter.class=org.apache.hadoop.metrics2.filter.GlobFilter
-hbase.*.source.filter.exclude=*Regions*