You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ma...@apache.org on 2014/04/06 23:05:24 UTC

git commit: AMBARI-4205. Add Existing Postgres Database option for Hive and Oozie Database during Ambari cluster install. (Michael Harp via mahadev)

Repository: ambari
Updated Branches:
  refs/heads/trunk ea40f027f -> 929a0ddf9


AMBARI-4205. Add Existing Postgres Database option for Hive and Oozie Database during Ambari cluster install. (Michael Harp via mahadev)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/929a0ddf
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/929a0ddf
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/929a0ddf

Branch: refs/heads/trunk
Commit: 929a0ddf95ffe070258162e624a41a4ca13b4850
Parents: ea40f02
Author: Mahadev Konar <ma...@apache.org>
Authored: Sun Apr 6 14:05:09 2014 -0700
Committer: Mahadev Konar <ma...@apache.org>
Committed: Sun Apr 6 14:05:09 2014 -0700

----------------------------------------------------------------------
 .../1.3.2/services/HIVE/package/scripts/hive.py |  8 +++
 .../HIVE/package/scripts/hive_service.py        |  4 +-
 .../services/HIVE/package/scripts/params.py     |  2 +
 .../services/OOZIE/package/scripts/oozie.py     |  4 +-
 .../OOZIE/package/scripts/oozie_service.py      |  4 +-
 .../services/OOZIE/package/scripts/params.py    |  2 +
 .../2.0.6/services/HIVE/package/scripts/hive.py |  7 ++
 .../HIVE/package/scripts/hive_service.py        |  4 +-
 .../services/HIVE/package/scripts/params.py     |  2 +
 .../services/OOZIE/package/scripts/oozie.py     |  4 +-
 .../OOZIE/package/scripts/oozie_service.py      |  4 +-
 .../services/OOZIE/package/scripts/params.py    |  2 +
 .../controllers/main/service/info/configs.js    | 40 ++++++++++-
 .../app/controllers/wizard/step8_controller.js  | 48 +++++++++++--
 ambari-web/app/data/HDP2/global_properties.js   | 71 +++++++++++++++++++
 ambari-web/app/data/global_properties.js        | 72 ++++++++++++++++++++
 ambari-web/app/views/wizard/controls_view.js    | 14 ++++
 17 files changed, 278 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/929a0ddf/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/package/scripts/hive.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/package/scripts/hive.py b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/package/scripts/hive.py
index 30aec45..5f2f15e 100644
--- a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/package/scripts/hive.py
+++ b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/package/scripts/hive.py
@@ -156,6 +156,14 @@ def jdbc_connector():
             creates=params.target,
             path=["/bin", "/usr/bin/"])
 
