Browse Source

AMBARI-6936. Some information are absent in Download Client Configs files for HDFS/Hive - hadoop-env.sh file/hive-env.sh. (aonishuk)

Andrew Onishuk 10 years ago
parent
commit
bd60b32e9c
23 changed files with 1831 additions and 42 deletions
  1. 1 1
      ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/configuration/hive-env.xml
  2. 3 5
      ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/package/scripts/hive.py
  3. 4 0
      ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/package/scripts/params.py
  4. 1 1
      ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/configuration/hive-env.xml
  5. 4 6
      ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/hive.py
  6. 4 0
      ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/params.py
  7. 4 4
      ambari-server/src/test/python/stacks/1.3.2/HIVE/test_hive_client.py
  8. 2 2
      ambari-server/src/test/python/stacks/1.3.2/HIVE/test_hive_metastore.py
  9. 2 2
      ambari-server/src/test/python/stacks/1.3.2/HIVE/test_hive_server.py
  10. 2 2
      ambari-server/src/test/python/stacks/1.3.2/configs/default.json
  11. 362 0
      ambari-server/src/test/python/stacks/1.3.2/configs/default_client.json
  12. 1 1
      ambari-server/src/test/python/stacks/1.3.2/configs/secured.json
  13. 542 0
      ambari-server/src/test/python/stacks/1.3.2/configs/secured_client.json
  14. 4 4
      ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_client.py
  15. 2 2
      ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py
  16. 2 2
      ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py
  17. 2 2
      ambari-server/src/test/python/stacks/2.0.6/configs/default.json
  18. 419 0
      ambari-server/src/test/python/stacks/2.0.6/configs/default_client.json
  19. 2 2
      ambari-server/src/test/python/stacks/2.0.6/configs/secured.json
  20. 462 0
      ambari-server/src/test/python/stacks/2.0.6/configs/secured_client.json
  21. 2 2
      ambari-server/src/test/python/stacks/2.1/HIVE/test_hive_metastore.py
  22. 2 2
      ambari-server/src/test/python/stacks/2.1/configs/default.json
  23. 2 2
      ambari-server/src/test/python/stacks/2.1/configs/secured.json

+ 1 - 1
ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/configuration/hive-env.xml

@@ -124,7 +124,7 @@ export HADOOP_CLIENT_OPTS="-Xmx${HADOOP_HEAPSIZE}m $HADOOP_CLIENT_OPTS"
 HADOOP_HOME=${HADOOP_HOME:-{{hadoop_home}}}
 
 # Hive Configuration Directory can be controlled by:
-export HIVE_CONF_DIR={{conf_dir}}
+export HIVE_CONF_DIR={{hive_config_dir}}
 
 # Folder containing extra ibraries required for hive compilation/execution can be controlled by:
 if [ "${HIVE_AUX_JARS_PATH}" != "" ]; then

+ 3 - 5
ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/package/scripts/hive.py

@@ -40,21 +40,19 @@ def hive(name=None):
     )
     params.HdfsDirectory(None, action="create")
   if name == 'metastore' or name == 'hiveserver2':
-    hive_config_dir = params.hive_server_conf_dir
     config_file_mode = 0600
     jdbc_connector()
   else:
-    hive_config_dir = params.hive_conf_dir
     config_file_mode = 0644
 
