Repository: ambari Updated Branches: refs/heads/trunk e6fc15dfc -> 2816fc229
AMBARI-16108. Ambari agent changes to push hive metrics to AMS. (jaimin) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/2816fc22 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/2816fc22 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/2816fc22 Branch: refs/heads/trunk Commit: 2816fc229d5d123c780068a014b1dcdc6f5a191b Parents: e6fc15d Author: Jaimin Jetly <[email protected]> Authored: Tue Apr 26 10:26:53 2016 -0700 Committer: Jaimin Jetly <[email protected]> Committed: Tue Apr 26 10:27:14 2016 -0700 ---------------------------------------------------------------------- .../libraries/functions/constants.py | 1 + .../HIVE/0.12.0.2.0/metainfo.xml | 1 + .../HIVE/0.12.0.2.0/package/scripts/hive.py | 21 +++++ .../0.12.0.2.0/package/scripts/params_linux.py | 35 ++++++++ .../hadoop-metrics2-hivemetastore.properties.j2 | 54 +++++++++++++ .../hadoop-metrics2-hiveserver2.properties.j2 | 54 +++++++++++++ .../HDP/2.0.6/properties/stack_features.json | 5 ++ .../services/HIVE/configuration/hive-env.xml | 85 ++++++++++++++++++++ .../HIVE/configuration/hivemetastore-site.xml | 40 +++++++++ .../HIVE/configuration/hiveserver2-site.xml | 41 ++++++++++ .../stacks/2.0.6/HIVE/test_hive_metastore.py | 15 ++++ .../stacks/2.0.6/HIVE/test_hive_server.py | 14 +++- .../stacks/2.1/HIVE/test_hive_metastore.py | 12 +++ 13 files changed, 376 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/2816fc22/ambari-common/src/main/python/resource_management/libraries/functions/constants.py ---------------------------------------------------------------------- diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/constants.py b/ambari-common/src/main/python/resource_management/libraries/functions/constants.py index 8f27b48..abd2212 100644 --- a/ambari-common/src/main/python/resource_management/libraries/functions/constants.py +++ b/ambari-common/src/main/python/resource_management/libraries/functions/constants.py @@ -80,3 +80,4 @@ class StackFeature: RANGER_KMS_HSM_SUPPORT = "ranger_kms_hsm_support" RANGER_LOG4J_SUPPORT = "ranger_log4j_support" RANGER_KERBEROS_SUPPORT = "ranger_kerberos_support" + HIVE_METASTORE_SITE_SUPPORT = "hive_metastore_site_support" http://git-wip-us.apache.org/repos/asf/ambari/blob/2816fc22/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/metainfo.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/metainfo.xml b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/metainfo.xml index 42a7a4a..4e05c58 100644 --- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/metainfo.xml +++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/metainfo.xml @@ -338,6 +338,7 @@ <config-type>hive-env</config-type> <!-- TODO, hive-interactive-site shouldn't be in common-services. --> <config-type>hive-interactive-site</config-type> + <config-type>hivemetastore-site.xml</config-type> <config-type>webhcat-site</config-type> <config-type>webhcat-env</config-type> <config-type>ranger-hive-plugin-properties</config-type> http://git-wip-us.apache.org/repos/asf/ambari/blob/2816fc22/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py index 930dd4c..0cca1a9 100644 --- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py +++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py @@ -237,6 +237,15 @@ def hive(name=None): owner=params.hive_user, group=params.user_group, mode=0644) + + if params.hive_metastore_site_supported and name == 'metastore': + XmlConfig("hivemetastore-site.xml", + conf_dir=params.hive_server_conf_dir, + configurations=params.config['configurations']['hivemetastore-site'], + configuration_attributes=params.config['configuration_attributes']['hivemetastore-site'], + owner=params.hive_user, + group=params.user_group, + mode=0644) File(format("{hive_config_dir}/hive-env.sh"), owner=params.hive_user, @@ -267,6 +276,12 @@ def hive(name=None): ) if name == 'metastore': + File(os.path.join(params.hive_server_conf_dir, "hadoop-metrics2-hivemetastore.properties"), + owner=params.hive_user, + group=params.user_group, + content=Template("hadoop-metrics2-hivemetastore.properties.j2") + ) + File(params.start_metastore_path, mode=0755, content=StaticFile('startMetastore.sh') @@ -303,6 +318,12 @@ def hive(name=None): content=Template(format('{start_hiveserver2_script}')) ) + File(os.path.join(params.hive_server_conf_dir, "hadoop-metrics2-hiveserver2.properties"), + owner=params.hive_user, + group=params.user_group, + content=Template("hadoop-metrics2-hiveserver2.properties.j2") + ) + if name != "client": Directory(params.hive_pid_dir, create_parents = True, http://git-wip-us.apache.org/repos/asf/ambari/blob/2816fc22/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py index aa561f8..3d6c096 100644 --- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py +++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py @@ -95,6 +95,7 @@ hive_tar_file = format('/usr/share/{stack_name_uppercase}-webhcat/hive.tar.gz') sqoop_tar_file = format('/usr/share/{stack_name_uppercase}-webhcat/sqoop*.tar.gz') hive_specific_configs_supported = False +hive_metastore_site_supported = False hive_etc_dir_prefix = "/etc/hive" hive_interactive_etc_dir_prefix = "/etc/hive2" limits_conf_dir = "/etc/security/limits.d" @@ -128,6 +129,9 @@ if stack_version_formatted_major and check_stack_feature(StackFeature.HIVE_WEBHC hcat_conf_dir = format('{stack_root}/current/hive-webhcat/etc/hcatalog') config_dir = format('{stack_root}/current/hive-webhcat/etc/webhcat') +if stack_version_formatted_major and check_stack_feature(StackFeature.HIVE_METASTORE_SITE_SUPPORT, stack_version_formatted_major): + hive_metastore_site_supported = True + if stack_version_formatted_major and check_stack_feature(StackFeature.ROLLING_UPGRADE, stack_version_formatted_major): hive_specific_configs_supported = True @@ -428,6 +432,37 @@ mysql_jdbc_driver_jar = "/usr/share/java/mysql-connector-java.jar" hive_site_config = dict(config['configurations']['hive-site']) ######################################################## +############# AMS related params ##################### +######################################################## +ams_collector_hosts = default("/clusterHostInfo/metrics_collector_hosts", []) +has_metric_collector = not len(ams_collector_hosts) == 0 +if has_metric_collector: + if 'cluster-env' in config['configurations'] and \ + 'metrics_collector_vip_host' in config['configurations']['cluster-env']: + metric_collector_host = config['configurations']['cluster-env']['metrics_collector_vip_host'] + else: + metric_collector_host = ams_collector_hosts[0] + if 'cluster-env' in config['configurations'] and \ + 'metrics_collector_vip_port' in config['configurations']['cluster-env']: + metric_collector_port = config['configurations']['cluster-env']['metrics_collector_vip_port'] + else: + metric_collector_web_address = default("/configurations/ams-site/timeline.metrics.service.webapp.address", "localhost:6188") + if metric_collector_web_address.find(':') != -1: + metric_collector_port = metric_collector_web_address.split(':')[1] + else: + metric_collector_port = '6188' + if default("/configurations/ams-site/timeline.metrics.service.http.policy", "HTTP_ONLY") == "HTTPS_ONLY": + metric_collector_protocol = 'https' + else: + metric_collector_protocol = 'http' + metric_truststore_path= default("/configurations/ams-ssl-client/ssl.client.truststore.location", "") + metric_truststore_type= default("/configurations/ams-ssl-client/ssl.client.truststore.type", "") + metric_truststore_password= default("/configurations/ams-ssl-client/ssl.client.truststore.password", "") + +metrics_report_interval = default("/configurations/ams-site/timeline.metrics.sink.report.interval", 60) +metrics_collection_period = default("/configurations/ams-site/timeline.metrics.sink.collection.period", 10) + +######################################################## ############# Atlas related params ##################### ######################################################## http://git-wip-us.apache.org/repos/asf/ambari/blob/2816fc22/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/templates/hadoop-metrics2-hivemetastore.properties.j2 ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/templates/hadoop-metrics2-hivemetastore.properties.j2 b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/templates/hadoop-metrics2-hivemetastore.properties.j2 new file mode 100644 index 0000000..e4d88bc --- /dev/null +++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/templates/hadoop-metrics2-hivemetastore.properties.j2 @@ -0,0 +1,54 @@ +{# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#} + +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# syntax: [prefix].[source|sink|jmx].[instance].[options] +# See package.html for org.apache.hadoop.metrics2 for details + +{% if has_metric_collector %} + + *.period={{metrics_collection_period}} + *.sink.timeline.plugin.urls=file:///usr/lib/ambari-metrics-hadoop-sink/ambari-metrics-hadoop-sink.jar + *.sink.timeline.class=org.apache.hadoop.metrics2.sink.timeline.HadoopTimelineMetricsSink + *.sink.timeline.period={{metrics_collection_period}} + *.sink.timeline.sendInterval={{metrics_report_interval}}000 + *.sink.timeline.slave.host.name = {{hostname}} + + # HTTPS properties + *.sink.timeline.truststore.path = {{metric_truststore_path}} + *.sink.timeline.truststore.type = {{metric_truststore_type}} + *.sink.timeline.truststore.password = {{metric_truststore_password}} + + hivemetastore.sink.timeline.collector={{metric_collector_protocol}}://{{metric_collector_host}}:{{metric_collector_port}} + + +{% endif %} http://git-wip-us.apache.org/repos/asf/ambari/blob/2816fc22/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/templates/hadoop-metrics2-hiveserver2.properties.j2 ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/templates/hadoop-metrics2-hiveserver2.properties.j2 b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/templates/hadoop-metrics2-hiveserver2.properties.j2 new file mode 100644 index 0000000..b5c4891 --- /dev/null +++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/templates/hadoop-metrics2-hiveserver2.properties.j2 @@ -0,0 +1,54 @@ +{# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#} + +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# syntax: [prefix].[source|sink|jmx].[instance].[options] +# See package.html for org.apache.hadoop.metrics2 for details + +{% if has_metric_collector %} + + *.period={{metrics_collection_period}} + *.sink.timeline.plugin.urls=file:///usr/lib/ambari-metrics-hadoop-sink/ambari-metrics-hadoop-sink.jar + *.sink.timeline.class=org.apache.hadoop.metrics2.sink.timeline.HadoopTimelineMetricsSink + *.sink.timeline.period={{metrics_collection_period}} + *.sink.timeline.sendInterval={{metrics_report_interval}}000 + *.sink.timeline.slave.host.name = {{hostname}} + + # HTTPS properties + *.sink.timeline.truststore.path = {{metric_truststore_path}} + *.sink.timeline.truststore.type = {{metric_truststore_type}} + *.sink.timeline.truststore.password = {{metric_truststore_password}} + + hiveserver2.sink.timeline.collector={{metric_collector_protocol}}://{{metric_collector_host}}:{{metric_collector_port}} + + +{% endif %} http://git-wip-us.apache.org/repos/asf/ambari/blob/2816fc22/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json b/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json index 733064e..aabc37d 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json +++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json @@ -210,6 +210,11 @@ "name": "ranger_kerberos_support", "description": "Ranger Kerberos support", "min_version": "2.5.0.0" + }, + { + "name": "hive_metastore_site_support", + "description": "Hive Metastore site support", + "min_version": "2.5.0.0" } ] } http://git-wip-us.apache.org/repos/asf/ambari/blob/2816fc22/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-env.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-env.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-env.xml new file mode 100644 index 0000000..ab15163 --- /dev/null +++ b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-env.xml @@ -0,0 +1,85 @@ +<?xml version="1.0"?> +<?xml-stylesheet type="text/xsl" href="configuration.xsl"?> +<!-- +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +--> + +<configuration supports_adding_forbidden="true"> + + <!-- hive-env.sh --> + <property> + <name>content</name> + <description>This is the jinja template for hive-env.sh file</description> + <value> + export HADOOP_USER_CLASSPATH_FIRST=true #this prevents old metrics libs from mapreduce lib from bringing in old jar deps overriding HIVE_LIB + if [ "$SERVICE" = "cli" ]; then + if [ -z "$DEBUG" ]; then + export HADOOP_OPTS="$HADOOP_OPTS -XX:NewRatio=12 -XX:MaxHeapFreeRatio=40 -XX:MinHeapFreeRatio=15 -XX:+UseNUMA -XX:+UseParallelGC -XX:-UseGCOverheadLimit" + else + export HADOOP_OPTS="$HADOOP_OPTS -XX:NewRatio=12 -XX:MaxHeapFreeRatio=40 -XX:MinHeapFreeRatio=15 -XX:-UseGCOverheadLimit" + fi + fi + + # The heap size of the jvm stared by hive shell script can be controlled via: + + if [ "$SERVICE" = "metastore" ]; then + export HADOOP_HEAPSIZE={{hive_metastore_heapsize}} # Setting for HiveMetastore + else + export HADOOP_HEAPSIZE={{hive_heapsize}} # Setting for HiveServer2 and Client + fi + + export HADOOP_CLIENT_OPTS="$HADOOP_CLIENT_OPTS -Xmx${HADOOP_HEAPSIZE}m" + + # Larger heap size may be required when running queries over large number of files or partitions. + # By default hive shell scripts use a heap size of 256 (MB). Larger heap size would also be + # appropriate for hive server (hwi etc). + + + # Set HADOOP_HOME to point to a specific hadoop install directory + HADOOP_HOME=${HADOOP_HOME:-{{hadoop_home}}} + + # Hive Configuration Directory can be controlled by: + export HIVE_CONF_DIR={{hive_config_dir}} + + # Folder containing extra libraries required for hive compilation/execution can be controlled by: + if [ "${HIVE_AUX_JARS_PATH}" != "" ]; then + if [ -f "${HIVE_AUX_JARS_PATH}" ]; then + export HIVE_AUX_JARS_PATH=${HIVE_AUX_JARS_PATH} + elif [ -d "/usr/hdp/current/hive-webhcat/share/hcatalog" ]; then + export HIVE_AUX_JARS_PATH=/usr/hdp/current/hive-webhcat/share/hcatalog/hive-hcatalog-core.jar + fi + elif [ -d "/usr/hdp/current/hive-webhcat/share/hcatalog" ]; then + export HIVE_AUX_JARS_PATH=/usr/hdp/current/hive-webhcat/share/hcatalog/hive-hcatalog-core.jar + fi + + export METASTORE_PORT={{hive_metastore_port}} + + export HADOOP_CLASSPATH={{atlas_conf_dir}}:{{atlas_home_dir}}/hook/hive:${HADOOP_CLASSPATH} + + {% if sqla_db_used or lib_dir_available %} + export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:{{jdbc_libs_dir}}" + export JAVA_LIBRARY_PATH="$JAVA_LIBRARY_PATH:{{jdbc_libs_dir}}" + {% endif %} + </value> + <value-attributes> + <type>content</type> + </value-attributes> + </property> + +</configuration> http://git-wip-us.apache.org/repos/asf/ambari/blob/2816fc22/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hivemetastore-site.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hivemetastore-site.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hivemetastore-site.xml new file mode 100644 index 0000000..fe6d174 --- /dev/null +++ b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hivemetastore-site.xml @@ -0,0 +1,40 @@ +<?xml version="1.0"?> +<?xml-stylesheet type="text/xsl" href="configuration.xsl"?> +<!-- +Licensed to the Apache Software Foundation (ASF) under one or more +contributor license agreements. See the NOTICE file distributed with +this work for additional information regarding copyright ownership. +The ASF licenses this file to You under the Apache License, Version 2.0 +(the "License"); you may not use this file except in compliance with +the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +--> + +<configuration supports_final="true"> + <property> + <name>hive.metastore.metrics.enabled</name> + <value>true</value> + <value-attributes> + <type>boolean</type> + </value-attributes> + </property> + <property> + <name>hive.service.metrics.reporter</name> + <value>JSON_FILE, JMX, HADOOP2</value> + </property> + <property> + <name>hive.service.metrics.hadoop2.component</name> + <value>hivemetastore</value> + </property> + <property> + <name>hive.service.metrics.file.location</name> + <value>/var/log/hive/hivemetastore-report.json</value> + </property> +</configuration> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/2816fc22/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hiveserver2-site.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hiveserver2-site.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hiveserver2-site.xml new file mode 100644 index 0000000..fe4df94 --- /dev/null +++ b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hiveserver2-site.xml @@ -0,0 +1,41 @@ +<?xml version="1.0"?> +<?xml-stylesheet type="text/xsl" href="configuration.xsl"?> +<!-- +Licensed to the Apache Software Foundation (ASF) under one or more +contributor license agreements. See the NOTICE file distributed with +this work for additional information regarding copyright ownership. +The ASF licenses this file to You under the Apache License, Version 2.0 +(the "License"); you may not use this file except in compliance with +the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +--> + +<configuration supports_final="true"> + + <property> + <name>hive.metastore.metrics.enabled</name> + <value>true</value> + <value-attributes> + <type>boolean</type> + </value-attributes> + </property> + <property> + <name>hive.service.metrics.reporter</name> + <value>JSON_FILE, JMX, HADOOP2</value> + </property> + <property> + <name>hive.service.metrics.hadoop2.component</name> + <value>hiveserver2</value> + </property> + <property> + <name>hive.service.metrics.file.location</name> + <value>/var/log/hive/hiveserver2-report.json</value> + </property> +</configuration> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/2816fc22/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py index f63fcd4..6e27ded 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py +++ b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py @@ -224,6 +224,11 @@ class TestHiveMetastore(RMFTestCase): content = DownloadSource('http://c6401.ambari.apache.org:8080/resources/DBConnectionVerification.jar'), mode = 0644, ) + self.assertResourceCalled('File', '/etc/hive/conf.server/hadoop-metrics2-hivemetastore.properties', + owner = 'hive', + group = 'hadoop', + content = Template('hadoop-metrics2-hivemetastore.properties.j2') + ) self.assertResourceCalled('File', '/tmp/start_metastore_script', content = StaticFile('startMetastore.sh'), mode = 0755, @@ -332,6 +337,11 @@ class TestHiveMetastore(RMFTestCase): content = DownloadSource('http://c6401.ambari.apache.org:8080/resources/DBConnectionVerification.jar'), mode = 0644, ) + self.assertResourceCalled('File', '/etc/hive/conf.server/hadoop-metrics2-hivemetastore.properties', + owner = 'hive', + group = 'hadoop', + content = Template('hadoop-metrics2-hivemetastore.properties.j2') + ) self.assertResourceCalled('File', '/tmp/start_metastore_script', content = StaticFile('startMetastore.sh'), mode = 0755, @@ -467,6 +477,11 @@ class TestHiveMetastore(RMFTestCase): mode = 0644, ) + self.assertResourceCalled('File', '/usr/hdp/current/hive-server2/conf/conf.server/hadoop-metrics2-hivemetastore.properties', + owner = 'hive', + group = 'hadoop', + content = Template('hadoop-metrics2-hivemetastore.properties.j2') + ) self.assertResourceCalled('File', '/tmp/start_metastore_script', content = StaticFile('startMetastore.sh'), mode = 0755) http://git-wip-us.apache.org/repos/asf/ambari/blob/2816fc22/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py index 26e3f72..ea361fb 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py +++ b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py @@ -492,6 +492,11 @@ class TestHiveServer(RMFTestCase): content=Template('startHiveserver2.sh.j2'), mode=0755, ) + self.assertResourceCalled('File', '/etc/hive/conf.server/hadoop-metrics2-hiveserver2.properties', + owner = 'hive', + group = 'hadoop', + content = Template('hadoop-metrics2-hiveserver2.properties.j2') + ) self.assertResourceCalled('Directory', '/var/run/hive', owner='hive', mode=0755, @@ -680,6 +685,11 @@ class TestHiveServer(RMFTestCase): content=Template('startHiveserver2.sh.j2'), mode=0755, ) + self.assertResourceCalled('File', '/etc/hive/conf.server/hadoop-metrics2-hiveserver2.properties', + owner = 'hive', + group = 'hadoop', + content = Template('hadoop-metrics2-hiveserver2.properties.j2') + ) self.assertResourceCalled('Directory', '/var/run/hive', owner='hive', group='hadoop', @@ -745,7 +755,7 @@ From source with checksum 150f554beae04f76f814f59549dead8b""" ) self.assertResourceCalled('Execute', ('ambari-python-wrap', '/usr/bin/hdp-select', 'set', 'hive-server2', '2.2.1.0-2065'), sudo=True,) - self.assertResourceCalledByIndex(31, 'Execute', 'hive --config /etc/hive/conf.server --service hiveserver2 --deregister 1.2.1.2.3.0.0-2434', + self.assertResourceCalledByIndex(32, 'Execute', 'hive --config /etc/hive/conf.server --service hiveserver2 --deregister 1.2.1.2.3.0.0-2434', path=['/bin:/usr/hdp/current/hive-server2/bin:/usr/hdp/current/hadoop-client/bin'], tries=1, user='hive') @@ -768,7 +778,7 @@ From source with checksum 150f554beae04f76f814f59549dead8b""" ) self.assertResourceCalled('Execute', ('ambari-python-wrap', '/usr/bin/hdp-select', 'set', 'hive-server2', '2.2.1.0-2065'), sudo=True,) - self.assertResourceCalledByIndex(33, 'Execute', 'hive --config /etc/hive/conf.server --service hiveserver2 --deregister 1.2.1.2.3.0.0-2434', + self.assertResourceCalledByIndex(34, 'Execute', 'hive --config /etc/hive/conf.server --service hiveserver2 --deregister 1.2.1.2.3.0.0-2434', path=['/bin:/usr/hdp/current/hive-server2/bin:/usr/hdp/current/hadoop-client/bin'], tries=1, user='hive') http://git-wip-us.apache.org/repos/asf/ambari/blob/2816fc22/ambari-server/src/test/python/stacks/2.1/HIVE/test_hive_metastore.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.1/HIVE/test_hive_metastore.py b/ambari-server/src/test/python/stacks/2.1/HIVE/test_hive_metastore.py index d90d977..f238ecc 100644 --- a/ambari-server/src/test/python/stacks/2.1/HIVE/test_hive_metastore.py +++ b/ambari-server/src/test/python/stacks/2.1/HIVE/test_hive_metastore.py @@ -249,6 +249,11 @@ class TestHiveMetastore(RMFTestCase): content = DownloadSource('http://c6401.ambari.apache.org:8080/resources/DBConnectionVerification.jar'), mode = 0644, ) + self.assertResourceCalled('File', '/etc/hive/conf.server/hadoop-metrics2-hivemetastore.properties', + owner = 'hive', + group = 'hadoop', + content = Template('hadoop-metrics2-hivemetastore.properties.j2') + ) self.assertResourceCalled('File', '/tmp/start_metastore_script', content = StaticFile('startMetastore.sh'), mode = 0755, @@ -345,6 +350,13 @@ class TestHiveMetastore(RMFTestCase): content = DownloadSource('http://c6401.ambari.apache.org:8080/resources/DBConnectionVerification.jar'), mode = 0644, ) + + self.assertResourceCalled('File', '/etc/hive/conf.server/hadoop-metrics2-hivemetastore.properties', + owner = 'hive', + group = 'hadoop', + content = Template('hadoop-metrics2-hivemetastore.properties.j2') + ) + self.assertResourceCalled('File', '/tmp/start_metastore_script', content = StaticFile('startMetastore.sh'), mode = 0755,
