You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by jo...@apache.org on 2016/10/09 03:10:50 UTC

[2/3] ambari git commit: AMBARI-18551. Enhance falcon integration to call falcon-config to make sure WEB-INF/lib is present in all cases (Venkat Ranganathan via alejandro)

AMBARI-18551. Enhance falcon integration to call falcon-config to make sure WEB-INF/lib is present in all cases (Venkat Ranganathan via alejandro)


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

Branch: refs/heads/branch-feature-AMBARI-18456
Commit: 72f1f6f635b74e4fe3f5e21fed2d3a60aa6de0ad
Parents: 569020c
Author: Alejandro Fernandez <af...@hortonworks.com>
Authored: Fri Oct 7 16:29:43 2016 -0700
Committer: Alejandro Fernandez <af...@hortonworks.com>
Committed: Fri Oct 7 16:29:43 2016 -0700

----------------------------------------------------------------------
 .../FALCON/0.5.0.2.1/package/scripts/falcon.py        | 11 +++++++++++
 .../OOZIE/4.0.0.2.0/package/scripts/oozie_service.py  |  2 +-
 .../python/stacks/2.1/FALCON/test_falcon_server.py    | 14 ++++++++++++++
 3 files changed, 26 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/72f1f6f6/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon.py b/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon.py
index 2ac79cb..3ecb65b 100644
--- a/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon.py
+++ b/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/falcon.py
@@ -216,6 +216,17 @@ def falcon(type, action = None, upgrade_type=None):
     process_exists = format("ls {server_pid_file} && ps -p {pid}")
 
     if action == 'start':
+      try:
+        Execute(format('{falcon_home}/bin/falcon-config.sh server falcon'),
+          user = params.falcon_user,
+          path = params.hadoop_bin_dir,
+          environment=environment_dictionary,
+          not_if = process_exists,
+        )
+      except:
+        show_logs(params.falcon_log_dir, params.falcon_user)
+        raise
+
       if not os.path.exists(params.target_jar_file):
         try :
           File(params.target_jar_file,

http://git-wip-us.apache.org/repos/asf/ambari/blob/72f1f6f6/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_service.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_service.py b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_service.py
index 3257653..a5bd59d 100644
--- a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_service.py
+++ b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_service.py
@@ -28,7 +28,7 @@ from resource_management.core import sudo
 from resource_management.core.shell import as_user
 from resource_management.core.logger import Logger
 from resource_management.core.resources.service import Service
-from resource_management.core.resources.system import Execute, File
+from resource_management.core.resources.system import Execute, File, Directory
 from resource_management.libraries.functions.format import format
 from resource_management.libraries.functions.show_logs import show_logs
 from resource_management.libraries.providers.hdfs_resource import WebHDFSUtil

http://git-wip-us.apache.org/repos/asf/ambari/blob/72f1f6f6/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_server.py b/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_server.py
index ab053b7..4ad5c0f 100644
--- a/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_server.py
+++ b/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_server.py
@@ -43,6 +43,13 @@ class TestFalconServer(RMFTestCase):
 
     self.assert_configure_default()
 
+    self.assertResourceCalled('Execute', '/usr/lib/falcon/bin/falcon-config.sh server falcon',
+      path = ['/usr/bin'],
+      user = 'falcon',
+      environment = {'HADOOP_HOME': '/usr/lib/hadoop'},
+      not_if = 'ls /var/run/falcon/falcon.pid && ps -p ',
+    )
+
     self.assertResourceCalled('File', '/usr/lib/falcon/server/webapp/falcon/WEB-INF/lib/je-5.0.73.jar',
       content=DownloadSource('http://c6401.ambari.apache.org:8080/resources//je-5.0.73.jar'),
       mode=0755
@@ -374,6 +381,13 @@ class TestFalconServer(RMFTestCase):
         create_parents = True,
     )
    
+    self.assertResourceCalled('Execute', '/usr/hdp/current/falcon-server/bin/falcon-config.sh server falcon',
+        environment = {'HADOOP_HOME': '/usr/hdp/current/hadoop-client'},
+        path = ['/usr/hdp/current/hadoop-client/bin'],
+        user = 'falcon',
+        not_if = 'ls /var/run/falcon/falcon.pid && ps -p ',
+    )
+
     self.assertResourceCalled('Execute', '/usr/hdp/current/falcon-server/bin/falcon-start -port 15000',
         environment = {'HADOOP_HOME': '/usr/hdp/current/hadoop-client'},
         path = ['/usr/hdp/current/hadoop-client/bin'],