AMBARI-5265. Add Accumulo to Ambari stack definition (Billie Rinaldi via smohanty)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/08dd22f9 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/08dd22f9 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/08dd22f9 Branch: refs/heads/trunk Commit: 08dd22f940b5669ff3e4e9d001687d668b7e3c25 Parents: 75e982a Author: Sumit Mohanty <[email protected]> Authored: Tue Mar 10 21:35:41 2015 -0700 Committer: Sumit Mohanty <[email protected]> Committed: Tue Mar 10 21:35:41 2015 -0700 ---------------------------------------------------------------------- .../ACCUMULO/1.6.1.2.2.0/alerts.json | 139 ++++++++++ .../1.6.1.2.2.0/configuration/accumulo-env.xml | 136 ++++++++++ .../configuration/accumulo-log4j.xml | 112 +++++++++ .../1.6.1.2.2.0/configuration/accumulo-site.xml | 180 +++++++++++++ .../ACCUMULO/1.6.1.2.2.0/kerberos.json | 93 +++++++ .../ACCUMULO/1.6.1.2.2.0/metainfo.xml | 161 ++++++++++++ .../package/files/accumulo-metrics.xml | 60 +++++ .../ACCUMULO/1.6.1.2.2.0/package/files/gc | 16 ++ .../ACCUMULO/1.6.1.2.2.0/package/files/masters | 16 ++ .../ACCUMULO/1.6.1.2.2.0/package/files/monitor | 16 ++ .../ACCUMULO/1.6.1.2.2.0/package/files/slaves | 16 ++ .../ACCUMULO/1.6.1.2.2.0/package/files/tracers | 16 ++ .../1.6.1.2.2.0/package/scripts/__init__.py | 19 ++ .../1.6.1.2.2.0/package/scripts/accumulo.py | 120 +++++++++ .../package/scripts/accumulo_client.py | 45 ++++ .../package/scripts/accumulo_configuration.py | 252 +++++++++++++++++++ .../1.6.1.2.2.0/package/scripts/accumulo_gc.py | 24 ++ .../package/scripts/accumulo_master.py | 24 ++ .../package/scripts/accumulo_monitor.py | 24 ++ .../package/scripts/accumulo_script.py | 117 +++++++++ .../package/scripts/accumulo_service.py | 71 ++++++ .../package/scripts/accumulo_tracer.py | 24 ++ .../package/scripts/accumulo_tserver.py | 24 ++ .../1.6.1.2.2.0/package/scripts/params.py | 125 +++++++++ .../package/scripts/service_check.py | 59 +++++ .../package/scripts/status_params.py | 33 +++ .../package/templates/auditLog.xml.j2 | 35 +++ .../package/templates/generic_logger.xml.j2 | 83 ++++++ .../hadoop-metrics2-accumulo.properties.j2 | 47 ++++ .../package/templates/monitor_logger.xml.j2 | 64 +++++ .../src/main/resources/role_command_order.json | 9 +- .../stacks/HDP/2.2/role_command_order.json | 7 + .../HDP/2.2/services/ACCUMULO/metainfo.xml | 46 ++++ .../server/metadata/RoleCommandOrderTest.java | 2 - 34 files changed, 2212 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/08dd22f9/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/alerts.json ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/alerts.json b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/alerts.json new file mode 100644 index 0000000..ac09dc6 --- /dev/null +++ b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/alerts.json @@ -0,0 +1,139 @@ +{ + "ACCUMULO": { + "ACCUMULO_MASTER": [ + { + "name": "accumulo_master_process", + "label": "Accumulo Master Process", + "description": "This alert is triggered if the Accumulo master process cannot be confirmed to be up and listening on the network for the configured critical threshold, given in seconds.", + "interval": 1, + "scope": "ANY", + "source": { + "type": "PORT", + "uri": "{{accumulo-site/master.port.client}}", + "default_port": 9999, + "reporting": { + "ok": { + "text": "TCP OK - {0:.3f}s response on port {1}" + }, + "warning": { + "text": "TCP OK - {0:.3f}s response on port {1}", + "value": 1.5 + }, + "critical": { + "text": "Connection failed: {0} to {1}:{2}", + "value": 5.0 + } + } + } + } + ], + "ACCUMULO_TSERVER": [ + { + "name": "accumulo_tserver_process", + "label": "Accumulo TServer Process", + "description": "This host-level alert is triggered if the TServer processes cannot be confirmed to be up and listening on the network for the configured critical threshold, given in seconds.", + "interval": 1, + "scope": "HOST", + "source": { + "type": "PORT", + "uri": "{{accumulo-site/tserver.port.client}}", + "default_port": 9997, + "reporting": { + "ok": { + "text": "TCP OK - {0:.3f}s response on port {1}" + }, + "warning": { + "text": "TCP OK - {0:.3f}s response on port {1}", + "value": 1.5 + }, + "critical": { + "text": "Connection failed: {0} to {1}:{2}", + "value": 5.0 + } + } + } + } + ], + "ACCUMULO_GC": [ + { + "name": "accumulo_gc_process", + "label": "Accumulo GC Process", + "description": "This host-level alert is triggered if the GC process cannot be confirmed to be up and listening on the network for the configured critical threshold, given in seconds.", + "interval": 1, + "scope": "HOST", + "source": { + "type": "PORT", + "uri": "{{accumulo-site/gc.port.client}}", + "default_port": 50091, + "reporting": { + "ok": { + "text": "TCP OK - {0:.3f}s response on port {1}" + }, + "warning": { + "text": "TCP OK - {0:.3f}s response on port {1}", + "value": 1.5 + }, + "critical": { + "text": "Connection failed: {0} to {1}:{2}", + "value": 5.0 + } + } + } + } + ], + "ACCUMULO_MONITOR": [ + { + "name": "accumulo_monitor_process", + "label": "Accumulo Monitor Process", + "description": "This host-level alert is triggered if the Monitor process cannot be confirmed to be up and listening on the network for the configured critical threshold, given in seconds.", + "interval": 1, + "scope": "HOST", + "source": { + "type": "PORT", + "uri": "{{accumulo-site/monitor.port.client}}", + "default_port": 50095, + "reporting": { + "ok": { + "text": "TCP OK - {0:.3f}s response on port {1}" + }, + "warning": { + "text": "TCP OK - {0:.3f}s response on port {1}", + "value": 1.5 + }, + "critical": { + "text": "Connection failed: {0} to {1}:{2}", + "value": 5.0 + } + } + } + } + ], + "ACCUMULO_TRACER": [ + { + "name": "accumulo_tracer_process", + "label": "Accumulo Tracer Process", + "description": "This host-level alert is triggered if the Tracer process cannot be confirmed to be up and listening on the network for the configured critical threshold, given in seconds.", + "interval": 1, + "scope": "HOST", + "source": { + "type": "PORT", + "uri": "{{accumulo-site/trace.port.client}}", + "default_port": 12234, + "reporting": { + "ok": { + "text": "TCP OK - {0:.3f}s response on port {1}" + }, + "warning": { + "text": "TCP OK - {0:.3f}s response on port {1}", + "value": 1.5 + }, + "critical": { + "text": "Connection failed: {0} to {1}:{2}", + "value": 5.0 + } + } + } + } + ] + } +} http://git-wip-us.apache.org/repos/asf/ambari/blob/08dd22f9/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/configuration/accumulo-env.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/configuration/accumulo-env.xml b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/configuration/accumulo-env.xml new file mode 100644 index 0000000..dfec771 --- /dev/null +++ b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/configuration/accumulo-env.xml @@ -0,0 +1,136 @@ +<?xml version="1.0"?> +<?xml-stylesheet type="text/xsl" href="configuration.xsl"?> +<!-- +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +--> + +<configuration> + <property require-input="true"> + <name>accumulo_root_password</name> + <value></value> + <property-type>PASSWORD</property-type> + <description>Password for the Accumulo root user. This password will be + used to initialize Accumulo and to create the trace user. Changing this + will not change the password for the Accumulo root user.</description> + </property> + <property require-input="true"> + <name>instance_secret</name> + <value></value> + <property-type>PASSWORD</property-type> + <description>A secret unique to a given instance that all Accumulo server + processes must know in order to communicate with one + another.</description> + </property> + <property require-input="false"> + <name>trace_password</name> + <value>trace</value> + <property-type>PASSWORD</property-type> + <description>Password for the trace user. The trace user will be created + with this password if that user does not already exist. Changing this + will not change the password for the trace user.</description> + </property> + <property> + <name>accumulo_log_dir</name> + <value>/var/log/accumulo</value> + <description>Log Directories for Accumulo.</description> + </property> + <property> + <name>accumulo_pid_dir</name> + <value>/var/run/accumulo</value> + <description>Pid Directory for Accumulo.</description> + </property> + <property> + <name>accumulo_instance_name</name> + <value>hdp-accumulo-instance</value> + <description>Accumulo Instance Name.</description> + </property> + <property> + <name>accumulo_user</name> + <value>accumulo</value> + <property-type>USER</property-type> + <description>Accumulo User Name.</description> + </property> + <property> + <name>master_heapsize</name> + <value>128m</value> + <description>Accumulo Master Heap Size.</description> + </property> + <property> + <name>tserver_heapsize</name> + <value>256m</value> + <description>Accumulo Tablet Server Heap Size.</description> + </property> + <property> + <name>monitor_heapsize</name> + <value>64m</value> + <description>Accumulo Monitor Heap Size.</description> + </property> + <property> + <name>gc_heapsize</name> + <value>64m</value> + <description>Accumulo Garbage Collector Heap Size.</description> + </property> + <property> + <name>other_heapsize</name> + <value>128m</value> + <description>Accumulo Other Heap Size.</description> + </property> + <property> + <name>content</name> + <description>The template for a client accumulo-env.sh file.</description> + <value> +#! /usr/bin/env bash +export HADOOP_PREFIX={{hadoop_prefix}} +export HADOOP_CONF_DIR={{hadoop_conf_dir}} +export JAVA_HOME={{java64_home}} +export ZOOKEEPER_HOME={{zookeeper_home}} +export ACCUMULO_LOG_DIR={{log_dir}} +export ACCUMULO_CONF_DIR={{conf_dir}} +export ACCUMULO_TSERVER_OPTS="-Xmx{{tserver_heapsize}} -Xms{{tserver_heapsize}}" +export ACCUMULO_MASTER_OPTS="-Xmx{{master_heapsize}} -Xms{{master_heapsize}}" +export ACCUMULO_MONITOR_OPTS="-Xmx{{monitor_heapsize}} -Xms{{monitor_heapsize}}" +export ACCUMULO_GC_OPTS="-Xmx{{gc_heapsize}} -Xms{{gc_heapsize}}" +export ACCUMULO_GENERAL_OPTS="-XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -Djava.net.preferIPv4Stack=true" +export ACCUMULO_OTHER_OPTS="-Xmx{{other_heapsize}} -Xms{{other_heapsize}}" +# what do when the JVM runs out of heap memory +export ACCUMULO_KILL_CMD='kill -9 %p' + </value> + </property> + <property> + <name>server_content</name> + <description>The template for a server accumulo-env.sh file.</description> + <value> +#! /usr/bin/env bash +export HADOOP_PREFIX={{hadoop_prefix}} +export HADOOP_CONF_DIR={{hadoop_conf_dir}} +export JAVA_HOME={{java64_home}} +export ZOOKEEPER_HOME={{zookeeper_home}} +export ACCUMULO_LOG_DIR={{log_dir}} +export ACCUMULO_CONF_DIR={{server_conf_dir}} +export ACCUMULO_TSERVER_OPTS="-Xmx{{tserver_heapsize}} -Xms{{tserver_heapsize}}" +export ACCUMULO_MASTER_OPTS="-Xmx{{master_heapsize}} -Xms{{master_heapsize}}" +export ACCUMULO_MONITOR_OPTS="-Xmx{{monitor_heapsize}} -Xms{{monitor_heapsize}}" +export ACCUMULO_GC_OPTS="-Xmx{{gc_heapsize}} -Xms{{gc_heapsize}}" +export ACCUMULO_GENERAL_OPTS="-XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -Djava.net.preferIPv4Stack=true" +export ACCUMULO_OTHER_OPTS="-Xmx{{other_heapsize}} -Xms{{other_heapsize}}" +# what do when the JVM runs out of heap memory +export ACCUMULO_KILL_CMD='kill -9 %p' + </value> + </property> +</configuration> http://git-wip-us.apache.org/repos/asf/ambari/blob/08dd22f9/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/configuration/accumulo-log4j.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/configuration/accumulo-log4j.xml b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/configuration/accumulo-log4j.xml new file mode 100644 index 0000000..4845028 --- /dev/null +++ b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/configuration/accumulo-log4j.xml @@ -0,0 +1,112 @@ +<?xml version="1.0"?> +<?xml-stylesheet type="text/xsl" href="configuration.xsl"?> +<!-- +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +--> + +<configuration> + + <property> + <name>audit_log_level</name> + <value>OFF</value> + <description>Log level for audit logging</description> + </property> + + <property> + <name>monitor_forwarding_log_level</name> + <value>WARN</value> + <description>Log level for logging forwarded to the Accumulo + Monitor</description> + </property> + + <property> + <name>debug_log_size</name> + <value>1000M</value> + <description>Size of each debug rolling log file</description> + </property> + + <property> + <name>debug_num_logs</name> + <value>10</value> + <description>Number of rolling debug log files to keep</description> + </property> + + <property> + <name>info_log_size</name> + <value>1000M</value> + <description>Size of each info rolling log file</description> + </property> + + <property> + <name>info_num_logs</name> + <value>10</value> + <description>Number of rolling info log files to keep</description> + </property> + + <property> + <name>content</name> + <description>Custom log4j.properties</description> + <value> +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# default logging properties: +# by default, log everything at INFO or higher to the console +log4j.rootLogger=INFO,A1 + +# hide Jetty junk +log4j.logger.org.mortbay.log=WARN,A1 + +# hide "Got brand-new compressor" messages +log4j.logger.org.apache.hadoop.io.compress=WARN,A1 +log4j.logger.org.apache.accumulo.core.file.rfile.bcfile.Compression=WARN,A1 + +# hide junk from TestRandomDeletes +log4j.logger.org.apache.accumulo.test.TestRandomDeletes=WARN,A1 + +# hide junk from VFS +log4j.logger.org.apache.commons.vfs2.impl.DefaultFileSystemManager=WARN,A1 + +# hide almost everything from zookeeper +log4j.logger.org.apache.zookeeper=ERROR,A1 + +# hide AUDIT messages in the shell, alternatively you could send them to a different logger +log4j.logger.org.apache.accumulo.core.util.shell.Shell.audit=WARN,A1 + +# Send most things to the console +log4j.appender.A1=org.apache.log4j.ConsoleAppender +log4j.appender.A1.layout.ConversionPattern=%d{ISO8601} [%-8c{2}] %-5p: %m%n +log4j.appender.A1.layout=org.apache.log4j.PatternLayout + + </value> + </property> + +</configuration> http://git-wip-us.apache.org/repos/asf/ambari/blob/08dd22f9/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/configuration/accumulo-site.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/configuration/accumulo-site.xml b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/configuration/accumulo-site.xml new file mode 100644 index 0000000..fbeaad2 --- /dev/null +++ b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/configuration/accumulo-site.xml @@ -0,0 +1,180 @@ +<?xml version="1.0" encoding="UTF-8"?> +<?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> + <!-- Put your site-specific accumulo configurations here. The available configuration values along with their defaults are documented in docs/config.html Unless + you are simply testing at your workstation, you will most definitely need to change the three entries below. --> + + <property> + <name>instance.volumes</name> + <value>hdfs://localhost:8020/apps/accumulo/data</value> + <description>Location of Accumulo data files in HDFS.</description> + </property> + + <property> + <name>instance.zookeeper.host</name> + <value>localhost:2181</value> + <description>Comma-separated list of ZooKeeper server:port + pairs.</description> + </property> + + <property> + <name>instance.zookeeper.timeout</name> + <value>30s</value> + <description>Timeout for zookeeper connections.</description> + </property> + + <property> + <name>general.kerberos.principal</name> + <value>*</value> + <description>Name of the kerberos principal to use.</description> + </property> + + <property> + <name>general.kerberos.keytab</name> + <value>*</value> + <description>Path to the kerberos keytab to use.</description> + </property> + + <property> + <name>instance.rpc.ssl.enabled</name> + <value>false</value> + <description>Controls whether or not SSL is enabled for + Accumulo RPC.</description> + </property> + + <property> + <name>instance.rpc.ssl.clientAuth</name> + <value>false</value> + <description>Controls whether or not client authentication is required + when SSL is enabled for Accumulo.</description> + </property> + + <property> + <name>tserver.memory.maps.max</name> + <value>80M</value> + <description>Amount of memory to use for Accumulo's in-memory + map, where incoming writes are sorted. If native maps are enabled + (tserver.memory.maps.native.enabled) this memory is + off-heap.</description> + </property> + + <property> + <name>tserver.memory.maps.native.enabled</name> + <value>false</value> + <description>Controls whether or not native maps are enabled + for Accumulo's in-memory map, where incoming writes are + sorted (see also tserver.memory.maps.max).</description> + </property> + + <property> + <name>tserver.cache.data.size</name> + <value>7M</value> + <description>Size of on-heap block cache for data blocks.</description> + </property> + + <property> + <name>tserver.cache.index.size</name> + <value>20M</value> + <description>Size of on-heap block cache for index blocks.</description> + </property> + + <property> + <name>tserver.sort.buffer.size</name> + <value>50M</value> + <description>Size of on-heap block cache for data blocks.</description> + </property> + + <property> + <name>tserver.walog.max.size</name> + <value>40M</value> + <description>Amount of memory to use for sorting walogs when + recovering from tserver failure.</description> + </property> + + <property> + <name>master.port.client</name> + <value>9999</value> + <description>Port for client connections to the master.</description> + </property> + + <property> + <name>trace.port.client</name> + <value>12234</value> + <description>Port for client connections to the master.</description> + </property> + + <property> + <name>tserver.port.client</name> + <value>9997</value> + <description>Port for delivering tracing data to the tracer + process.</description> + </property> + + <property> + <name>gc.port.client</name> + <value>50091</value> + <description>Port for monitoring the Accumulo garbage + collector.</description> + </property> + + <property> + <name>monitor.port.client</name> + <value>50095</value> + <description>Port for the Accumulo monitor UI.</description> + </property> + + <property> + <name>monitor.port.log4j</name> + <value>4560</value> + <description>Port for delivering logs for aggregation by the + Accumulo monitor.</description> + </property> + + <property> + <name>trace.user</name> + <value>trace</value> + <description>User that the tracer process uses to write + tracing data to Accumulo.</description> + </property> + + <property> + <name>general.classpaths</name> + <value> + $ACCUMULO_HOME/lib/accumulo-server.jar, + $ACCUMULO_HOME/lib/accumulo-core.jar, + $ACCUMULO_HOME/lib/accumulo-start.jar, + $ACCUMULO_HOME/lib/accumulo-fate.jar, + $ACCUMULO_HOME/lib/accumulo-proxy.jar, + $ACCUMULO_HOME/lib/[^.].*.jar, + $ZOOKEEPER_HOME/zookeeper[^.].*.jar, + $HADOOP_CONF_DIR, + /usr/hdp/current/hadoop-client/[^.].*.jar, + /usr/hdp/current/hadoop-client/lib/(?!slf4j)[^.].*.jar, + /usr/hdp/current/hadoop-hdfs-client/[^.].*.jar, + /usr/hdp/current/hadoop-mapreduce-client/[^.].*.jar, + /usr/hdp/current/hadoop-yarn-client/[^.].*.jar, + /usr/hdp/current/hadoop-yarn-client/lib/jersey.*.jar, + /usr/hdp/current/hive-client/lib/hive-accumulo-handler.jar, + </value> + <description>List of jars and directories that will be added to + Accumulo's classpath. Ordering matters, as the entries will be + searched in order when attempting to load a class.</description> + </property> +</configuration> http://git-wip-us.apache.org/repos/asf/ambari/blob/08dd22f9/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/kerberos.json ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/kerberos.json b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/kerberos.json new file mode 100644 index 0000000..4e415e1 --- /dev/null +++ b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/kerberos.json @@ -0,0 +1,93 @@ +{ + "services": [ + { + "name": "ACCUMULO", + "identities": [ + { + "name": "accumulo", + "principal": { + "value": "${accumulo-env/accumulo_user}@${realm}", + "type" : "user", + "configuration": "accumulo-env/accumulo_principal_name", + "local_username": "${accumulo-env/accumulo_user}" + }, + "keytab": { + "file": "${keytab_dir}/accumulo.headless.keytab", + "owner": { + "name": "${accumulo-env/accumulo_user}", + "access": "r" + }, + "group": { + "name": "${cluster-env/user_group}", + "access": "r" + }, + "configuration": "accumulo-env/accumulo_user_keytab" + } + }, + { + "name": "accumulo_service", + "principal": { + "value": "${accumulo-env/accumulo_user}/_HOST@${realm}", + "type" : "service", + "configuration": "accumulo-site/general.kerberos.principal", + "local_username": "${accumulo-env/accumulo_user}" + + }, + "keytab": { + "file": "${keytab_dir}/accumulo.service.keytab", + "owner": { + "name": "${accumulo-env/accumulo_user}", + "access": "r" + }, + "group": { + "name": "${cluster-env/user_group}", + "access": "" + }, + "configuration": "accumulo-site/general.kerberos.keytab" + } + }, + { + "name": "/hdfs" + }, + { + "name": "/smokeuser" + } + ], + "components": [ + { + "name": "ACCUMULO_MASTER", + "identities": [ + { + "name": "/accumulo_service" + } + ] + }, + { + "name": "ACCUMULO_TSERVER", + "identities": [ + { + "name": "/accumulo_service" + } + ] + }, + { + "name": "ACCUMULO_MONITOR", + "identities": [ + { + "name": "/accumulo_service" + } + ] + }, + { + "name": "ACCUMULO_GC", + "identities": [ + { + "name": "/accumulo_service" + } + ] + } + ] + } + ] +} + http://git-wip-us.apache.org/repos/asf/ambari/blob/08dd22f9/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/metainfo.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/metainfo.xml b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/metainfo.xml new file mode 100644 index 0000000..6604e53 --- /dev/null +++ b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/metainfo.xml @@ -0,0 +1,161 @@ +<?xml version="1.0"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<metainfo> + <schemaVersion>2.0</schemaVersion> + <services> + <service> + <name>ACCUMULO</name> + <displayName>Accumulo</displayName> + <comment>Robust, scalable, high performance distributed key/value store. + </comment> + <version>1.6.1.2.2.0</version> + <components> + <component> + <name>ACCUMULO_MASTER</name> + <displayName>Accumulo Master</displayName> + <category>MASTER</category> + <cardinality>1+</cardinality> + <dependencies> + <dependency> + <name>HDFS/HDFS_CLIENT</name> + <scope>host</scope> + <auto-deploy> + <enabled>true</enabled> + </auto-deploy> + </dependency> + <dependency> + <name>ZOOKEEPER/ZOOKEEPER_SERVER</name> + <scope>cluster</scope> + <auto-deploy> + <enabled>true</enabled> + <co-locate>ACCUMULO/ACCUMULO_MASTER</co-locate> + </auto-deploy> + </dependency> + </dependencies> + <commandScript> + <script>scripts/accumulo_master.py</script> + <scriptType>PYTHON</scriptType> + <timeout>600</timeout> + </commandScript> + </component> + + <component> + <name>ACCUMULO_MONITOR</name> + <displayName>Accumulo Monitor</displayName> + <category>MASTER</category> + <cardinality>1+</cardinality> + <commandScript> + <script>scripts/accumulo_monitor.py</script> + <scriptType>PYTHON</scriptType> + <timeout>600</timeout> + </commandScript> + </component> + + <component> + <name>ACCUMULO_GC</name> + <displayName>Accumulo GC</displayName> + <category>MASTER</category> + <cardinality>1+</cardinality> + <commandScript> + <script>scripts/accumulo_gc.py</script> + <scriptType>PYTHON</scriptType> + <timeout>600</timeout> + </commandScript> + </component> + + <component> + <name>ACCUMULO_TRACER</name> + <displayName>Accumulo Tracer</displayName> + <category>MASTER</category> + <cardinality>1+</cardinality> + <commandScript> + <script>scripts/accumulo_tracer.py</script> + <scriptType>PYTHON</scriptType> + </commandScript> + </component> + + <component> + <name>ACCUMULO_TSERVER</name> + <displayName>Accumulo TServer</displayName> + <category>SLAVE</category> + <cardinality>1+</cardinality> + <commandScript> + <script>scripts/accumulo_tserver.py</script> + <scriptType>PYTHON</scriptType> + </commandScript> + </component> + + <component> + <name>ACCUMULO_CLIENT</name> + <displayName>Accumulo Client</displayName> + <category>CLIENT</category> + <cardinality>1+</cardinality> + <commandScript> + <script>scripts/accumulo_client.py</script> + <scriptType>PYTHON</scriptType> + </commandScript> + <configFiles> + <configFile> + <type>xml</type> + <fileName>accumulo-site.xml</fileName> + <dictionaryName>accumulo-site</dictionaryName> + </configFile> + <configFile> + <type>env</type> + <fileName>accumulo-env.sh</fileName> + <dictionaryName>accumulo-env</dictionaryName> + </configFile> + <configFile> + <type>env</type> + <fileName>log4j.properties</fileName> + <dictionaryName>accumulo-log4j</dictionaryName> + </configFile> + </configFiles> + </component> + </components> + + <osSpecifics> + <osSpecific> + <osFamily>any</osFamily> + <packages> + <package> + <name>accumulo</name> + </package> + </packages> + </osSpecific> + </osSpecifics> + + <commandScript> + <script>scripts/service_check.py</script> + <scriptType>PYTHON</scriptType> + <timeout>300</timeout> + </commandScript> + + <requiredServices> + <service>ZOOKEEPER</service> + <service>HDFS</service> + </requiredServices> + + <configuration-dependencies> + <config-type>accumulo-env</config-type> + <config-type>accumulo-site</config-type> + </configuration-dependencies> + + </service> + </services> +</metainfo> http://git-wip-us.apache.org/repos/asf/ambari/blob/08dd22f9/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/files/accumulo-metrics.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/files/accumulo-metrics.xml b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/files/accumulo-metrics.xml new file mode 100644 index 0000000..3b97809 --- /dev/null +++ b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/files/accumulo-metrics.xml @@ -0,0 +1,60 @@ +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<!-- + This file follows the conventions for XMLConfiguration files specified in the Apache Commons Configuration 1.5 Library. Changes to this file will be noticed + at runtime (see the FileChangedReloadingStrategy class in Commons Configuration). +--> +<config> +<!-- + Metrics log directory +--> + <logging> + <dir>${ACCUMULO_HOME}/metrics</dir> + </logging> +<!-- + Enable/Disable metrics accumulation on the different servers and their components + NOTE: Turning on logging can be expensive because it will use several more file handles and will create a lot of short lived objects. +--> + <master> + <enabled type="boolean">false</enabled> + <logging type="boolean">false</logging> + </master> + <tserver> + <enabled type="boolean">false</enabled> + <logging type="boolean">false</logging> + <update> + <enabled type="boolean">false</enabled> + <logging type="boolean">false</logging> + </update> + <scan> + <enabled type="boolean">false</enabled> + <logging type="boolean">false</logging> + </scan> + <minc> + <enabled type="boolean">false</enabled> + <logging type="boolean">false</logging> + </minc> + </tserver> + <thrift> + <enabled type="boolean">false</enabled> + <logging type="boolean">false</logging> + </thrift> + <replication> + <enabled type="boolean">false</enabled> + <logging type="boolean">false</logging> + </replication> +</config> http://git-wip-us.apache.org/repos/asf/ambari/blob/08dd22f9/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/files/gc ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/files/gc b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/files/gc new file mode 100644 index 0000000..63fb8bb --- /dev/null +++ b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/files/gc @@ -0,0 +1,16 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +localhost http://git-wip-us.apache.org/repos/asf/ambari/blob/08dd22f9/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/files/masters ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/files/masters b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/files/masters new file mode 100644 index 0000000..63fb8bb --- /dev/null +++ b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/files/masters @@ -0,0 +1,16 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +localhost http://git-wip-us.apache.org/repos/asf/ambari/blob/08dd22f9/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/files/monitor ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/files/monitor b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/files/monitor new file mode 100644 index 0000000..63fb8bb --- /dev/null +++ b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/files/monitor @@ -0,0 +1,16 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +localhost http://git-wip-us.apache.org/repos/asf/ambari/blob/08dd22f9/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/files/slaves ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/files/slaves b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/files/slaves new file mode 100644 index 0000000..63fb8bb --- /dev/null +++ b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/files/slaves @@ -0,0 +1,16 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +localhost http://git-wip-us.apache.org/repos/asf/ambari/blob/08dd22f9/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/files/tracers ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/files/tracers b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/files/tracers new file mode 100644 index 0000000..63fb8bb --- /dev/null +++ b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/files/tracers @@ -0,0 +1,16 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +localhost http://git-wip-us.apache.org/repos/asf/ambari/blob/08dd22f9/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/__init__.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/__init__.py b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/__init__.py new file mode 100644 index 0000000..5561e10 --- /dev/null +++ b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/__init__.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python +""" +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +""" http://git-wip-us.apache.org/repos/asf/ambari/blob/08dd22f9/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo.py b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo.py new file mode 100644 index 0000000..e974573 --- /dev/null +++ b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo.py @@ -0,0 +1,120 @@ +#!/usr/bin/env python +""" +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +""" +import os + +from resource_management import * +import sys + +def accumulo(name=None # 'master' or 'tserver' or 'client' + ): + import params + + Directory( params.accumulo_conf_dir, + owner = params.accumulo_user, + recursive = True + ) + + XmlConfig( "accumulo-site.xml", + conf_dir = params.accumulo_conf_dir, + configurations = params.config['configurations']['accumulo-site'], + configuration_attributes=params.config['configuration_attributes']['accumulo-site'], + owner = params.accumulo_user, + mode = 0600 + ) + + 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, + ) + + if 'accumulo-policy' in params.config['configurations']: + XmlConfig( "accumulo-policy.xml", + conf_dir = params.accumulo_conf_dir, + configurations = params.config['configurations']['accumulo-policy'], + configuration_attributes=params.config['configuration_attributes']['accumulo-policy'], + owner = params.accumulo_user, + ) + else: + File( format("{params.accumulo_conf_dir}/accumulo-policy.xml"), + owner = params.accumulo_user, + ) + + Directory (params.log_dir, + owner = params.accumulo_user, + recursive = True + ) + + if (params.log4j_props != None): + File(format("{params.accumulo_conf_dir}/log4j.properties"), + mode=0644, + owner=params.accumulo_user, + content=params.log4j_props + ) + elif (os.path.exists(format("{params.accumulo_conf_dir}/log4j.properties"))): + File(format("{params.accumulo_conf_dir}/log4j.properties"), + mode=0644, + owner=params.accumulo_user + ) + + if name in ["master","tserver"]: + params.HdfsDirectory(format("{params.accumulo_hdfs_root_dir}"), + action="create_delayed", + owner=params.accumulo_user, + ) + params.HdfsDirectory(format("{params.accumulo_hdfs_stage_dir}"), + action="create_delayed", + owner=params.accumulo_user, + mode=0751 + ) + params.HdfsDirectory(None, action="create") + + accumulo_StaticFile("auditLog.xml") + accumulo_StaticFile("generic_logger.xml") + accumulo_StaticFile("monitor_logger.xml") + accumulo_StaticFile("accumulo-metrics.xml") + + accumulo_StaticFile("tracers") + accumulo_StaticFile("gc") + accumulo_StaticFile("monitor") + accumulo_StaticFile('slaves') + accumulo_StaticFile('masters') + + accumulo_TemplateConfig('accumulo-env.sh') + +def accumulo_TemplateConfig(name, + tag=None + ): + import params + + TemplateConfig( format("{params.accumulo_conf_dir}/{name}"), + owner = params.accumulo_user, + template_tag = tag + ) + +def accumulo_StaticFile(name): + import params + + File(format("{params.accumulo_conf_dir}/{name}"), + mode=0644, + owner=params.accumulo_user, + content=StaticFile(name) + ) http://git-wip-us.apache.org/repos/asf/ambari/blob/08dd22f9/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_client.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_client.py b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_client.py new file mode 100644 index 0000000..1645304 --- /dev/null +++ b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_client.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python +""" +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +""" + +from resource_management import * + +from accumulo_configuration import setup_conf_dir + + +class AccumuloClient(Script): + def get_stack_to_component(self): + return {"HDP": "accumulo-client"} + + def install(self, env): + self.install_packages(env) + self.configure(env) + + def configure(self, env): + import params + env.set_params(params) + + setup_conf_dir(name='client') + + def status(self, env): + raise ClientComponentHasNoStatus() + + +if __name__ == "__main__": + AccumuloClient().execute() http://git-wip-us.apache.org/repos/asf/ambari/blob/08dd22f9/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_configuration.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_configuration.py b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_configuration.py new file mode 100644 index 0000000..1f653ad --- /dev/null +++ b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_configuration.py @@ -0,0 +1,252 @@ +#!/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 os + +def setup_conf_dir(name=None): # 'master' or 'tserver' or 'monitor' or 'gc' or 'tracer' or 'client' + import params + + # create the conf directory + Directory( params.conf_dir, + mode=0750, + owner = params.accumulo_user, + group = params.user_group, + recursive = True + ) + + if name == 'client': + dest_conf_dir = params.conf_dir + + # create a site file for client processes + configs = {} + configs.update(params.config['configurations']['accumulo-site']) + if "instance.secret" in configs: + configs.pop("instance.secret") + if "trace.token.property.password" in configs: + configs.pop("trace.token.property.password") + XmlConfig("accumulo-site.xml", + conf_dir = dest_conf_dir, + configurations = configs, + configuration_attributes=params.config['configuration_attributes']['accumulo-site'], + owner = params.accumulo_user, + group = params.user_group, + mode = 0644 + ) + + # create env file + File(format("{dest_conf_dir}/accumulo-env.sh"), + mode=0644, + group=params.user_group, + owner=params.accumulo_user, + content=InlineTemplate(params.env_sh_template) + ) + else: + dest_conf_dir = params.server_conf_dir + # create server conf directory + Directory( params.server_conf_dir, + mode=0700, + owner = params.accumulo_user, + group = params.user_group, + recursive = True + ) + # create a site file for server processes + configs = {} + configs.update(params.config['configurations']['accumulo-site']) + configs["instance.secret"] = params.config['configurations']['accumulo-env']['instance_secret'] + configs["trace.token.property.password"] = params.trace_password + XmlConfig( "accumulo-site.xml", + conf_dir = dest_conf_dir, + configurations = configs, + configuration_attributes=params.config['configuration_attributes']['accumulo-site'], + owner = params.accumulo_user, + group = params.user_group, + mode = 0600 + ) + + # create pid dir + Directory( params.pid_dir, + owner = params.accumulo_user, + group = params.user_group, + recursive = True + ) + + # create log dir + Directory (params.log_dir, + owner = params.accumulo_user, + group = params.user_group, + recursive = True + ) + + # create env file + File(format("{dest_conf_dir}/accumulo-env.sh"), + mode=0644, + group=params.user_group, + owner=params.accumulo_user, + content=InlineTemplate(params.server_env_sh_template) + ) + + # create client.conf file + configs = {} + configs["instance.name"] = params.instance_name + configs["instance.zookeeper.host"] = params.config['configurations']['accumulo-site']['instance.zookeeper.host'] + PropertiesFile(format("{dest_conf_dir}/client.conf"), + properties = configs, + owner = params.accumulo_user, + group = params.user_group + ) + + # create log4j.properties files + if (params.log4j_props != None): + File(format("{params.conf_dir}/log4j.properties"), + mode=0644, + group=params.user_group, + owner=params.accumulo_user, + content=params.log4j_props + ) + else: + File(format("{params.conf_dir}/log4j.properties"), + mode=0644, + group=params.user_group, + owner=params.hbase_user + ) + + # create logging configuration files + accumulo_TemplateConfig("auditLog.xml", dest_conf_dir) + accumulo_TemplateConfig("generic_logger.xml", dest_conf_dir) + accumulo_TemplateConfig("monitor_logger.xml", dest_conf_dir) + accumulo_StaticFile("accumulo-metrics.xml", dest_conf_dir) + + # create host files + accumulo_StaticFile("tracers", dest_conf_dir) + accumulo_StaticFile("gc", dest_conf_dir) + accumulo_StaticFile("monitor", dest_conf_dir) + accumulo_StaticFile("slaves", dest_conf_dir) + accumulo_StaticFile("masters", dest_conf_dir) + + # metrics configuration + if params.has_metric_collector: + accumulo_TemplateConfig( "hadoop-metrics2-accumulo.properties", dest_conf_dir) + + # other server setup + if name == 'master': + params.HdfsDirectory(format("/user/{params.accumulo_user}"), + action="create_delayed", + owner=params.accumulo_user, + mode=0700 + ) + params.HdfsDirectory(format("{params.parent_dir}"), + action="create_delayed", + owner=params.accumulo_user, + mode=0700 + ) + params.HdfsDirectory(None, action="create") + passfile = format("{params.exec_tmp_dir}/pass") + try: + File(passfile, + mode=0600, + group=params.user_group, + owner=params.accumulo_user, + content=InlineTemplate('{{root_password}}\n' + '{{root_password}}\n') + ) + Execute( format("cat {passfile} | {params.daemon_script} init " + "--instance-name {params.instance_name} " + "--clear-instance-name " + ">{params.log_dir}/accumulo-init.out " + "2>{params.log_dir}/accumulo-init.err"), + not_if=as_user(format("{params.kinit_cmd} " + "{params.hadoop_bin_dir}/hadoop --config " + "{params.hadoop_conf_dir} fs -stat " + "{params.instance_volumes}"), + params.accumulo_user), + user=params.accumulo_user) + finally: + os.remove(passfile) + + if name == 'tracer': + create_user(params.trace_user, params.trace_password) + create_user(params.smoke_test_user, params.smoke_test_password) + +def create_user(user, password): + import params + rpassfile = format("{params.exec_tmp_dir}/pass0") + passfile = format("{params.exec_tmp_dir}/pass") + cmdfile = format("{params.exec_tmp_dir}/cmds") + try: + File(cmdfile, + mode=0600, + group=params.user_group, + owner=params.accumulo_user, + content=InlineTemplate(format("createuser {user}\n" + "grant -s System.CREATE_TABLE -u {user}\n")) + ) + File(rpassfile, + mode=0600, + group=params.user_group, + owner=params.accumulo_user, + content=InlineTemplate('{{root_password}}\n') + ) + File(passfile, + mode=0600, + group=params.user_group, + owner=params.accumulo_user, + content=InlineTemplate(format("{params.root_password}\n" + "{password}\n" + "{password}\n")) + ) + Execute( format("cat {passfile} | {params.daemon_script} shell -u root " + "-f {cmdfile}"), + not_if=as_user(format("cat {rpassfile} | " + "{params.daemon_script} shell -u root " + "-e \"userpermissions -u {user}\""), + params.accumulo_user), + user=params.accumulo_user) + finally: + try_remove(rpassfile) + try_remove(passfile) + try_remove(cmdfile) + +def try_remove(file): + try: + os.remove(file) + except: + pass + +# create file 'name' from template +def accumulo_TemplateConfig(name, dest_conf_dir, tag=None): + import params + + TemplateConfig( format("{dest_conf_dir}/{name}"), + owner = params.accumulo_user, + group = params.user_group, + template_tag = tag + ) + +# create static file 'name' +def accumulo_StaticFile(name, dest_conf_dir): + import params + + File(format("{dest_conf_dir}/{name}"), + mode=0644, + group=params.user_group, + owner=params.accumulo_user, + content=StaticFile(name) + ) http://git-wip-us.apache.org/repos/asf/ambari/blob/08dd22f9/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_gc.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_gc.py b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_gc.py new file mode 100644 index 0000000..f8fe499 --- /dev/null +++ b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_gc.py @@ -0,0 +1,24 @@ +#!/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 accumulo_script import AccumuloScript + +if __name__ == "__main__": + AccumuloScript('gc').execute() http://git-wip-us.apache.org/repos/asf/ambari/blob/08dd22f9/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_master.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_master.py b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_master.py new file mode 100644 index 0000000..ea8935b --- /dev/null +++ b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_master.py @@ -0,0 +1,24 @@ +#!/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 accumulo_script import AccumuloScript + +if __name__ == "__main__": + AccumuloScript('master').execute() http://git-wip-us.apache.org/repos/asf/ambari/blob/08dd22f9/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_monitor.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_monitor.py b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_monitor.py new file mode 100644 index 0000000..c8e7bed --- /dev/null +++ b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_monitor.py @@ -0,0 +1,24 @@ +#!/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 accumulo_script import AccumuloScript + +if __name__ == "__main__": + AccumuloScript('monitor').execute() http://git-wip-us.apache.org/repos/asf/ambari/blob/08dd22f9/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_script.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_script.py b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_script.py new file mode 100644 index 0000000..8f78325 --- /dev/null +++ b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_script.py @@ -0,0 +1,117 @@ +#!/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.libraries.functions.security_commons import build_expectations, \ + cached_kinit_executor, get_params_from_filesystem, validate_security_config_properties, \ + FILE_TYPE_XML + +from accumulo_configuration import setup_conf_dir +from accumulo_service import accumulo_service + +class AccumuloScript(Script): + def __init__(self, component): + self.component = component + + def install(self, env): + self.install_packages(env) + + def configure(self, env): + import params + env.set_params(params) + + setup_conf_dir(name=self.component) + + def start(self, env): + import params + env.set_params(params) + self.configure(env) # for security + + accumulo_service( self.component, + action = 'start' + ) + + def stop(self, env): + import params + env.set_params(params) + + accumulo_service( self.component, + action = 'stop' + ) + + def status(self, env): + import status_params + env.set_params(status_params) + component = self.component + pid_file = format("{pid_dir}/accumulo-{accumulo_user}-{component}.pid") + check_process_status(pid_file) + + def security_status(self, env): + import status_params + + env.set_params(status_params) + + props_value_check = {} + props_empty_check = ['general.kerberos.keytab', + 'general.kerberos.principal'] + props_read_check = ['general.kerberos.keytab'] + accumulo_site_expectations = build_expectations('accumulo-site', + props_value_check, + props_empty_check, + props_read_check) + + accumulo_expectations = {} + accumulo_expectations.update(accumulo_site_expectations) + + security_params = get_params_from_filesystem(status_params.conf_dir, + {'accumulo-site.xml': FILE_TYPE_XML}) + result_issues = validate_security_config_properties(security_params, accumulo_expectations) + if not result_issues: # If all validations passed successfully + try: + # Double check the dict before calling execute + if ( 'accumulo-site' not in security_params + or 'general.kerberos.keytab' not in security_params['accumulo-site'] + or 'general.kerberos.principal' not in security_params['accumulo-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.accumulo_user, + security_params['accumulo-site']['general.kerberos.keytab'], + security_params['accumulo-site']['general.kerberos.principal'], + status_params.hostname, + status_params.tmp_dir, + 30) + 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"}) + + +if __name__ == "__main__": + self.fail_with_error('component unspecified') http://git-wip-us.apache.org/repos/asf/ambari/blob/08dd22f9/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_service.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_service.py b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_service.py new file mode 100644 index 0000000..13411e6 --- /dev/null +++ b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_service.py @@ -0,0 +1,71 @@ +#!/usr/bin/env python +""" +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +""" + +from resource_management import * +import time + +def accumulo_service( name, + action = 'start'): # 'start' or 'stop' or 'status' + import params + + role = name + pid_file = format("{pid_dir}/accumulo-{accumulo_user}-{role}.pid") + + pid_exists = format("ls {pid_file} >/dev/null 2>&1 && ps `cat {pid_file}` >/dev/null 2>&1") + + if action == 'start': + daemon_cmd = format("{daemon_script} {role} --address {params.hostname} > {log_dir}/accumulo-{role}.out 2>{log_dir}/accumulo-{role}.err & echo $! > {pid_file}") + Execute ( daemon_cmd, + not_if=pid_exists, + user=params.accumulo_user + ) + + elif action == 'stop': + no_pid_exists = format("! ({pid_exists})") + try: + if name == 'master': + Execute(format("{daemon_script} admin stopMaster"), + not_if=no_pid_exists, + timeout=30, + user=params.accumulo_user + ) + elif name == 'tserver': + Execute(format("{daemon_script} admin stop {hostname}"), + not_if=no_pid_exists, + timeout=30, + user=params.accumulo_user + ) + except: + pass + + time.sleep(5) + + pid = format("`cat {pid_file}` >/dev/null 2>&1") + Execute(format("kill {pid}"), + not_if=no_pid_exists, + user=params.accumulo_user + ) + Execute(format("kill -9 {pid}"), + not_if=format("sleep 2; {no_pid_exists} || sleep 20; {no_pid_exists}"), + ignore_failures=True, + user=params.accumulo_user + ) + Execute(format("rm -f {pid_file}"), + user=params.accumulo_user) http://git-wip-us.apache.org/repos/asf/ambari/blob/08dd22f9/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_tracer.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_tracer.py b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_tracer.py new file mode 100644 index 0000000..b8bb9a0 --- /dev/null +++ b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_tracer.py @@ -0,0 +1,24 @@ +#!/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 accumulo_script import AccumuloScript + +if __name__ == "__main__": + AccumuloScript('tracer').execute() http://git-wip-us.apache.org/repos/asf/ambari/blob/08dd22f9/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_tserver.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_tserver.py b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_tserver.py new file mode 100644 index 0000000..3117e35 --- /dev/null +++ b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_tserver.py @@ -0,0 +1,24 @@ +#!/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 accumulo_script import AccumuloScript + +if __name__ == "__main__": + AccumuloScript('tserver').execute() http://git-wip-us.apache.org/repos/asf/ambari/blob/08dd22f9/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/params.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/params.py b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/params.py new file mode 100644 index 0000000..96932ba --- /dev/null +++ b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/params.py @@ -0,0 +1,125 @@ +#!/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.libraries.functions.default import default +import status_params + +# server configurations +config = Script.get_config() +exec_tmp_dir = status_params.tmp_dir + +# accumulo local directory structure +log_dir = config['configurations']['accumulo-env']['accumulo_log_dir'] +conf_dir = status_params.conf_dir # "/etc/accumulo/conf" +server_conf_dir = "/etc/accumulo/conf/server" +client_script = "/usr/hdp/current/accumulo-client/bin/accumulo" +daemon_script = format("ACCUMULO_CONF_DIR={server_conf_dir} {client_script}") + +# service locations +hadoop_prefix = "/usr/hdp/current/hadoop-client" +hadoop_bin_dir = format("{hadoop_prefix}/bin") +hadoop_conf_dir = "/etc/hadoop/conf" +zookeeper_home = "/usr/hdp/current/zookeeper-client" + +# user and status +accumulo_user = status_params.accumulo_user +user_group = config['configurations']['cluster-env']['user_group'] +pid_dir = status_params.pid_dir + +# accumulo env +java64_home = config['hostLevelParams']['java_home'] +master_heapsize = config['configurations']['accumulo-env']['master_heapsize'] +tserver_heapsize = config['configurations']['accumulo-env']['tserver_heapsize'] +monitor_heapsize = config['configurations']['accumulo-env']['monitor_heapsize'] +gc_heapsize = config['configurations']['accumulo-env']['gc_heapsize'] +other_heapsize = config['configurations']['accumulo-env']['other_heapsize'] +env_sh_template = config['configurations']['accumulo-env']['content'] +server_env_sh_template = config['configurations']['accumulo-env']['server_content'] + +# accumulo initialization parameters +instance_name = config['configurations']['accumulo-env']['accumulo_instance_name'] +instance_secret = config['configurations']['accumulo-env']['instance_secret'] +root_password = config['configurations']['accumulo-env']['accumulo_root_password'] +instance_volumes = config['configurations']['accumulo-site']['instance.volumes'] +parent_dir = instance_volumes[0:instance_volumes.rfind('/')] + +# tracer properties +trace_user = config['configurations']['accumulo-site']['trace.user'] +trace_password = config['configurations']['accumulo-env']['trace_password'] + +# credential provider +credential_provider = parent_dir.replace("hdfs://", "jceks://hdfs@") + "/accumulo-site.jceks" + +# smoke test +smoke_test_user = config['configurations']['cluster-env']['smokeuser'] +smoke_test_password = 'smoke' +smokeuser_principal = config['configurations']['cluster-env']['smokeuser_principal_name'] +smoke_user_keytab = config['configurations']['cluster-env']['smokeuser_keytab'] + +# log4j.properties +log4j_props = config['configurations']['accumulo-log4j']['content'] +audit_log_level = config['configurations']['accumulo-log4j']['audit_log_level'] +monitor_forwarding_log_level = config['configurations']['accumulo-log4j']['monitor_forwarding_log_level'] +debug_log_size = config['configurations']['accumulo-log4j']['debug_log_size'] +debug_num_logs = config['configurations']['accumulo-log4j']['debug_num_logs'] +info_log_size = config['configurations']['accumulo-log4j']['info_log_size'] +info_num_logs = config['configurations']['accumulo-log4j']['info_num_logs'] + +# metrics2 properties +ganglia_server_hosts = default('/clusterHostInfo/ganglia_server_host', []) # is not passed when ganglia is not present +ganglia_server_host = '' if len(ganglia_server_hosts) == 0 else ganglia_server_hosts[0] +ams_collector_hosts = default("/clusterHostInfo/metric_collector_hosts", []) +has_metric_collector = not len(ams_collector_hosts) == 0 +if has_metric_collector: + metric_collector_host = ams_collector_hosts[0] + metric_collector_port = default("/configurations/ams-site/timeline.metrics.service.webapp.address", "0.0.0.0:8188") + if metric_collector_port and metric_collector_port.find(':') != -1: + metric_collector_port = metric_collector_port.split(':')[1] + pass + +# security properties +accumulo_user_keytab = config['configurations']['accumulo-env']['accumulo_user_keytab'] +accumulo_principal_name = config['configurations']['accumulo-env']['accumulo_principal_name'] + +security_enabled = status_params.security_enabled +kinit_path_local = status_params.kinit_path_local +if security_enabled: + kinit_cmd = format("{kinit_path_local} -kt {accumulo_user_keytab} {accumulo_principal_name};") +else: + kinit_cmd = "" + +#for create_hdfs_directory +hostname = status_params.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'] +import functools +#create partial functions with common arguments for every HdfsDirectory call +#to create hdfs directory we need to call params.HdfsDirectory in code +HdfsDirectory = functools.partial( + HdfsDirectory, + conf_dir=hadoop_conf_dir, + hdfs_user=hdfs_user, + security_enabled = security_enabled, + keytab = hdfs_user_keytab, + kinit_path_local = kinit_path_local, + bin_dir = hadoop_bin_dir +) http://git-wip-us.apache.org/repos/asf/ambari/blob/08dd22f9/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/service_check.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/service_check.py b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/service_check.py new file mode 100644 index 0000000..88ed196 --- /dev/null +++ b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/service_check.py @@ -0,0 +1,59 @@ +#!/usr/bin/env python +""" +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +""" + +from resource_management import * +import os + +class AccumuloServiceCheck(Script): + def service_check(self, env): + import params + env.set_params(params) + + smokeuser_kinit_cmd = format("{kinit_path_local} -kt {smoke_user_keytab} {smokeuser_principal};") if params.security_enabled else "" + + cmdfile = format("{exec_tmp_dir}/cmds") + try: + File(cmdfile, + mode=0600, + group=params.user_group, + owner=params.smoke_test_user, + content=InlineTemplate('createtable testtable\n' + 'insert row cf cq val\n' + 'scan\n' + 'flush -w\n' + 'scan\n' + 'deletetable -f testtable\n') + ) + Execute( format("{smokeuser_kinit_cmd} " + "{client_script} shell -u {smoke_test_user} " + "-p {smoke_test_password} -f {cmdfile}"), + timeout=30, + user=params.smoke_test_user) + finally: + try_remove(cmdfile) + +def try_remove(file): + try: + os.remove(file) + except: + pass + +if __name__ == "__main__": + AccumuloServiceCheck().execute() http://git-wip-us.apache.org/repos/asf/ambari/blob/08dd22f9/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/status_params.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/status_params.py b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/status_params.py new file mode 100644 index 0000000..2d7cd61 --- /dev/null +++ b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/status_params.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python +""" +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +""" + +from resource_management import * + +config = Script.get_config() + +conf_dir = "/etc/accumulo/conf" +pid_dir = config['configurations']['accumulo-env']['accumulo_pid_dir'] +accumulo_user = config['configurations']['accumulo-env']['accumulo_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()
