Repository: ambari Updated Branches: refs/heads/trunk afbbf51ec -> 4f919d2c1
AMBARI-8861. ZooKeeper Service Check fails on trunk when deploying end to end with latest (ncole) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/4f919d2c Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/4f919d2c Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/4f919d2c Branch: refs/heads/trunk Commit: 4f919d2c17a1ceccaa1136c3d2b444d384853b7c Parents: afbbf51 Author: Nate Cole <[email protected]> Authored: Mon Dec 22 11:50:28 2014 -0500 Committer: Nate Cole <[email protected]> Committed: Mon Dec 22 12:16:59 2014 -0500 ---------------------------------------------------------------------- .../ambari_agent/CustomServiceOrchestrator.py | 2 +- .../3.4.5.2.0/package/scripts/params.py | 5 +- .../ZOOKEEPER/test_zookeeper_service_check.py | 20 ++++ .../2.0.6/configs/zk-service_check_2.2.json | 97 ++++++++++++++++++++ 4 files changed, 120 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/4f919d2c/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py ---------------------------------------------------------------------- diff --git a/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py b/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py index 61997f2..d0601a4 100644 --- a/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py +++ b/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py @@ -196,7 +196,7 @@ class CustomServiceOrchestrator(): except Exception, e: # We do not want to let agent fail completely exc_type, exc_obj, exc_tb = sys.exc_info() - message = "Catched an exception while executing "\ + message = "Caught an exception while executing "\ "custom service command: {0}: {1}; {2}".format(exc_type, exc_obj, str(e)) logger.exception(message) ret = { http://git-wip-us.apache.org/repos/asf/ambari/blob/4f919d2c/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/params.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/params.py b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/params.py index 929d5d8..8ceb26a 100644 --- a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/params.py +++ b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/params.py @@ -36,12 +36,11 @@ version = default("/commandParams/version", None) #hadoop params if hdp_stack_version != "" and compare_versions(hdp_stack_version, '2.2') >= 0: - role_root = "" + role_root = "zookeeper-client" command_role = default("/role", "") + if command_role == "ZOOKEEPER_SERVER": role_root = "zookeeper-server" - elif command_role == "ZOOKEEPER_CLIENT": - role_root = "zookeeper-client" zk_home = format("/usr/hdp/current/{role_root}") zk_bin = format("/usr/hdp/current/{role_root}/bin") http://git-wip-us.apache.org/repos/asf/ambari/blob/4f919d2c/ambari-server/src/test/python/stacks/2.0.6/ZOOKEEPER/test_zookeeper_service_check.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.0.6/ZOOKEEPER/test_zookeeper_service_check.py b/ambari-server/src/test/python/stacks/2.0.6/ZOOKEEPER/test_zookeeper_service_check.py index ade731f..0c71e6f 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/ZOOKEEPER/test_zookeeper_service_check.py +++ b/ambari-server/src/test/python/stacks/2.0.6/ZOOKEEPER/test_zookeeper_service_check.py @@ -63,3 +63,23 @@ class TestServiceCheck(RMFTestCase): try_sleep = 5, ) self.assertNoMoreResources() + + def test_service_check_22(self): + self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/service_check.py", + classname = "ZookeeperServiceCheck", + command = "service_check", + config_file = "zk-service_check_2.2.json", + hdp_stack_version = self.STACK_VERSION, + target = RMFTestCase.TARGET_COMMON_SERVICES + ) + self.assertResourceCalled('File', '/tmp/zkSmoke.sh', + content = StaticFile('zkSmoke.sh'), + mode = 0755, + ) + self.assertResourceCalled('Execute', '/tmp/zkSmoke.sh /usr/hdp/current/zookeeper-client/bin/zkCli.sh ambari-qa /etc/zookeeper/conf 2181 False /usr/bin/kinit no_keytab', + logoutput = True, + path = ['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'], + tries = 3, + try_sleep = 5, + ) + self.assertNoMoreResources() http://git-wip-us.apache.org/repos/asf/ambari/blob/4f919d2c/ambari-server/src/test/python/stacks/2.0.6/configs/zk-service_check_2.2.json ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.0.6/configs/zk-service_check_2.2.json b/ambari-server/src/test/python/stacks/2.0.6/configs/zk-service_check_2.2.json new file mode 100644 index 0000000..595a57a --- /dev/null +++ b/ambari-server/src/test/python/stacks/2.0.6/configs/zk-service_check_2.2.json @@ -0,0 +1,97 @@ +{ + "commandParams": { + "command_timeout": "300", + "script": "scripts/service_check.py", + "script_type": "PYTHON", + "service_package_folder": "common-services/ZOOKEEPER/3.4.5.2.0/package", + "hooks_folder": "HDP/2.0.6/hooks" + }, + "roleCommand": "SERVICE_CHECK", + "kerberosCommandParams": [], + "clusterName": "c1", + "hostname": "c6403.ambari.apache.org", + "hostLevelParams": { + "jdk_location": "http://192.168.64.1:8080/resources/", + "ambari_db_rca_password": "mapred", + "java_home": "/usr/jdk64/jdk1.7.0_45", + "ambari_db_rca_url": "jdbc:postgresql://192.168.64.1/ambarirca", + "jce_name": "UnlimitedJCEPolicyJDK7.zip", + "oracle_jdbc_url": "http://192.168.64.1:8080/resources//ojdbc6.jar", + "stack_version": "2.2", + "stack_name": "HDP", + "db_name": "ambari", + "ambari_db_rca_driver": "org.postgresql.Driver", + "jdk_name": "jdk-7u45-linux-x64.tar.gz", + "ambari_db_rca_username": "mapred", + "db_driver_filename": "mysql-connector-java.jar", + "agentCacheDir": "/var/lib/ambari-agent/cache", + "mysql_jdbc_url": "http://192.168.64.1:8080/resources//mysql-connector-java.jar" + }, + "commandType": "EXECUTION_COMMAND", + "roleParams": {}, + "serviceName": "ZOOKEEPER", + "role": "ZOOKEEPER_QUORUM_SERVICE_CHECK", + "forceRefreshConfigTags": [], + "taskId": 215, + "public_hostname": "c6403.ambari.apache.org", + "configurations": { + "zoo.cfg": { + "clientPort": "2181", + "autopurge.purgeInterval": "24", + "syncLimit": "5", + "dataDir": "/hadoop/zookeeper", + "initLimit": "10", + "tickTime": "2000", + "autopurge.snapRetainCount": "30" + }, + "zookeeper-env": { + "content": "\nexport JAVA_HOME={{java64_home}}\nexport ZOOKEEPER_HOME={{zk_home}}\nexport ZOO_LOG_DIR={{zk_log_dir}}\nexport ZOOPIDFILE={{zk_pid_file}}\nexport SERVER_JVMFLAGS={{zk_server_heapsize}}\nexport JAVA=$JAVA_HOME/bin/java\nexport CLASSPATH=$CLASSPATH:/usr/share/zookeeper/*\n\n{% if security_enabled %}\nexport SERVER_JVMFLAGS=\"$SERVER_JVMFLAGS -Djava.security.auth.login.config={{zk_server_jaas_file}}\"\nexport CLIENT_JVMFLAGS=\"$CLIENT_JVMFLAGS -Djava.security.auth.login.config={{zk_client_jaas_file}}\"\n{% endif %}", + "zk_log_dir": "/var/log/zookeeper", + "zk_pid_dir": "/var/run/zookeeper", + "zk_user": "zookeeper" + }, + "cluster-env": { + "security_enabled": "false", + "sink_existing_mssql_server_2_database": "MSSQL", + "pig_tar_source": "/usr/hdp/current/pig-client/pig.tar.gz", + "hadoop-streaming_tar_source": "/usr/hdp/current/hadoop-mapreduce-client/hadoop-streaming.jar", + "sink_existing_mssql_server_database": "MSSQL", + "sqoop_tar_destination_folder": "hdfs:///hdp/apps/{{ hdp_stack_version }}/sqoop/", + "hadoop-streaming_tar_destination_folder": "hdfs:///hdp/apps/{{ hdp_stack_version }}/mapreduce/", + "sink.dbservername": "", + "ignore_groupsusers_create": "false", + "kerberos_domain": "EXAMPLE.COM", + "sink.dblogin": "", + "hive_tar_destination_folder": "hdfs:///hdp/apps/{{ hdp_stack_version }}/hive/", + "tez_tar_source": "/usr/hdp/current/tez-client/lib/tez.tar.gz", + "mapreduce_tar_source": "/usr/hdp/current/hadoop-client/mapreduce.tar.gz", + "hadoop.user.name": "hadoop", + "hive_tar_source": "/usr/hdp/current/hive-client/hive.tar.gz", + "sink.db.schema.name": "", + "sink.jdbc.url": "", + "tez_tar_destination_folder": "hdfs:///hdp/apps/{{ hdp_stack_version }}/tez/", + "user_group": "hadoop", + "sqoop_tar_source": "/usr/hdp/current/sqoop-client/sqoop.tar.gz", + "hadoop.user.password": "", + "sink.jdbc.driver": "", + "smokeuser": "ambari-qa", + "mapreduce_tar_destination_folder": "hdfs:///hdp/apps/{{ hdp_stack_version }}/mapreduce/", + "pig_tar_destination_folder": "hdfs:///hdp/apps/{{ hdp_stack_version }}/pig/", + "sink.dbpassword": "", + "sink_database": "Existing MSSQL Server database with sql auth" + } + }, + "commandId": "25-1", + "clusterHostInfo": { + "all_hosts": [ + "c6403.ambari.apache.org", + "c6401.ambari.apache.org", + "c6402.ambari.apache.org" + ], + "zookeeper_hosts": [ + "c6403.ambari.apache.org", + "c6401.ambari.apache.org", + "c6402.ambari.apache.org" + ] + } +}
