Selaa lähdekoodia

AMBARI-5734 Ambari installation should run the hive schema script for Oracle and Postgres as Metastore DB (dsen)

Dmitry Sen 11 vuotta sitten
vanhempi
commit
27539cd09c

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

@@ -114,8 +114,7 @@ mysql_host = config['clusterHostInfo']['hive_mysql_host']
 mysql_adduser_path = "/tmp/addMysqlUser.sh"
 
 ######## Metastore Schema
-if str(hdp_stack_version).startswith('2.1') and \
-    config['configurations']['global']['hive_database'] == 'New MySQL Database':
+if str(hdp_stack_version).startswith('2.1'):
   init_metastore_schema = True
 else:
   init_metastore_schema = False

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

@@ -139,8 +139,8 @@ class TestHiveMetastore(RMFTestCase):
       content = StaticFile('startMetastore.sh'),
       mode = 0755,
     )
-    self.assertResourceCalled('Execute', "export HIVE_CONF_DIR=/etc/hive/conf.server ; /usr/lib/hive/bin/schematool -initSchema -dbType mysql -userName hive -passWord asd",
-      not_if = 'export HIVE_CONF_DIR=/etc/hive/conf.server ; /usr/lib/hive/bin/schematool -info -dbType mysql -userName hive -passWord asd',
+    self.assertResourceCalled('Execute', "export HIVE_CONF_DIR=/etc/hive/conf.server ; /usr/lib/hive/bin/schematool -initSchema -dbType postgres -userName hive -passWord asd",
+      not_if = 'export HIVE_CONF_DIR=/etc/hive/conf.server ; /usr/lib/hive/bin/schematool -info -dbType postgres -userName hive -passWord asd',
     )
     self.assertResourceCalled('Directory', '/var/run/hive',
       owner = 'hive',
@@ -207,8 +207,8 @@ class TestHiveMetastore(RMFTestCase):
       content = StaticFile('startMetastore.sh'),
       mode = 0755,
     )
-    self.assertResourceCalled('Execute', "export HIVE_CONF_DIR=/etc/hive/conf.server ; /usr/lib/hive/bin/schematool -initSchema -dbType mysql -userName hive -passWord asd",
-      not_if = 'export HIVE_CONF_DIR=/etc/hive/conf.server ; /usr/lib/hive/bin/schematool -info -dbType mysql -userName hive -passWord asd',
+    self.assertResourceCalled('Execute', "export HIVE_CONF_DIR=/etc/hive/conf.server ; /usr/lib/hive/bin/schematool -initSchema -dbType postgres -userName hive -passWord asd",
+      not_if = 'export HIVE_CONF_DIR=/etc/hive/conf.server ; /usr/lib/hive/bin/schematool -info -dbType postgres -userName hive -passWord asd',
     )
     self.assertResourceCalled('Directory', '/var/run/hive',
       owner = 'hive',

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

@@ -296,7 +296,7 @@
             "oozie_jdbc_driver": "org.apache.derby.jdbc.EmbeddedDriver",
             "yarn_pid_dir_prefix": "/var/run/hadoop-yarn",
             "initLimit": "10",
-            "hive_database_type": "mysql",
+            "hive_database_type": "postgres",
             "oozie_database": "New Derby Database",
             "zk_pid_dir": "/var/run/zookeeper",
             "user_group": "hadoop",

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

@@ -337,7 +337,7 @@
             "namenode_opt_newsize": "200m", 
             "yarn_pid_dir_prefix": "/var/run/hadoop-yarn", 
             "initLimit": "10", 
-            "hive_database_type": "mysql", 
+            "hive_database_type": "postgres",
             "zk_pid_dir": "/var/run/zookeeper", 
             "jobhistory_http_primary_name": "HTTP", 
             "namenode_primary_name": "nn", 

+ 1 - 1
ambari-web/app/controllers/wizard/step8_controller.js

@@ -272,7 +272,7 @@ App.WizardStep8Controller = Em.Controller.extend({
       else {
         if (hiveDb.value === Em.I18n.t('services.service.config.hive.oozie.postgresql')) {
           globals.findProperty('name', 'hive_hostname').value = globals.findProperty('name', 'hive_existing_postgresql_host').value;
-          hiveDbType.value = 'postgresql';
+          hiveDbType.value = 'postgres';
           hive_properties = Em.A(['hive_ambari_host', 'hive_ambari_database', 'hive_existing_oracle_host',
             'hive_existing_oracle_database', 'hive_existing_mysql_host', 'hive_existing_mysql_database']);
         }