AMBARI-21692 dfs.include file is created on all datanode hosts when Ambari 
manages include/exclude file (dsen)


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

Branch: refs/heads/feature-branch-AMBARI-21307
Commit: 10b1efbc40b5d7dcd3d26e153f8e17125be747e8
Parents: faf5d90
Author: Dmytro Sen <d...@apache.org>
Authored: Fri Aug 11 13:36:46 2017 +0300
Committer: Dmytro Sen <d...@apache.org>
Committed: Fri Aug 11 13:36:46 2017 +0300

----------------------------------------------------------------------
 .../2.1.0.2.0/package/scripts/hdfs_snamenode.py     |  6 ++++++
 .../3.0.0.3.0/package/scripts/hdfs_snamenode.py     |  6 ++++++
 .../before-START/scripts/shared_initialization.py   | 15 ---------------
 .../services/HDFS/package/scripts/hdfs_snamenode.py |  6 ++++++
 .../before-START/scripts/shared_initialization.py   | 16 +---------------
 .../before-START/scripts/shared_initialization.py   | 16 +---------------
 .../before-START/scripts/shared_initialization.py   | 14 --------------
 .../before-START/scripts/shared_initialization.py   | 14 --------------
 8 files changed, 20 insertions(+), 73 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/10b1efbc/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs_snamenode.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs_snamenode.py
 
b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs_snamenode.py
index 8d4c40c..0eaeef4 100644
--- 
a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs_snamenode.py
+++ 
b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs_snamenode.py
@@ -39,6 +39,12 @@ def snamenode(action=None, format=False):
          content=Template("exclude_hosts_list.j2"),
          owner=params.hdfs_user,
          group=params.user_group)
+    if params.hdfs_include_file:
+      File(params.include_file_path,
+         content=Template("include_hosts_list.j2"),
+         owner=params.hdfs_user,
+         group=params.user_group)
+      pass
   elif action == "start" or action == "stop":
     import params
     service(

http://git-wip-us.apache.org/repos/asf/ambari/blob/10b1efbc/ambari-server/src/main/resources/common-services/HDFS/3.0.0.3.0/package/scripts/hdfs_snamenode.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/HDFS/3.0.0.3.0/package/scripts/hdfs_snamenode.py
 
b/ambari-server/src/main/resources/common-services/HDFS/3.0.0.3.0/package/scripts/hdfs_snamenode.py
index 8d4c40c..0eaeef4 100644
--- 
a/ambari-server/src/main/resources/common-services/HDFS/3.0.0.3.0/package/scripts/hdfs_snamenode.py
+++ 
b/ambari-server/src/main/resources/common-services/HDFS/3.0.0.3.0/package/scripts/hdfs_snamenode.py
@@ -39,6 +39,12 @@ def snamenode(action=None, format=False):
          content=Template("exclude_hosts_list.j2"),
          owner=params.hdfs_user,
          group=params.user_group)
+    if params.hdfs_include_file:
+      File(params.include_file_path,
+         content=Template("include_hosts_list.j2"),
+         owner=params.hdfs_user,
+         group=params.user_group)
+      pass
   elif action == "start" or action == "stop":
     import params
     service(

http://git-wip-us.apache.org/repos/asf/ambari/blob/10b1efbc/ambari-server/src/main/resources/stacks/BIGTOP/0.8/hooks/before-START/scripts/shared_initialization.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/stacks/BIGTOP/0.8/hooks/before-START/scripts/shared_initialization.py
 
b/ambari-server/src/main/resources/stacks/BIGTOP/0.8/hooks/before-START/scripts/shared_initialization.py
index 265502f..cba724a 100644
--- 
a/ambari-server/src/main/resources/stacks/BIGTOP/0.8/hooks/before-START/scripts/shared_initialization.py
+++ 
b/ambari-server/src/main/resources/stacks/BIGTOP/0.8/hooks/before-START/scripts/shared_initialization.py
@@ -137,21 +137,6 @@ def setup_configs():
                 group=params.user_group
       )
 
