ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vbrodets...@apache.org
Subject git commit: AMBARI-6664. Oozie service can not be started on Ambari server with external Postgres.(vbrodetskyi)
Date Wed, 30 Jul 2014 11:08:50 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk e46a90405 -> 8f3c9984b


AMBARI-6664. Oozie service can not be started on Ambari server with external Postgres.(vbrodetskyi)


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

Branch: refs/heads/trunk
Commit: 8f3c9984bf70e15b7ab06ee8614fe7f68d5fc8df
Parents: e46a904
Author: Vitaly Brodetskyi <vbrodetskyi@hortonworks.com>
Authored: Wed Jul 30 12:43:49 2014 +0300
Committer: Vitaly Brodetskyi <vbrodetskyi@hortonworks.com>
Committed: Wed Jul 30 12:44:03 2014 +0300

----------------------------------------------------------------------
 .../HDP/1.3.2/services/OOZIE/package/scripts/params.py  |  2 +-
 .../services/OOZIE/package/scripts/oozie_service.py     | 12 ++++++++++--
 .../test/python/stacks/2.0.6/OOZIE/test_oozie_server.py |  9 ++++++---
 3 files changed, 17 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/8f3c9984/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 299d937..3c261b6 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
@@ -73,7 +73,7 @@ oozie_env_sh_template = config['configurations']['oozie-env']['content']
 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"
+  jdbc_driver_jar = "/usr/lib/oozie/libtools/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/8f3c9984/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 2be172b..05bf7c3 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
@@ -17,7 +17,7 @@ See the License for the specific language governing permissions and
 limitations under the License.
 
 """
-
+import os
 from resource_management import *
 
 def oozie_service(action = 'start'): # 'start' or 'stop'
@@ -38,7 +38,15 @@ def oozie_service(action = 'start'): # 'start' or 'stop'
       
     cmd1 =  format("cd {oozie_tmp_dir} && /usr/lib/oozie/bin/ooziedb.sh create -sqlfile
oozie.sql -run")
     cmd2 =  format("{kinit_if_needed} hadoop dfs -put /usr/lib/oozie/share {oozie_hdfs_user_dir}
; hadoop dfs -chmod -R 755 {oozie_hdfs_user_dir}/share")
-      
+
+    if not os.path.isfile(params.jdbc_driver_jar):
+      print "ERROR: jdbc file " + params.jdbc_driver_jar + " is unavailable. Please, follow
next steps:\n" \
+        "1) Download postgresql-9.0-801.jdbc4.jar.\n2) Create needed directory: mkdir -p
/usr/lib/oozie/libserver/\n" \
+        "3) Copy postgresql-9.0-801.jdbc4.jar to newly created dir: cp /path/to/jdbc/postgresql-9.0-801.jdbc4.jar
" \
+        "/usr/lib/oozie/libserver/\n4) Copy postgresql-9.0-801.jdbc4.jar to libext: cp "
\
+        "/path/to/jdbc/postgresql-9.0-801.jdbc4.jar /usr/lib/oozie/libext/\n"
+      exit(1)
+
     if db_connection_check_command:
       Execute( db_connection_check_command, tries=5, try_sleep=10)
                   

http://git-wip-us.apache.org/repos/asf/ambari/blob/8f3c9984/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py b/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py
index c8aca2e..23a643e 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py
@@ -31,7 +31,9 @@ class TestOozieServer(RMFTestCase):
     self.assertNoMoreResources()
 
 
-  def test_start_default(self):
+  @patch("os.path.isfile")
+  def test_start_default(self, isfile_mock):
+    isfile_mock.return_value = True
     self.executeScript("2.0.6/services/OOZIE/package/scripts/oozie_server.py",
                          classname = "OozieServer",
                          command = "start",
@@ -75,8 +77,9 @@ class TestOozieServer(RMFTestCase):
     self.assert_configure_secured()
     self.assertNoMoreResources()
 
-
-  def test_start_secured(self):
+  @patch("os.path.isfile")
+  def test_start_secured(self, isfile_mock):
+    isfile_mock.return_value = True
     self.executeScript("2.0.6/services/OOZIE/package/scripts/oozie_server.py",
                          classname = "OozieServer",
                          command = "start",


Mime
View raw message