You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ao...@apache.org on 2015/06/15 11:56:39 UTC

[2/2] ambari git commit: AMBARI-10417. Flume fails to start after reboot on centos7 / ubuntu12 (aonishuk)

AMBARI-10417. Flume fails to start after reboot on centos7 / ubuntu12 (aonishuk)


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

Branch: refs/heads/branch-2.1
Commit: 4d27a3dbffb279bbbbb42bd35a2c71f05100c648
Parents: f8674e8
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Mon Jun 15 12:56:24 2015 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Mon Jun 15 12:56:24 2015 +0300

----------------------------------------------------------------------
 .../FLUME/1.4.0.2.0/configuration/flume-env.xml                | 5 +++++
 .../common-services/FLUME/1.4.0.2.0/package/scripts/flume.py   | 6 +++++-
 .../common-services/FLUME/1.4.0.2.0/package/scripts/params.py  | 2 +-
 ambari-server/src/test/python/stacks/2.0.6/FLUME/test_flume.py | 5 ++++-
 .../src/test/python/stacks/2.0.6/configs/default.json          | 3 ++-
 .../src/test/python/stacks/2.0.6/configs/flume_22.json         | 3 ++-
 .../src/test/python/stacks/2.0.6/configs/flume_target.json     | 3 ++-
 7 files changed, 21 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/4d27a3db/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/configuration/flume-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/configuration/flume-env.xml b/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/configuration/flume-env.xml
index 008e6f4..e150478 100644
--- a/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/configuration/flume-env.xml
+++ b/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/configuration/flume-env.xml
@@ -32,6 +32,11 @@
     <description>Location to save log files</description>
   </property>
   <property>
+    <name>flume_run_dir</name>
+    <value>/var/run/flume</value>
+    <description>Location to save information about running agents</description>
+  </property>
+  <property>
     <name>flume_user</name>
     <value>flume</value>
     <property-type>USER</property-type>

http://git-wip-us.apache.org/repos/asf/ambari/blob/4d27a3db/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/package/scripts/flume.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/package/scripts/flume.py b/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/package/scripts/flume.py
index 6fb26fd..226cf8c 100644
--- a/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/package/scripts/flume.py
+++ b/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/package/scripts/flume.py
@@ -58,7 +58,8 @@ def flume(action = None):
       flume_agent_log4j_file = os.path.join(flume_agent_conf_dir, 'log4j.properties')
       flume_agent_env_file = os.path.join(flume_agent_conf_dir, 'flume-env.ps1')
 
-      Directory(flume_agent_conf_dir)
+      Directory(flume_agent_conf_dir
+      )
 
       PropertiesFile(flume_agent_conf_file,
                      properties=flume_agents[agent])
@@ -90,6 +91,9 @@ def flume(action = None):
       File(os.path.join(params.flume_conf_dir, n, 'ambari-meta.json'),
         action = "delete",
       )