-  generate_include_file()
-
-
-def generate_include_file():
-  import params
-
-  if params.has_namenode and params.dfs_hosts and params.has_slaves:
-    include_hosts_list = params.slave_hosts
-    File(params.dfs_hosts,
-         content=Template("include_hosts_list.j2"),
-         owner=params.hdfs_user,
-         group=params.user_group
-    )
-
-
 def install_snappy():
   import params
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/10b1efbc/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HDFS/package/scripts/hdfs_snamenode.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HDFS/package/scripts/hdfs_snamenode.py
 
b/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HDFS/package/scripts/hdfs_snamenode.py
index e734973..b7e4044 100644
--- 
a/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HDFS/package/scripts/hdfs_snamenode.py
+++ 
b/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HDFS/package/scripts/hdfs_snamenode.py
@@ -35,6 +35,12 @@ def snamenode(action=None, format=False):
          content=Template("exclude_hosts_list.j2"),
          owner=params.hdfs_user,
          group=params.user_group)
+    if params.hdfs_include_file:
+      File(params.include_file_path,
+         content=Template("include_hosts_list.j2"),
+         owner=params.hdfs_user,
+         group=params.user_group)
+      pass
   elif action == "start" or action == "stop":
     service(
       action=action,

http://git-wip-us.apache.org/repos/asf/ambari/blob/10b1efbc/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/shared_initialization.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/shared_initialization.py
 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/shared_initialization.py
index 42785ba..48dc4b0 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/shared_initialization.py
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/shared_initialization.py
@@ -142,20 +142,6 @@ def setup_configs():
                 group=params.user_group
       )
 
-  generate_include_file()
-
-
-def generate_include_file():
-  import params
-
-  if params.has_namenode and params.dfs_hosts and params.has_slaves:
-    include_hosts_list = params.slave_hosts
-    File(params.dfs_hosts,
-         content=Template("include_hosts_list.j2"),
-         owner=params.hdfs_user,
-         group=params.user_group
-    )
-
 def create_javahome_symlink():
   if os.path.exists("/usr/jdk/jdk1.6.0_31") and not 
os.path.exists("/usr/jdk64/jdk1.6.0_31"):
     Directory("/usr/jdk64/",
@@ -267,4 +253,4 @@ def __setup_unlimited_key_jce_policy(custom_java_home, 
custom_jdk_name, custom_j
               only_if=format("test -e {java_security_dir} && test -f 
{jce_zip_target}"),
               path=['/bin/', '/usr/bin'],
               sudo=True
-              )
\ No newline at end of file
+              )

http://git-wip-us.apache.org/repos/asf/ambari/blob/10b1efbc/ambari-server/src/main/resources/stacks/HDP/3.0/hooks/before-START/scripts/shared_initialization.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/3.0/hooks/before-START/scripts/shared_initialization.py
 
b/ambari-server/src/main/resources/stacks/HDP/3.0/hooks/before-START/scripts/shared_initialization.py
index 5156dd4..3f9a863 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/3.0/hooks/before-START/scripts/shared_initialization.py
+++ 
b/ambari-server/src/main/resources/stacks/HDP/3.0/hooks/before-START/scripts/shared_initialization.py
@@ -135,20 +135,6 @@ def setup_configs():
                 group=params.user_group
       )
 
-  generate_include_file()
-
-
-def generate_include_file():
-  import params
-
-  if params.has_namenode and params.dfs_hosts and params.has_slaves:
-    include_hosts_list = params.slave_hosts
-    File(params.dfs_hosts,
-         content=Template("include_hosts_list.j2"),
-         owner=params.hdfs_user,
-         group=params.user_group
-    )
-
 def create_javahome_symlink():
   if os.path.exists("/usr/jdk/jdk1.6.0_31") and not 