-  Directory(hive_config_dir,
+  Directory(params.hive_config_dir,
             owner=params.hive_user,
             group=params.user_group,
             recursive=True
   )
 
   XmlConfig("hive-site.xml",
-            conf_dir=hive_config_dir,
+            conf_dir=params.hive_config_dir,
             configurations=params.config['configurations']['hive-site'],
             configuration_attributes=params.config['configuration_attributes']['hive-site'],
             owner=params.hive_user,
@@ -95,7 +93,7 @@ def hive(name=None):
   File(format("{hive_config_dir}/hive-env.sh"),
        owner=params.hive_user,
        group=params.user_group,
-       content=InlineTemplate(params.hive_env_sh_template, conf_dir=hive_config_dir)
+       content=InlineTemplate(params.hive_env_sh_template)
   )
 
   crt_file(format("{hive_conf_dir}/hive-default.xml.template"))

+ 4 - 0
ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/package/scripts/params.py

@@ -74,6 +74,10 @@ hive_dbroot = config['configurations']['hive-env']['hive_dbroot']
 hive_log_dir = config['configurations']['hive-env']['hive_log_dir']
 hive_pid_dir = status_params.hive_pid_dir
 hive_pid = status_params.hive_pid
+#Default conf dir for client
+hive_config_dir = hive_conf_dir
+if 'role' in config and config['role'] in ["HIVE_SERVER", "HIVE_METASTORE"]:
+  hive_config_dir = hive_server_conf_dir
 
 #hive-site
 hive_database_name = config['configurations']['hive-env']['hive_database_name']

+ 1 - 1
ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/configuration/hive-env.xml

@@ -114,7 +114,7 @@ export HADOOP_CLIENT_OPTS="-Xmx${HADOOP_HEAPSIZE}m $HADOOP_CLIENT_OPTS"
 HADOOP_HOME=${HADOOP_HOME:-{{hadoop_home}}}
 
 # Hive Configuration Directory can be controlled by:
-export HIVE_CONF_DIR={{conf_dir}}
+export HIVE_CONF_DIR={{hive_config_dir}}
 
 # Folder containing extra ibraries required for hive compilation/execution can be controlled by:
 if [ "${HIVE_AUX_JARS_PATH}" != "" ]; then

+ 4 - 6
ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/hive.py

@@ -40,21 +40,19 @@ def hive(name=None):
     )
     params.HdfsDirectory(None, action="create")
   if name == 'metastore' or name == 'hiveserver2':
-    hive_config_dir = params.hive_server_conf_dir
     config_file_mode = 0600
     jdbc_connector()
   else:
-    hive_config_dir = params.hive_conf_dir
     config_file_mode = 0644
 
-  Directory(hive_config_dir,
+  Directory(params.hive_config_dir,
             owner=params.hive_user,
             group=params.user_group,
             recursive=True
   )
 
   XmlConfig("mapred-site.xml",
-            conf_dir=hive_config_dir,
+            conf_dir=params.hive_config_dir,
             configurations=params.config['configurations']['mapred-site'],
             configuration_attributes=params.config['configuration_attributes']['mapred-site'],
             owner=params.hive_user,
@@ -62,7 +60,7 @@ def hive(name=None):
             mode=config_file_mode)
 
   XmlConfig("hive-site.xml",
-            conf_dir=hive_config_dir,
+            conf_dir=params.hive_config_dir,
             configurations=params.config['configurations']['hive-site'],
             configuration_attributes=params.config['configuration_attributes']['hive-site'],
             owner=params.hive_user,
@@ -85,7 +83,7 @@ def hive(name=None):
   File(format("{hive_config_dir}/hive-env.sh"),
        owner=params.hive_user,
        group=params.user_group,
-       content=InlineTemplate(params.hive_env_sh_template, conf_dir=hive_config_dir)
+       content=InlineTemplate(params.hive_env_sh_template)
   )
 
   if name == 'metastore':

+ 4 - 0
ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/params.py

@@ -79,6 +79,10 @@ hive_dbroot = config['configurations']['hive-env']['hive_dbroot']
 hive_log_dir = config['configurations']['hive-env']['hive_log_dir']
 hive_pid_dir = status_params.hive_pid_dir
 hive_pid = status_params.hive_pid
+#Default conf dir for client
+hive_config_dir = hive_conf_dir
+if 'role' in config and config['role'] in ["HIVE_SERVER", "HIVE_METASTORE"]:
+  hive_config_dir = hive_server_conf_dir
 
 #hive-site
 hive_database_name = config['configurations']['hive-env']['hive_database_name']

+ 4 - 4
ambari-server/src/test/python/stacks/1.3.2/HIVE/test_hive_client.py

@@ -26,7 +26,7 @@ class TestHiveClient(RMFTestCase):
     self.executeScript("1.3.2/services/HIVE/package/scripts/hive_client.py",
                        classname = "HiveClient",
                        command = "configure",
-                       config_file="default.json"
+                       config_file="default_client.json"
     )
     self.assertResourceCalled('Directory', '/etc/hive/conf',
       owner = 'hive',
@@ -46,7 +46,7 @@ class TestHiveClient(RMFTestCase):
       environment = {'no_proxy': 'c6401.ambari.apache.org'}
     )
     self.assertResourceCalled('File', '/etc/hive/conf/hive-env.sh',
-      content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content'], conf_dir="/etc/hive/conf"),
+      content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']),
       owner = 'hive',
       group = 'hadoop',
     )
@@ -80,7 +80,7 @@ class TestHiveClient(RMFTestCase):
     self.executeScript("1.3.2/services/HIVE/package/scripts/hive_client.py",
                        classname = "HiveClient",
                        command = "configure",
-                       config_file="secured.json"
+                       config_file="secured_client.json"
     )
     self.assertResourceCalled('Directory', '/etc/hive/conf',
       owner = 'hive',
@@ -100,7 +100,7 @@ class TestHiveClient(RMFTestCase):
       environment = {'no_proxy': 'c6401.ambari.apache.org'}
     )
     self.assertResourceCalled('File', '/etc/hive/conf/hive-env.sh',
-      content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content'], conf_dir="/etc/hive/conf"),
+      content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']),
       owner = 'hive',
       group = 'hadoop',
     )

+ 2 - 2
ambari-server/src/test/python/stacks/1.3.2/HIVE/test_hive_metastore.py

@@ -204,7 +204,7 @@ class TestHiveMetastore(RMFTestCase):
       recursive = True,
     )
     self.assertResourceCalled('File', '/etc/hive/conf.server/hive-env.sh',
-      content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content'], conf_dir="/etc/hive/conf.server"),
+      content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']),
       owner = 'hive',
       group = 'hadoop',
     )
@@ -263,7 +263,7 @@ class TestHiveMetastore(RMFTestCase):
       recursive = True,
     )
     self.assertResourceCalled('File', '/etc/hive/conf.server/hive-env.sh',
-      content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content'], conf_dir="/etc/hive/conf.server"),
+      content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']),
       owner = 'hive',
       group = 'hadoop',
     )

+ 2 - 2
ambari-server/src/test/python/stacks/1.3.2/HIVE/test_hive_server.py

@@ -250,7 +250,7 @@ class TestHiveServer(RMFTestCase):
       recursive = True,
     )
     self.assertResourceCalled('File', '/etc/hive/conf.server/hive-env.sh',
-      content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content'], conf_dir="/etc/hive/conf.server"),
+      content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']),
       owner = 'hive',
       group = 'hadoop',
     )