+      
+    Directory(params.flume_run_dir,
+    )
 
     Directory(params.flume_conf_dir,
               recursive=True,

http://git-wip-us.apache.org/repos/asf/ambari/blob/4d27a3db/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/package/scripts/params.py b/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/package/scripts/params.py
index 41a1b67..dce73b3 100644
--- a/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/package/scripts/params.py
@@ -57,7 +57,7 @@ if Script.is_hdp_stack_greater_or_equal("2.2"):
 
 java_home = config['hostLevelParams']['java_home']
 flume_log_dir = config['configurations']['flume-env']['flume_log_dir']
-flume_run_dir = '/var/run/flume'
+flume_run_dir = config['configurations']['flume-env']['flume_run_dir']
 ambari_state_file = format("{flume_run_dir}/ambari-state.txt")
 
 if (('flume-conf' in config['configurations']) and('content' in config['configurations']['flume-conf'])):

http://git-wip-us.apache.org/repos/asf/ambari/blob/4d27a3db/ambari-server/src/test/python/stacks/2.0.6/FLUME/test_flume.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/FLUME/test_flume.py b/ambari-server/src/test/python/stacks/2.0.6/FLUME/test_flume.py
index 7161bc3..5ce4a0c 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/FLUME/test_flume.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/FLUME/test_flume.py
@@ -180,6 +180,7 @@ class TestFlumeHandler(RMFTestCase):
     self.assertNoMoreResources()
 
   def assert_configure_default(self):
+    self.assertResourceCalled('Directory', '/var/run/flume',)
     self.assertResourceCalled('Directory',
                               '/etc/flume/conf',
                               owner='flume',
@@ -218,7 +219,7 @@ class TestFlumeHandler(RMFTestCase):
     )
 
   def assert_configure_many(self):
-
+    self.assertResourceCalled('Directory', '/var/run/flume')
     self.assertResourceCalled('Directory',
                               '/etc/flume/conf',
                               owner='flume',
@@ -381,6 +382,7 @@ class TestFlumeHandler(RMFTestCase):
                        hdp_stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES)
 
+    self.assertResourceCalled('Directory', '/var/run/flume',)
     self.assertResourceCalled('Directory',
                               '/etc/flume/conf',
                               owner='flume',
@@ -429,6 +431,7 @@ class TestFlumeHandler(RMFTestCase):
                        hdp_stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES)
 
+    self.assertResourceCalled('Directory', '/var/run/flume',)
     self.assertResourceCalled('Directory',
                               '/usr/hdp/current/flume-server/conf',
                               owner='flume',

http://git-wip-us.apache.org/repos/asf/ambari/blob/4d27a3db/ambari-server/src/test/python/stacks/2.0.6/configs/default.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/configs/default.json b/ambari-server/src/test/python/stacks/2.0.6/configs/default.json
index 910885c..cbab92e 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/configs/default.json
+++ b/ambari-server/src/test/python/stacks/2.0.6/configs/default.json
@@ -586,7 +586,8 @@
         "flume-env": {
              "content": "export JAVA_HOME={{java64_home}}\nexport HIVE_HOME={{flume_hive_home}}",
              "flume_user": "flume",
-             "flume_log_dir": "/var/log/flume"
+             "flume_log_dir": "/var/log/flume",
+             "flume_run_dir": "/var/run/flume"
         },
       "storm-env": {
             "content": "\n#!/bin/bash\n\n# Set Storm specific environment variables here.\n\n# The java implementation to use.\nexport JAVA_HOME={{java_home}}\n\n# export STORM_CONF_DIR=\"\"", 

http://git-wip-us.apache.org/repos/asf/ambari/blob/4d27a3db/ambari-server/src/test/python/stacks/2.0.6/configs/flume_22.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/configs/flume_22.json b/ambari-server/src/test/python/stacks/2.0.6/configs/flume_22.json
index 5ef39f7..4f30caa 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/configs/flume_22.json
+++ b/ambari-server/src/test/python/stacks/2.0.6/configs/flume_22.json
@@ -513,7 +513,8 @@
         "flume-env": {
              "content": "export JAVA_HOME={{java64_home}}\nexport HIVE_HOME={{flume_hive_home}}",
              "flume_user": "flume",
-             "flume_log_dir": "/var/log/flume"
+             "flume_log_dir": "/var/log/flume",
+             "flume_run_dir": "/var/run/flume"
         },
       "storm-env": {
             "content": "\n#!/bin/bash\n\n# Set Storm specific environment variables here.\n\n# The java implementation to use.\nexport JAVA_HOME={{java_home}}\n\n# export STORM_CONF_DIR=\"\"", 

http://git-wip-us.apache.org/repos/asf/ambari/blob/4d27a3db/ambari-server/src/test/python/stacks/2.0.6/configs/flume_target.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/configs/flume_target.json b/ambari-server/src/test/python/stacks/2.0.6/configs/flume_target.json
index edea649..8da4816 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/configs/flume_target.json
+++ b/ambari-server/src/test/python/stacks/2.0.6/configs/flume_target.json
@@ -486,7 +486,8 @@
         "flume-env": {
           "content": "export JAVA_HOME={{java64_home}}",
           "flume_user": "flume",
-          "flume_log_dir": "/var/log/flume"
+          "flume_log_dir": "/var/log/flume",
+          "flume_run_dir": "/var/run/flume"
         },
         "tez-site": {
             "tez.am.log.level": "WARN",