Repository: ambari Updated Branches: refs/heads/branch-2.4 63bb78bc7 -> 3b2ce6c3b
AMBARI-18612. Backport AMBARI-18551 to 2.4 branch (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/3b2ce6c3 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/3b2ce6c3 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/3b2ce6c3 Branch: refs/heads/branch-2.4 Commit: 3b2ce6c3bbd5b12480f5b592b216cb15fa9860e7 Parents: 63bb78b Author: Alejandro Fernandez <[email protected]> Authored: Mon Oct 17 17:48:25 2016 -0700 Committer: Alejandro Fernandez <[email protected]> Committed: Mon Oct 17 17:48:25 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/3b2ce6c3/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/3b2ce6c3/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'],