@@ -337,7 +337,7 @@ class TestHiveServer(RMFTestCase):
       recursive = True,
     )
     self.assertResourceCalled('File', '/etc/hive/conf.server/hive-env.sh',
-      content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content'], conf_dir="/etc/hive/conf.server"),
+      content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']),
       owner = 'hive',
       group = 'hadoop',
     )

+ 2 - 2
ambari-server/src/test/python/stacks/1.3.2/configs/default.json

@@ -21,8 +21,8 @@
     }, 
     "commandType": "EXECUTION_COMMAND", 
     "roleParams": {}, 
-    "serviceName": "HDFS", 
-    "role": "DATANODE", 
+    "serviceName": "HIVE",
+    "role": "HIVE_SERVER",
     "commandParams": {
         "command_timeout": "600", 
         "service_package_folder": "HDFS",

File diff suppressed because it is too large
+ 362 - 0
ambari-server/src/test/python/stacks/1.3.2/configs/default_client.json


+ 1 - 1
ambari-server/src/test/python/stacks/1.3.2/configs/secured.json

@@ -22,7 +22,7 @@
     "commandType": "EXECUTION_COMMAND", 
     "roleParams": {}, 
     "serviceName": "HIVE", 
-    "role": "MYSQL_SERVER", 
+    "role": "HIVE_SERVER",
     "commandParams": {
         "command_timeout": "600", 
         "service_package_folder": "HIVE",

File diff suppressed because it is too large
+ 542 - 0
ambari-server/src/test/python/stacks/1.3.2/configs/secured_client.json


+ 4 - 4
ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_client.py

@@ -26,7 +26,7 @@ class TestHiveClient(RMFTestCase):
     self.executeScript("2.0.6/services/HIVE/package/scripts/hive_client.py",
                        classname = "HiveClient",
                        command = "configure",
-                       config_file="default.json"
+                       config_file="default_client.json"
     )
 
     self.assertResourceCalled('Directory', '/etc/hive/conf',
@@ -55,7 +55,7 @@ class TestHiveClient(RMFTestCase):
       environment = {'no_proxy': 'c6401.ambari.apache.org'}
     )
     self.assertResourceCalled('File', '/etc/hive/conf/hive-env.sh',
-      content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content'], conf_dir="/etc/hive/conf"),
+      content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']),
       owner = 'hive',
       group = 'hadoop',
     )
@@ -89,7 +89,7 @@ class TestHiveClient(RMFTestCase):
     self.executeScript("2.0.6/services/HIVE/package/scripts/hive_client.py",
                        classname = "HiveClient",
                        command = "configure",
-                       config_file="secured.json"
+                       config_file="secured_client.json"
     )
 
     self.assertResourceCalled('Directory', '/etc/hive/conf',
@@ -118,7 +118,7 @@ class TestHiveClient(RMFTestCase):
       environment = {'no_proxy': 'c6401.ambari.apache.org'}
     )
     self.assertResourceCalled('File', '/etc/hive/conf/hive-env.sh',
-      content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content'], conf_dir="/etc/hive/conf"),
+      content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']),
       owner = 'hive',
       group = 'hadoop',
     )

+ 2 - 2
ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py

@@ -175,7 +175,7 @@ class TestHiveMetastore(RMFTestCase):
       environment = {'no_proxy': 'c6401.ambari.apache.org'}
     )
     self.assertResourceCalled('File', '/etc/hive/conf.server/hive-env.sh',
-      content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content'], conf_dir="/etc/hive/conf.server"),
+      content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']),
       owner = 'hive',
       group = 'hadoop',
     )
@@ -242,7 +242,7 @@ class TestHiveMetastore(RMFTestCase):
       environment = {'no_proxy': 'c6401.ambari.apache.org'}
     )
     self.assertResourceCalled('File', '/etc/hive/conf.server/hive-env.sh',
-      content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content'], conf_dir="/etc/hive/conf.server"),
+      content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']),
       owner = 'hive',
       group = 'hadoop',
     )