+  elif params.hive_jdbc_driver == "org.postgresql.Driver":
+    cmd = format("hive mkdir -p {artifact_dir} ; cp /usr/share/java/{jdbc_jar_name} {target}")
+
+    Execute(cmd,
+            not_if=format("test -f {target}"),
+            creates=params.target,
+            path=["/bin", "usr/bin/"])
+
   elif params.hive_jdbc_driver == "oracle.jdbc.driver.OracleDriver":
     cmd = format(
       "mkdir -p {artifact_dir} ; curl -kf --retry 10 {driver_curl_source} -o {driver_curl_target} &&  "

http://git-wip-us.apache.org/repos/asf/ambari/blob/929a0ddf/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/package/scripts/hive_service.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/package/scripts/hive_service.py b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/package/scripts/hive_service.py
index e81f04e..90ed051 100644
--- a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/package/scripts/hive_service.py
+++ b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/package/scripts/hive_service.py
@@ -44,7 +44,9 @@ def hive_service(
             not_if=no_op_test
     )
 
-    if params.hive_jdbc_driver == "com.mysql.jdbc.Driver" or params.hive_jdbc_driver == "oracle.jdbc.driver.OracleDriver":
+    if params.hive_jdbc_driver == "com.mysql.jdbc.Driver" or \
+       params.hive_jdbc_driver == "org.postgresql.Driver" or \
+       params.hive_jdbc_driver == "oracle.jdbc.driver.OracleDriver":
       db_connection_check_command = format(
         "{java64_home}/bin/java -cp {check_db_connection_jar}:/usr/share/java/{jdbc_jar_name} org.apache.ambari.server.DBConnectionVerification {hive_jdbc_connection_url} {hive_metastore_user_name} {hive_metastore_user_passwd!p} {hive_jdbc_driver}")
       Execute(db_connection_check_command,

http://git-wip-us.apache.org/repos/asf/ambari/blob/929a0ddf/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/package/scripts/params.py b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/package/scripts/params.py
index e2751a9..bf52dba 100644
--- a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/package/scripts/params.py
+++ b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/package/scripts/params.py
@@ -37,6 +37,8 @@ hive_lib = '/usr/lib/hive/lib/'
 hive_jdbc_driver = config['configurations']['hive-site']['javax.jdo.option.ConnectionDriverName']
 if hive_jdbc_driver == "com.mysql.jdbc.Driver":
   jdbc_jar_name = "mysql-connector-java.jar"
+elif hive_jdbc_driver == "org.postgresql.Driver":
+  jdbc_jar_name = "postgresql-jdbc.jar"
 elif hive_jdbc_driver == "oracle.jdbc.driver.OracleDriver":
   jdbc_jar_name = "ojdbc6.jar"
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/929a0ddf/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/OOZIE/package/scripts/oozie.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/OOZIE/package/scripts/oozie.py b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/OOZIE/package/scripts/oozie.py
index 8be2cae..6523fbd 100644
--- a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/OOZIE/package/scripts/oozie.py
+++ b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/OOZIE/package/scripts/oozie.py
@@ -62,7 +62,9 @@ def oozie(is_server=False
          owner=params.oozie_user
     )
 
-  if params.jdbc_driver_name == "com.mysql.jdbc.Driver" or params.jdbc_driver_name == "oracle.jdbc.driver.OracleDriver":
+  if params.jdbc_driver_name == "com.mysql.jdbc.Driver" or \
+     params.jdbc_driver_name == "org.postgresql.Driver" or \
+     params.jdbc_driver_name == "oracle.jdbc.driver.OracleDriver":
     Execute(format("/bin/sh -c 'cd /usr/lib/ambari-agent/ &&\
     curl -kf --retry 5 {jdk_location}{check_db_connection_jar_name}\
      -o {check_db_connection_jar_name}'"),

http://git-wip-us.apache.org/repos/asf/ambari/blob/929a0ddf/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/OOZIE/package/scripts/oozie_service.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/OOZIE/package/scripts/oozie_service.py b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/OOZIE/package/scripts/oozie_service.py
index 9db9491..a31999d 100644
--- a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/OOZIE/package/scripts/oozie_service.py
+++ b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/OOZIE/package/scripts/oozie_service.py
@@ -29,7 +29,9 @@ def oozie_service(action = 'start'): # 'start' or 'stop'
   if action == 'start':
     start_cmd = format("cd {oozie_tmp_dir} && /usr/lib/oozie/bin/oozie-start.sh")
     
-    if params.jdbc_driver_name == "com.mysql.jdbc.Driver" or params.jdbc_driver_name == "oracle.jdbc.driver.OracleDriver":
+    if params.jdbc_driver_name == "com.mysql.jdbc.Driver" or \
+       params.jdbc_driver_name == "org.postgresql.Driver" or \
+       params.jdbc_driver_name == "oracle.jdbc.driver.OracleDriver":
       db_connection_check_command = format("{java_home}/bin/java -cp {check_db_connection_jar}:{jdbc_driver_jar} org.apache.ambari.server.DBConnectionVerification {oozie_jdbc_connection_url} {oozie_metastore_user_name} {oozie_metastore_user_passwd!p} {jdbc_driver_name}")
     else:
       db_connection_check_command = None

http://git-wip-us.apache.org/repos/asf/ambari/blob/929a0ddf/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/OOZIE/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/OOZIE/package/scripts/params.py b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/OOZIE/package/scripts/params.py
index 6f4e80d..f5c217a 100644
--- a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/OOZIE/package/scripts/params.py
+++ b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/OOZIE/package/scripts/params.py
@@ -67,6 +67,8 @@ jdbc_driver_name = default("/configurations/oozie-site/oozie.service.JPAService.
 
 if jdbc_driver_name == "com.mysql.jdbc.Driver":
   jdbc_driver_jar = "/usr/share/java/mysql-connector-java.jar"
+elif jdbc_driver_name == "org.postgresql.Driver":
+  jdbc_driver_jar = "/usr/lib/oozie/libserver/postgresql-9.0-801.jdbc4.jar"
 elif jdbc_driver_name == "oracle.jdbc.driver.OracleDriver":
   jdbc_driver_jar = "/usr/share/java/ojdbc6.jar"
 else:

http://git-wip-us.apache.org/repos/asf/ambari/blob/929a0ddf/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/hive.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/hive.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/hive.py
index 0990530..f7cb89c 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/hive.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/hive.py
@@ -160,6 +160,13 @@ def jdbc_connector():
             not_if=format("test -f {target}"),
             creates=params.target,
             path=["/bin", "/usr/bin/"])
+  elif params.hive_jdbc_driver == "org.postgresql.Driver":
+    cmd = format("hive mkdir -p {artifact_dir} ; cp /usr/share/java/{jdbc_jar_name} {target}")
+
+    Execute(cmd,
+            not_if=format("test -f {target}"),
+            creates=params.target,
+            path=["/bin", "usr/bin/"])
 
   elif params.hive_jdbc_driver == "oracle.jdbc.driver.OracleDriver":
     cmd = format(

http://git-wip-us.apache.org/repos/asf/ambari/blob/929a0ddf/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/hive_service.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/hive_service.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/hive_service.py
index e81f04e..90ed051 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/hive_service.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/hive_service.py
@@ -44,7 +44,9 @@ def hive_service(
             not_if=no_op_test
     )
 
-    if params.hive_jdbc_driver == "com.mysql.jdbc.Driver" or params.hive_jdbc_driver == "oracle.jdbc.driver.OracleDriver":
+    if params.hive_jdbc_driver == "com.mysql.jdbc.Driver" or \
+       params.hive_jdbc_driver == "org.postgresql.Driver" or \
+       params.hive_jdbc_driver == "oracle.jdbc.driver.OracleDriver":
       db_connection_check_command = format(
         "{java64_home}/bin/java -cp {check_db_connection_jar}:/usr/share/java/{jdbc_jar_name} org.apache.ambari.server.DBConnectionVerification {hive_jdbc_connection_url} {hive_metastore_user_name} {hive_metastore_user_passwd!p} {hive_jdbc_driver}")
       Execute(db_connection_check_command,

http://git-wip-us.apache.org/repos/asf/ambari/blob/929a0ddf/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/params.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/params.py
index 520343b..194321a 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/params.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/params.py
@@ -38,6 +38,8 @@ hive_lib = '/usr/lib/hive/lib/'
 hive_jdbc_driver = config['configurations']['hive-site']['javax.jdo.option.ConnectionDriverName']
 if hive_jdbc_driver == "com.mysql.jdbc.Driver":
   jdbc_jar_name = "mysql-connector-java.jar"
+elif hive_jdbc_driver == "org.postgresql.Driver":
+  jdbc_jar_name = "postgresql-jdbc.jar"
 elif hive_jdbc_driver == "oracle.jdbc.driver.OracleDriver":
   jdbc_jar_name = "ojdbc6.jar"
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/929a0ddf/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/scripts/oozie.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/scripts/oozie.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/scripts/oozie.py
index 7ea7712..818874d 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/scripts/oozie.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/scripts/oozie.py
@@ -64,7 +64,9 @@ def oozie(is_server=False # TODO: see if see can remove this
       owner=params.oozie_user
     )
 
-  if params.jdbc_driver_name == "com.mysql.jdbc.Driver" or params.jdbc_driver_name == "oracle.jdbc.driver.OracleDriver":
+  if params.jdbc_driver_name == "com.mysql.jdbc.Driver" or \
+     params.jdbc_driver_name == "org.postgresql.Driver" or \
+     params.jdbc_driver_name == "oracle.jdbc.driver.OracleDriver":
     Execute(format("/bin/sh -c 'cd /usr/lib/ambari-agent/ &&\
     curl -kf --retry 5 {jdk_location}{check_db_connection_jar_name}\
      -o {check_db_connection_jar_name}'"),

http://git-wip-us.apache.org/repos/asf/ambari/blob/929a0ddf/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/scripts/oozie_service.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/scripts/oozie_service.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/scripts/oozie_service.py
index 9db9491..a31999d 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/scripts/oozie_service.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/scripts/oozie_service.py
@@ -29,7 +29,9 @@ def oozie_service(action = 'start'): # 'start' or 'stop'
   if action == 'start':
     start_cmd = format("cd {oozie_tmp_dir} && /usr/lib/oozie/bin/oozie-start.sh")
     
-    if params.jdbc_driver_name == "com.mysql.jdbc.Driver" or params.jdbc_driver_name == "oracle.jdbc.driver.OracleDriver":
+    if params.jdbc_driver_name == "com.mysql.jdbc.Driver" or \
+       params.jdbc_driver_name == "org.postgresql.Driver" or \
+       params.jdbc_driver_name == "oracle.jdbc.driver.OracleDriver":
       db_connection_check_command = format("{java_home}/bin/java -cp {check_db_connection_jar}:{jdbc_driver_jar} org.apache.ambari.server.DBConnectionVerification {oozie_jdbc_connection_url} {oozie_metastore_user_name} {oozie_metastore_user_passwd!p} {jdbc_driver_name}")
     else:
       db_connection_check_command = None

http://git-wip-us.apache.org/repos/asf/ambari/blob/929a0ddf/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/scripts/params.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/scripts/params.py
index 235d1a9..9a5df00 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/scripts/params.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/scripts/params.py
@@ -67,6 +67,8 @@ jdbc_driver_name = default("/configurations/oozie-site/oozie.service.JPAService.
 
 if jdbc_driver_name == "com.mysql.jdbc.Driver":
   jdbc_driver_jar = "/usr/share/java/mysql-connector-java.jar"
+elif jdbc_driver_name == "org.postgresql.Driver":
+  jdbc_driver_jar = "/usr/lib/oozie/libserver/postgresql-9.0-801.jdbc4.jar"
 elif jdbc_driver_name == "oracle.jdbc.driver.OracleDriver":
   jdbc_driver_jar = "/usr/share/java/ojdbc6.jar"
 else:

http://git-wip-us.apache.org/repos/asf/ambari/blob/929a0ddf/ambari-web/app/controllers/main/service/info/configs.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/info/configs.js b/ambari-web/app/controllers/main/service/info/configs.js
index f3cf1a0..c183b83 100644
--- a/ambari-web/app/controllers/main/service/info/configs.js
+++ b/ambari-web/app/controllers/main/service/info/configs.js
@@ -1041,6 +1041,8 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
         globals = globals.without(globals.findProperty('name', 'hive_existing_mysql_database'));
         globals = globals.without(globals.findProperty('name', 'hive_existing_oracle_host'));
         globals = globals.without(globals.findProperty('name', 'hive_existing_oracle_database'));
+        globals = globals.without(globals.findProperty('name', 'hive_existing_postgresql_host'));
+        globals = globals.without(globals.findProperty('name', 'hive_existing_postgresql_database'));
       } else if (hiveDb.value === 'Existing MySQL Database') {
         var existingMySqlHost = globals.findProperty('name', 'hive_existing_mysql_host');
         if (existingMySqlHost) {
@@ -1050,7 +1052,21 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
         globals = globals.without(globals.findProperty('name', 'hive_ambari_database'));
         globals = globals.without(globals.findProperty('name', 'hive_existing_oracle_host'));
         globals = globals.without(globals.findProperty('name', 'hive_existing_oracle_database'));
-      } else { //existing oracle database
+        globals = globals.without(globals.findProperty('name', 'hive_existing_postgresql_host'));
+        globals = globals.without(globals.findProperty('name', 'hive_existing_postgresql_database'));
+      } else if (hiveDb.value === 'Existing Postgresql Database') {
+        var existingPostgreSqlHost = globals.findProperty('name', 'hive_existing_postgresql_host');
+        if (existingPostgreSqlHost) {
+          existingPostgreSqlHost.name = 'hive_hostname';
+        }
+        globals = globals.without(globals.findProperty('name', 'hive_ambari_host'));
+        globals = globals.without(globals.findProperty('name', 'hive_ambari_database'));
+        globals = globals.without(globals.findProperty('name', 'hive_existing_mysql_host'));
+        globals = globals.without(globals.findProperty('name', 'hive_existing_mysql_database'));
+        globals = globals.without(globals.findProperty('name', 'hive_existing_oracle_host'));
+        globals = globals.without(globals.findProperty('name', 'hive_existing_oracle_database'));
+      }
+      else { //existing oracle database
         var existingOracleHost = globals.findProperty('name', 'hive_existing_oracle_host');
         if (existingOracleHost) {
           existingOracleHost.name = 'hive_hostname';
@@ -1059,6 +1075,8 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
         globals = globals.without(globals.findProperty('name', 'hive_ambari_database'));
         globals = globals.without(globals.findProperty('name', 'hive_existing_mysql_host'));
         globals = globals.without(globals.findProperty('name', 'hive_existing_mysql_database'));
+        globals = globals.without(globals.findProperty('name', 'hive_existing_postgresql_host'));
+        globals = globals.without(globals.findProperty('name', 'hive_existing_postgresql_database'));
       }
 
     }
@@ -1078,6 +1096,8 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
         globals = globals.without(globals.findProperty('name', 'oozie_existing_mysql_database'));
         globals = globals.without(globals.findProperty('name', 'oozie_existing_oracle_host'));
         globals = globals.without(globals.findProperty('name', 'oozie_existing_oracle_database'));
+        globals = globals.without(globals.findProperty('name', 'oozie_existing_postgresql_host'));
+        globals = globals.without(globals.findProperty('name', 'oozie_existing_postgresql_database'));
       } else if (oozieDb.value === 'New MySQL Database') {
         var ambariHost = globals.findProperty('name', 'oozie_ambari_host');
         if (ambariHost) {
@@ -1088,6 +1108,8 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
         globals = globals.without(globals.findProperty('name', 'oozie_existing_oracle_host'));
         globals = globals.without(globals.findProperty('name', 'oozie_existing_oracle_database'));
         globals = globals.without(globals.findProperty('name', 'oozie_derby_database'));
+        globals = globals.without(globals.findProperty('name', 'oozie_existing_postgresql_host'));
+        globals = globals.without(globals.findProperty('name', 'oozie_existing_postgresql_database'));
 
       } else if (oozieDb.value === 'Existing MySQL Database') {
         var existingMySqlHost = globals.findProperty('name', 'oozie_existing_mysql_host');
@@ -1099,7 +1121,21 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
         globals = globals.without(globals.findProperty('name', 'oozie_existing_oracle_host'));
         globals = globals.without(globals.findProperty('name', 'oozie_existing_oracle_database'));
         globals = globals.without(globals.findProperty('name', 'oozie_derby_database'));
-      } else { //existing oracle database
+        globals = globals.without(globals.findProperty('name', 'oozie_existing_postgresql_host'));
+        globals = globals.without(globals.findProperty('name', 'oozie_existing_postgresql_database'));
+      } else if (oozieDb.value === 'Existing Postgresql Database') {
+        var existingPostgreSqlHost = globals.findProperty('name', 'oozie_existing_postgresql_host');
+        if (existingPostgreSqlHost) {
+          existingPostgreSqlHost.name = 'oozie_hostname';
+        }
+        globals = globals.without(globals.findProperty('name', 'oozie_ambari_host'));
+        globals = globals.without(globals.findProperty('name', 'oozie_ambari_database'));
+        globals = globals.without(globals.findProperty('name', 'oozie_existing_mysql_host'));
+        globals = globals.without(globals.findProperty('name', 'oozie_existing_mysql_database'));
+        globals = globals.without(globals.findProperty('name', 'oozie_existing_oracle_host'));
+        globals = globals.without(globals.findProperty('name', 'oozie_existing_oracle_database'));
+      }
+      else { //existing oracle database
         var existingOracleHost = globals.findProperty('name', 'oozie_existing_oracle_host');
         if (existingOracleHost) {
           existingOracleHost.name = 'oozie_hostname';

http://git-wip-us.apache.org/repos/asf/ambari/blob/929a0ddf/ambari-web/app/controllers/wizard/step8_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step8_controller.js b/ambari-web/app/controllers/wizard/step8_controller.js
index 609037a..2509d54 100644
--- a/ambari-web/app/controllers/wizard/step8_controller.js
+++ b/ambari-web/app/controllers/wizard/step8_controller.js
@@ -217,6 +217,8 @@ App.WizardStep8Controller = Em.Controller.extend({
         globals = globals.without(globals.findProperty('name', 'hive_existing_mysql_database'));
         globals = globals.without(globals.findProperty('name', 'hive_existing_oracle_host'));
         globals = globals.without(globals.findProperty('name', 'hive_existing_oracle_database'));
+        globals = globals.without(globals.findProperty('name', 'hive_existing_postgresql_host'));
+        globals = globals.without(globals.findProperty('name', 'hive_existing_postgresql_database'));
       } else if (hiveDb.value === 'Existing MySQL Database'){
         globals.findProperty('name', 'hive_hostname').value = globals.findProperty('name', 'hive_existing_mysql_host').value;
         hiveDbType.value = 'mysql';
@@ -224,13 +226,26 @@ App.WizardStep8Controller = Em.Controller.extend({
         globals = globals.without(globals.findProperty('name', 'hive_ambari_database'));
         globals = globals.without(globals.findProperty('name', 'hive_existing_oracle_host'));
         globals = globals.without(globals.findProperty('name', 'hive_existing_oracle_database'));
-      } else { //existing oracle database
+        globals = globals.without(globals.findProperty('name', 'hive_existing_postgresql_host'));
+        globals = globals.without(globals.findProperty('name', 'hive_existing_postgresql_database'));
+      }  else if (hiveDb.value === 'Existing Postgresql Database'){
+          globals.findProperty('name', 'hive_hostname').value = globals.findProperty('name', 'hive_existing_postgresql_host').value;
+          hiveDbType.value = 'postgresql';
+          globals = globals.without(globals.findProperty('name', 'hive_ambari_host'));
+          globals = globals.without(globals.findProperty('name', 'hive_ambari_database'));
+          globals = globals.without(globals.findProperty('name', 'hive_existing_oracle_host'));
+          globals = globals.without(globals.findProperty('name', 'hive_existing_oracle_database'));
+          globals = globals.without(globals.findProperty('name', 'hive_existing_mysql_host'));
+          globals = globals.without(globals.findProperty('name', 'hive_existing_mysql_database'));
+        } else { //existing oracle database
         globals.findProperty('name', 'hive_hostname').value = globals.findProperty('name', 'hive_existing_oracle_host').value;
         hiveDbType.value = 'oracle';
         globals = globals.without(globals.findProperty('name', 'hive_ambari_host'));
         globals = globals.without(globals.findProperty('name', 'hive_ambari_database'));
         globals = globals.without(globals.findProperty('name', 'hive_existing_mysql_host'));
         globals = globals.without(globals.findProperty('name', 'hive_existing_mysql_database'));
+        globals = globals.without(globals.findProperty('name', 'hive_existing_postgresql_host'));
+        globals = globals.without(globals.findProperty('name', 'hive_existing_postgresql_database'));
       }
       globals.push(hiveDbType);
     }
@@ -248,7 +263,9 @@ App.WizardStep8Controller = Em.Controller.extend({
         globals = globals.without(globals.findProperty('name', 'oozie_existing_mysql_database'));
         globals = globals.without(globals.findProperty('name', 'oozie_existing_oracle_host'));
         globals = globals.without(globals.findProperty('name', 'oozie_existing_oracle_database'));
-      } else if (oozieDb.value === 'Existing MySQL Database') {
+        globals = globals.without(globals.findProperty('name', 'oozie_existing_postgresql_host'));
+        globals = globals.without(globals.findProperty('name', 'oozie_existing_postgresql_database'));
+      }  else if (oozieDb.value === 'Existing MySQL Database') {
         globals.findProperty('name', 'oozie_hostname').value = globals.findProperty('name', 'oozie_existing_mysql_host').value;
         oozieDbType.value = 'mysql';
         globals = globals.without(globals.findProperty('name', 'oozie_ambari_host'));
@@ -256,7 +273,18 @@ App.WizardStep8Controller = Em.Controller.extend({
         globals = globals.without(globals.findProperty('name', 'oozie_existing_oracle_host'));
         globals = globals.without(globals.findProperty('name', 'oozie_existing_oracle_database'));
         globals = globals.without(globals.findProperty('name', 'oozie_derby_database'));
-      } else { // existing oracle database
+        globals = globals.without(globals.findProperty('name', 'oozie_existing_postgresql_host'));
+        globals = globals.without(globals.findProperty('name', 'oozie_existing_postgresql_database'));
+      } else if (oozieDb.value === 'Existing Postgresql Database'){
+          globals.findProperty('name', 'oozie_hostname').value = globals.findProperty('name', 'oozie_existing_postgresql_host').value;
+          oozieDbType.value = 'postgresql';
+          globals = globals.without(globals.findProperty('name', 'oozie_ambari_host'));
+          globals = globals.without(globals.findProperty('name', 'oozie_ambari_database'));
+          globals = globals.without(globals.findProperty('name', 'oozie_existing_oracle_host'));
+          globals = globals.without(globals.findProperty('name', 'oozie_existing_oracle_database'));
+          globals = globals.without(globals.findProperty('name', 'oozie_existing_mysql_host'));
+          globals = globals.without(globals.findProperty('name', 'oozie_existing_mysql_database'));
+        } else { // existing oracle database
         globals.findProperty('name', 'oozie_hostname').value = globals.findProperty('name', 'oozie_existing_oracle_host').value;
         oozieDbType.value = 'oracle';
         globals = globals.without(globals.findProperty('name', 'oozie_ambari_host'));
@@ -264,6 +292,8 @@ App.WizardStep8Controller = Em.Controller.extend({
         globals = globals.without(globals.findProperty('name', 'oozie_existing_mysql_host'));
         globals = globals.without(globals.findProperty('name', 'oozie_existing_mysql_database'));
         globals = globals.without(globals.findProperty('name', 'oozie_derby_database'));
+        globals = globals.without(globals.findProperty('name', 'oozie_existing_postgresql_host'));
+        globals = globals.without(globals.findProperty('name', 'oozie_existing_postgresql_database'));
       }
       globals.push(oozieDbType);
     }
@@ -598,7 +628,10 @@ App.WizardStep8Controller = Em.Controller.extend({
     } else if(hiveDb.value === 'Existing MySQL Database'){
       var db = this.get('wizardController').getDBProperty('serviceConfigProperties').findProperty('name', 'hive_existing_mysql_database');
       dbComponent.set('component_value', db.value + ' (' + hiveDb.value + ')');
-    } else { // existing oracle database
+    } else if(hiveDb.value === 'Existing Postgresql Database'){
+      var db = this.get('wizardController').getDBProperty('serviceConfigProperties').findProperty('name', 'hive_existing_postgresql_database');
+      dbComponent.set('component_value', db.value + ' (' + hiveDb.value + ')');
+     } else { // existing oracle database
       var db = this.get('wizardController').getDBProperty('serviceConfigProperties').findProperty('name', 'hive_existing_oracle_database');
       dbComponent.set('component_value', db.value + ' (' + hiveDb.value + ')');
     }
@@ -646,7 +679,10 @@ App.WizardStep8Controller = Em.Controller.extend({
     } */else if(oozieDb.value === 'Existing MySQL Database'){
       var db = this.get('wizardController').getDBProperty('serviceConfigProperties').findProperty('name', 'oozie_existing_mysql_database');
       dbComponent.set('component_value', db.value + ' (' + oozieDb.value + ')');
-    } else { // existing oracle database
+    } else if(oozieDb.value === 'Existing Postgresql Database'){
+      var db = this.get('wizardController').getDBProperty('serviceConfigProperties').findProperty('name', 'oozie_existing_postgresql_database');
+      dbComponent.set('component_value', db.value + ' (' + oozieDb.value + ')');
+    }  else { // existing oracle database
       var db = this.get('wizardController').getDBProperty('serviceConfigProperties').findProperty('name', 'oozie_existing_oracle_database');
       dbComponent.set('component_value', db.value + ' (' + oozieDb.value + ')');
     }
@@ -1491,4 +1527,4 @@ App.WizardStep8Controller = Em.Controller.extend({
     this.get('ajaxQueue').pushObject(params);
   }
 
-});
\ No newline at end of file
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/929a0ddf/ambari-web/app/data/HDP2/global_properties.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/data/HDP2/global_properties.js b/ambari-web/app/data/HDP2/global_properties.js
index b016c90..a3eedaa 100644
--- a/ambari-web/app/data/HDP2/global_properties.js
+++ b/ambari-web/app/data/HDP2/global_properties.js
@@ -584,6 +584,22 @@ module.exports =
       "category": "Hive Metastore",
       "index": 1
     },
+    // for existing Postgresql
+    {
+      "id": "puppet var",
+      "name": "hive_existing_postgresql_database",
+      "displayName": "Database Type",
+      "value": "",
+      "defaultValue": "Postgresql",
+      "description": "Using an existing Postgresql database for Hive Metastore",
+      "displayType": "masterHost",
+      "isOverridable": false,
+      "isVisible": false,
+      "isReconfigurable": false,
+      "serviceName": "HIVE",
+      "category": "Hive Metastore",
+      "index": 1
+    },
     // for existing Oracle
     {
       "id": "puppet var",
@@ -631,6 +647,10 @@ module.exports =
           foreignKeys: ['hive_existing_mysql_database', 'hive_existing_mysql_host']
         },
         {
+            displayName: 'Existing Postgresql Database',
+            foreignKeys: ['hive_existing_postgresql_database', 'hive_existing_postgresql_host']
+        },
+        {
           displayName: 'Existing Oracle Database',
           foreignKeys: ['hive_existing_oracle_database', 'hive_existing_oracle_host'],
           hidden: !App.supports.hiveOozieExtraDatabases
@@ -679,6 +699,22 @@ module.exports =
     },
     {
       "id": "puppet var",
+      "name": "hive_existing_postgresql_host",
+      "displayName": "Database Host",
+      "description": "Specify the host on which the existing database is hosted",
+      "defaultValue": "",
+      "isReconfigurable": false,
+      "displayType": "host",
+      "isOverridable": false,
+      "isRequiredByAgent": false,
+      "isVisible": false,
+      "isObserved": true,
+      "serviceName": "HIVE",
+      "category": "Hive Metastore",
+      "index": 3
+    },
+    {
+      "id": "puppet var",
       "name": "hive_existing_oracle_host",
       "displayName": "Database Host",
       "description": "Specify the host on which the existing database is hosted",
@@ -860,6 +896,22 @@ module.exports =
       "category": "Oozie Server",
       "index": 1
     },
+    // for existing Postgresql
+    {
+      "id": "puppet var",
+      "name": "oozie_existing_postgresql_database",
+      "displayName": "Database Type",
+      "value": "",
+      "defaultValue": "Postgresql",
+      "description": "Using an existing Postgresql database for Oozie Metastore",
+      "displayType": "masterHost",
+      "isOverridable": false,
+      "isVisible": false,
+      "isReconfigurable": false,
+      "serviceName": "OOZIE",
+      "category": "Oozie Server",
+      "index": 1
+    },
     // for new MySQL
     {
       "id": "puppet var",
@@ -928,6 +980,11 @@ module.exports =
           foreignKeys: ['oozie_existing_mysql_database', 'oozie_existing_mysql_host'],
           hidden: !App.supports.hiveOozieExtraDatabases
         },
+                {
+          displayName: 'Existing Postgresql Database',
+          foreignKeys: ['oozie_existing_postgresql_database', 'oozie_existing_postgresql_host'],
+          hidden: !App.supports.hiveOozieExtraDatabases
+        },
         {
           displayName: 'Existing Oracle Database',
           foreignKeys: ['oozie_existing_oracle_database', 'oozie_existing_oracle_host'],
@@ -988,6 +1045,20 @@ module.exports =
       "serviceName": "OOZIE",
       "category": "Oozie Server"
     },
+        {
+      "id": "puppet var",
+      "name": "oozie_existing_postgresql_host",
+      "displayName": "Database Host",
+      "description": "Specify the host on which the existing database is hosted",
+      "defaultValue": "",
+      "isReconfigurable": false,
+      "isOverridable": false,
+      "displayType": "host",
+      "isVisible": false,
+      "isObserved": true,
+      "serviceName": "OOZIE",
+      "category": "Oozie Server"
+    },
     {
       "id": "puppet var",
       "name": "oozie_existing_oracle_host",

http://git-wip-us.apache.org/repos/asf/ambari/blob/929a0ddf/ambari-web/app/data/global_properties.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/data/global_properties.js b/ambari-web/app/data/global_properties.js
index 5772b50..85d2c3d 100644
--- a/ambari-web/app/data/global_properties.js
+++ b/ambari-web/app/data/global_properties.js
@@ -554,6 +554,22 @@ module.exports =
       "category": "Hive Metastore",
       "index": 1
     },
+    // for existing Postgresql
+    {
+      "id": "puppet var",
+      "name": "hive_existing_postgresql_database",
+      "displayName": "Database Type",
+      "value": "",
+      "defaultValue": "Postgresql",
+      "description": "Using an existing Postgresql database for Hive Metastore",
+      "displayType": "masterHost",
+      "isOverridable": false,
+      "isVisible": false,
+      "isReconfigurable": false,
+      "serviceName": "HIVE",
+      "category": "Hive Metastore",
+      "index": 1
+    },
     // for existing Oracle
     {
       "id": "puppet var",
@@ -601,6 +617,10 @@ module.exports =
           foreignKeys: ['hive_existing_mysql_database', 'hive_existing_mysql_host']
         },
         {
+          displayName: 'Existing Postgresql Database',
+          foreignKeys: ['hive_existing_postgresql_database', 'hive_existing_postgresql_host'],
+          },
+        {
           displayName: 'Existing Oracle Database',
           foreignKeys: ['hive_existing_oracle_database', 'hive_existing_oracle_host'],
           hidden: !App.supports.hiveOozieExtraDatabases
@@ -664,6 +684,22 @@ module.exports =
       "index": 3
     },
     {
+        "id": "puppet var",
+        "name": "hive_existing_postgresql_host",
+        "displayName": "Database Host",
+        "description": "Specify the host on which the existing database is hosted",
+        "defaultValue": "",
+        "isReconfigurable": false,
+        "displayType": "host",
+        "isOverridable": false,
+        "isRequiredByAgent": false,
+        "isVisible": false,
+        "isObserved": true,
+        "serviceName": "HIVE",
+        "category": "Hive Metastore",
+        "index": 3
+      },
+    {
       "id": "puppet var",
       "name": "hive_ambari_host",
       "value": "",
@@ -799,6 +835,22 @@ module.exports =
       "category": "Oozie Server",
       "index": 0
     },
+    // for existing Postgresql
+    {
+      "id": "puppet var",
+      "name": "oozie_existing_postgresql_database",
+      "displayName": "Database Type",
+      "value": "",
+      "defaultValue": "Postgresql",
+      "description": "Using an existing Postgresql database for Oozie Metastore",
+      "displayType": "masterHost",
+      "isOverridable": false,
+      "isVisible": false,
+      "isReconfigurable": false,
+      "serviceName": "OOZIE",
+      "category": "Oozie Server",
+      "index": 1
+    },
     // for existing Oracle
     {
       "id": "puppet var",
@@ -864,6 +916,10 @@ module.exports =
           foreignKeys: ['oozie_existing_mysql_database', 'oozie_existing_mysql_host'],
           hidden: !App.supports.hiveOozieExtraDatabases
         },
+                {
+          displayName: 'Existing Postgresql Database',
+          foreignKeys: ['oozie_existing_postgresql_database', 'oozie_existing_postgresql_host'],
+          },
         {
           displayName: 'Existing Oracle Database',
           foreignKeys: ['oozie_existing_oracle_database', 'oozie_existing_oracle_host'],
@@ -912,6 +968,22 @@ module.exports =
     },
     {
       "id": "puppet var",
+      "name": "oozie_existing_postgres_host",
+      "displayName": "Database Host",
+      "description": "Specify the host on which the existing database is hosted",
+      "defaultValue": "",
+      "isReconfigurable": false,
+      "isOverridable": false,
+      "displayType": "host",
+      "isRequiredByAgent": false,
+      "isVisible": false,
+      "isObserved": true,
+      "serviceName": "OOZIE",
+      "category": "Oozie Server",
+      "index": 3
+    },
+    {
+      "id": "puppet var",
       "name": "oozie_existing_oracle_host",
       "displayName": "Database Host",
       "description": "Specify the host on which the existing database is hosted",

http://git-wip-us.apache.org/repos/asf/ambari/blob/929a0ddf/ambari-web/app/views/wizard/controls_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/wizard/controls_view.js b/ambari-web/app/views/wizard/controls_view.js
index 9e14adb..c8d7e2d 100644
--- a/ambari-web/app/views/wizard/controls_view.js
+++ b/ambari-web/app/views/wizard/controls_view.js
@@ -222,6 +222,10 @@ App.ServiceConfigRadioButtons = Ember.View.extend({
               connectionUrl.set('value', "jdbc:mysql://" + this.get('hostName') + "/" + this.get('databaseName') + "?createDatabaseIfNotExist=true");
               dbClass.set('value', "com.mysql.jdbc.Driver");
               break;
+            case 'Existing Postgresql Database':
+              connectionUrl.set('value', "jdbc:postgresql://" + this.get('hostName') + ":5432/" + this.get('databaseName'));
+              dbClass.set('value', "org.postgresql.Driver");
+              break;
             case 'Existing Oracle Database':
               connectionUrl.set('value', "jdbc:oracle:thin:@//" + this.get('hostName') + ":1521/" + this.get('databaseName'));
               dbClass.set('value', "oracle.jdbc.driver.OracleDriver");
@@ -237,6 +241,10 @@ App.ServiceConfigRadioButtons = Ember.View.extend({
               connectionUrl.set('value', "jdbc:mysql://" + this.get('hostName') + "/" + this.get('databaseName'));
               dbClass.set('value', "com.mysql.jdbc.Driver");
               break;
+            case 'Existing Postgresql Database':
+              connectionUrl.set('value', "jdbc:postgresql://" + this.get('hostName') + ":5432/" + this.get('databaseName'));
+              dbClass.set('value', "org.postgresql.Driver");
+              break;
             case 'Existing Oracle Database':
               connectionUrl.set('value', "jdbc:oracle:thin:@//" + this.get('hostName') + ":1521/" + this.get('databaseName'));
               dbClass.set('value', "oracle.jdbc.driver.OracleDriver");
@@ -274,6 +282,9 @@ App.ServiceConfigRadioButtons = Ember.View.extend({
         case 'Existing MySQL Database':
           hostname = this.get('categoryConfigsAll').findProperty('name', 'hive_existing_mysql_host');
           break;
+        case 'Existing Postgresql Database':
+          hostname = this.get('categoryConfigsAll').findProperty('name', 'hive_existing_postgresql_host');
+          break;
         case 'Existing Oracle Database':
           hostname = this.get('categoryConfigsAll').findProperty('name', 'hive_existing_oracle_host');
           break;
@@ -292,6 +303,9 @@ App.ServiceConfigRadioButtons = Ember.View.extend({
         case 'Existing MySQL Database':
           hostname = this.get('categoryConfigsAll').findProperty('name', 'oozie_existing_mysql_host');
           break;
+        case 'Existing Postgresql Database':
+          hostname = this.get('categoryConfigsAll').findProperty('name', 'oozie_existing_postgresql_host');
+          break;
         case 'Existing Oracle Database':
           hostname = this.get('categoryConfigsAll').findProperty('name', 'oozie_existing_oracle_host');
           break;