Repository: ambari Updated Branches: refs/heads/branch-2.5 b5f74e059 -> 9ef6a6316
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/9ef6a631 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9ef6a631 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9ef6a631 Branch: refs/heads/branch-2.5 Commit: 9ef6a63168f0c398785eadccbbe6baa2ec859939 Parents: b5f74e0 Author: Alejandro Fernandez <[email protected]> Authored: Fri Oct 7 16:31:42 2016 -0700 Committer: Alejandro Fernandez <[email protected]> Committed: Fri Oct 7 16:31:42 2016 -0700 ---------------------------------------------------------------------- .../FALCON/0.5.0.2.1/package/scripts/falcon.py | 11 +++++++++++ .../python/stacks/2.1/FALCON/test_falcon_server.py | 14 ++++++++++++++ 2 files changed, 25 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/9ef6a631/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 6a3ad48..4429253 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 @@ -213,6 +213,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/9ef6a631/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'],