+ 2 - 2
ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py

@@ -288,7 +288,7 @@ class TestHiveServer(RMFTestCase):
       environment = {'no_proxy': 'c6401.ambari.apache.org'}
     )
     self.assertResourceCalled('File', '/etc/hive/conf.server/hive-env.sh',
-      content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content'], conf_dir="/etc/hive/conf.server"),
+      content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']),
       owner = 'hive',
       group = 'hadoop',
     )
@@ -384,7 +384,7 @@ class TestHiveServer(RMFTestCase):
       environment = {'no_proxy': 'c6401.ambari.apache.org'}
     )
     self.assertResourceCalled('File', '/etc/hive/conf.server/hive-env.sh',
-      content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content'], conf_dir="/etc/hive/conf.server"),
+      content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']),
       owner = 'hive',
       group = 'hadoop',
     )

+ 2 - 2
ambari-server/src/test/python/stacks/2.0.6/configs/default.json

@@ -18,8 +18,8 @@
     }, 
     "commandType": "EXECUTION_COMMAND", 
     "roleParams": {}, 
-    "serviceName": "OOZIE", 
-    "role": "OOZIE_SERVICE_CHECK", 
+    "serviceName": "HIVE",
+    "role": "HIVE_SERVER",
     "commandParams": {
         "command_timeout": "300", 
         "service_package_folder": "OOZIE",

File diff suppressed because it is too large
+ 419 - 0
ambari-server/src/test/python/stacks/2.0.6/configs/default_client.json


+ 2 - 2
ambari-server/src/test/python/stacks/2.0.6/configs/secured.json

@@ -21,8 +21,8 @@
     }, 
     "commandType": "EXECUTION_COMMAND", 
     "roleParams": {}, 
-    "serviceName": "YARN", 
-    "role": "YARN_CLIENT", 
+    "serviceName": "HIVE",
+    "role": "HIVE_SERVER",
     "commandParams": {
         "command_timeout": "600", 
         "service_package_folder": "YARN",

File diff suppressed because it is too large
+ 462 - 0
ambari-server/src/test/python/stacks/2.0.6/configs/secured_client.json


+ 2 - 2
ambari-server/src/test/python/stacks/2.1/HIVE/test_hive_metastore.py

@@ -135,7 +135,7 @@ class TestHiveMetastore(RMFTestCase):
       environment = {'no_proxy': 'c6401.ambari.apache.org'},
     )
     self.assertResourceCalled('File', '/etc/hive/conf.server/hive-env.sh',
-      content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content'], conf_dir="/etc/hive/conf.server"),
+      content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']),
       owner = 'hive',
       group = 'hadoop',
     )
@@ -205,7 +205,7 @@ class TestHiveMetastore(RMFTestCase):
       environment = {'no_proxy': 'c6401.ambari.apache.org'},
     )
     self.assertResourceCalled('File', '/etc/hive/conf.server/hive-env.sh',
-      content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content'], conf_dir="/etc/hive/conf.server"),
+      content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']),
       owner = 'hive',
       group = 'hadoop',
     )

+ 2 - 2
ambari-server/src/test/python/stacks/2.1/configs/default.json

@@ -17,8 +17,8 @@
     }, 
     "commandType": "EXECUTION_COMMAND", 
     "roleParams": {}, 
-    "serviceName": "OOZIE", 
-    "role": "OOZIE_SERVICE_CHECK", 
+    "serviceName": "HIVE",
+    "role": "HIVE_SERVER",
     "commandParams": {
         "command_timeout": "300", 
         "service_package_folder": "OOZIE",

+ 2 - 2
ambari-server/src/test/python/stacks/2.1/configs/secured.json

@@ -22,8 +22,8 @@
     }, 
     "commandType": "EXECUTION_COMMAND", 
     "roleParams": {}, 
-    "serviceName": "YARN", 
-    "role": "YARN_CLIENT", 
+    "serviceName": "HIVE",
+    "role": "HIVE_SERVER",
     "commandParams": {
         "command_timeout": "600", 
         "service_package_folder": "YARN",

Some files were not shown because too many files changed in this diff