os.path.exists("/usr/jdk64/jdk1.6.0_31"):
     Directory("/usr/jdk64/",
@@ -260,4 +246,4 @@ def __setup_unlimited_key_jce_policy(custom_java_home, 
custom_jdk_name, custom_j
               only_if=format("test -e {java_security_dir} && test -f 
{jce_zip_target}"),
               path=['/bin/', '/usr/bin'],
               sudo=True
-              )
\ No newline at end of file
+              )

http://git-wip-us.apache.org/repos/asf/ambari/blob/10b1efbc/contrib/management-packs/hdf-ambari-mpack/src/main/resources/stacks/HDF/2.0/hooks/before-START/scripts/shared_initialization.py
----------------------------------------------------------------------
diff --git 
a/contrib/management-packs/hdf-ambari-mpack/src/main/resources/stacks/HDF/2.0/hooks/before-START/scripts/shared_initialization.py
 
b/contrib/management-packs/hdf-ambari-mpack/src/main/resources/stacks/HDF/2.0/hooks/before-START/scripts/shared_initialization.py
index ba9c8fb..01e55c0 100644
--- 
a/contrib/management-packs/hdf-ambari-mpack/src/main/resources/stacks/HDF/2.0/hooks/before-START/scripts/shared_initialization.py
+++ 
b/contrib/management-packs/hdf-ambari-mpack/src/main/resources/stacks/HDF/2.0/hooks/before-START/scripts/shared_initialization.py
@@ -132,20 +132,6 @@ def setup_configs():
                 group=params.user_group
       )
 
-  generate_include_file()
-
-
-def generate_include_file():
-  import params
-
-  if params.has_namenode and params.dfs_hosts and params.has_slaves:
-    include_hosts_list = params.slave_hosts
-    File(params.dfs_hosts,
-         content=Template("include_hosts_list.j2"),
-         owner=params.hdfs_user,
-         group=params.user_group
-    )
-
 def create_javahome_symlink():
   if os.path.exists("/usr/jdk/jdk1.6.0_31") and not 
os.path.exists("/usr/jdk64/jdk1.6.0_31"):
     Directory("/usr/jdk64/",

http://git-wip-us.apache.org/repos/asf/ambari/blob/10b1efbc/contrib/management-packs/odpi-ambari-mpack/src/main/resources/stacks/ODPi/2.0/hooks/before-START/scripts/shared_initialization.py
----------------------------------------------------------------------
diff --git 
a/contrib/management-packs/odpi-ambari-mpack/src/main/resources/stacks/ODPi/2.0/hooks/before-START/scripts/shared_initialization.py
 
b/contrib/management-packs/odpi-ambari-mpack/src/main/resources/stacks/ODPi/2.0/hooks/before-START/scripts/shared_initialization.py
index ba9c8fb..01e55c0 100755
--- 
a/contrib/management-packs/odpi-ambari-mpack/src/main/resources/stacks/ODPi/2.0/hooks/before-START/scripts/shared_initialization.py
+++ 
b/contrib/management-packs/odpi-ambari-mpack/src/main/resources/stacks/ODPi/2.0/hooks/before-START/scripts/shared_initialization.py
@@ -132,20 +132,6 @@ def setup_configs():
                 group=params.user_group
       )
 
-  generate_include_file()
-
-
-def generate_include_file():
-  import params
-
-  if params.has_namenode and params.dfs_hosts and params.has_slaves:
-    include_hosts_list = params.slave_hosts
-    File(params.dfs_hosts,
-         content=Template("include_hosts_list.j2"),
-         owner=params.hdfs_user,
-         group=params.user_group
-    )
-
 def create_javahome_symlink():
   if os.path.exists("/usr/jdk/jdk1.6.0_31") and not 
os.path.exists("/usr/jdk64/jdk1.6.0_31"):
     Directory("/usr/jdk64/",

Reply via email to