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/30 15:29:23 UTC

[1/2] ambari git commit: AMBARI-12203. Zookeeper server restart failed after 1.7 to 2.1 (aonishuk)

Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 1e1581010 -> a086b90db
  refs/heads/trunk 52520d0fb -> c14454419


AMBARI-12203. Zookeeper server restart failed after 1.7 to 2.1 (aonishuk)


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

Branch: refs/heads/trunk
Commit: c14454419b7948fea9e53d3589fda9e279063816
Parents: 52520d0
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Tue Jun 30 16:29:14 2015 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Tue Jun 30 16:29:14 2015 +0300

----------------------------------------------------------------------
 .../ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper.py     | 11 +++++++----
 .../3.4.5.2.0/package/scripts/zookeeper_server.py        |  4 ++--
 .../3.4.5.2.0/package/scripts/zookeeper_service.py       | 10 +++++++++-
 3 files changed, 18 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/c1445441/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper.py b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper.py
index 6a6f2d1..973fa0f 100644
--- a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper.py
+++ b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper.py
@@ -31,6 +31,13 @@ from ambari_commons.os_family_impl import OsFamilyFuncImpl, OsFamilyImpl
 def zookeeper(type = None, rolling_restart = False):
   import params
 
+  if type == 'server':
+    # This path may be missing after Ambari upgrade. We need to create it. We need to do this before any configs will
+    # be applied.
+    if not rolling_restart and not os.path.exists("/usr/hdp/current/zookeeper-server") and params.current_version:
+      conf_select.select(params.stack_name, "zookeeper", params.current_version)
+      hdp_select.select("zookeeper-server", params.version)
+
   Directory(params.config_dir,
             owner=params.zk_user,
             recursive=True,
@@ -73,10 +80,6 @@ def zookeeper(type = None, rolling_restart = False):
          mode = 0644,
          content = myid
     )
-    # This path may be missing after Ambari upgrade. We need to create it.
-    if (not rolling_restart) and (not os.path.exists("/usr/hdp/current/zookeeper-server")) and params.current_version:
-      conf_select(params.stack_name, "zookeeper", params.current_version)
-      hdp_select.select("zookeeper-server", params.version)
 
   if (params.log4j_props != None):
     File(os.path.join(params.config_dir, "log4j.properties"),

http://git-wip-us.apache.org/repos/asf/ambari/blob/c1445441/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_server.py b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_server.py
index f3e9d10..240882f 100644
--- a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_server.py
+++ b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_server.py
@@ -52,12 +52,12 @@ class ZookeeperServer(Script):
     import params
     env.set_params(params)
     self.configure(env, rolling_restart=rolling_restart)
-    zookeeper_service(action = 'start')
+    zookeeper_service(action='start', rolling_restart=rolling_restart)
 
   def stop(self, env, rolling_restart=False):
     import params
     env.set_params(params)
-    zookeeper_service(action = 'stop')
+    zookeeper_service(action='stop', rolling_restart=rolling_restart)
 
 @OsFamilyImpl(os_family=OsFamilyImpl.DEFAULT)
 class ZookeeperServerLinux(ZookeeperServer):

http://git-wip-us.apache.org/repos/asf/ambari/blob/c1445441/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_service.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_service.py b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_service.py
index 59ad417..b983983 100644
--- a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_service.py
+++ b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_service.py
@@ -19,14 +19,22 @@ Ambari Agent
 
 """
 
+import os
 from resource_management import *
 from ambari_commons import OSConst
 from ambari_commons.os_family_impl import OsFamilyFuncImpl, OsFamilyImpl
+from resource_management.libraries.functions import conf_select
+from resource_management.libraries.functions import hdp_select
 
 @OsFamilyFuncImpl(os_family=OsFamilyImpl.DEFAULT)
-def zookeeper_service(action='start'):
+def zookeeper_service(action='start', rolling_restart=False):
   import params
 
+  # This path may be missing after Ambari upgrade. We need to create it.
+  if not rolling_restart and not os.path.exists("/usr/hdp/current/zookeeper-server") and params.current_version:
+    conf_select.select(params.stack_name, "zookeeper", params.current_version)
+    hdp_select.select("zookeeper-server", params.version)
+
   cmd = format("env ZOOCFGDIR={config_dir} ZOOCFG=zoo.cfg {zk_bin}/zkServer.sh")
 
   if action == 'start':


[2/2] ambari git commit: AMBARI-12203. Zookeeper server restart failed after 1.7 to 2.1 (aonishuk)

Posted by ao...@apache.org.
AMBARI-12203. Zookeeper server restart failed after 1.7 to 2.1 (aonishuk)


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

Branch: refs/heads/branch-2.1
Commit: a086b90dbed8227ae82b5b49340e51ad176fd31d
Parents: 1e15810
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Tue Jun 30 16:29:16 2015 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Tue Jun 30 16:29:16 2015 +0300

----------------------------------------------------------------------
 .../ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper.py     | 11 +++++++----
 .../3.4.5.2.0/package/scripts/zookeeper_server.py        |  4 ++--
 .../3.4.5.2.0/package/scripts/zookeeper_service.py       | 10 +++++++++-
 3 files changed, 18 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/a086b90d/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper.py b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper.py
index 6a6f2d1..973fa0f 100644
--- a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper.py
+++ b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper.py
@@ -31,6 +31,13 @@ from ambari_commons.os_family_impl import OsFamilyFuncImpl, OsFamilyImpl
 def zookeeper(type = None, rolling_restart = False):
   import params
 
+  if type == 'server':
+    # This path may be missing after Ambari upgrade. We need to create it. We need to do this before any configs will
+    # be applied.
+    if not rolling_restart and not os.path.exists("/usr/hdp/current/zookeeper-server") and params.current_version:
+      conf_select.select(params.stack_name, "zookeeper", params.current_version)
+      hdp_select.select("zookeeper-server", params.version)
+
   Directory(params.config_dir,
             owner=params.zk_user,
             recursive=True,
@@ -73,10 +80,6 @@ def zookeeper(type = None, rolling_restart = False):
          mode = 0644,
          content = myid
     )
-    # This path may be missing after Ambari upgrade. We need to create it.
-    if (not rolling_restart) and (not os.path.exists("/usr/hdp/current/zookeeper-server")) and params.current_version:
-      conf_select(params.stack_name, "zookeeper", params.current_version)
-      hdp_select.select("zookeeper-server", params.version)
 
   if (params.log4j_props != None):
     File(os.path.join(params.config_dir, "log4j.properties"),

http://git-wip-us.apache.org/repos/asf/ambari/blob/a086b90d/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_server.py b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_server.py
index f3e9d10..240882f 100644
--- a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_server.py
+++ b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_server.py
@@ -52,12 +52,12 @@ class ZookeeperServer(Script):
     import params
     env.set_params(params)
     self.configure(env, rolling_restart=rolling_restart)
-    zookeeper_service(action = 'start')
+    zookeeper_service(action='start', rolling_restart=rolling_restart)
 
   def stop(self, env, rolling_restart=False):
     import params
     env.set_params(params)
-    zookeeper_service(action = 'stop')
+    zookeeper_service(action='stop', rolling_restart=rolling_restart)
 
 @OsFamilyImpl(os_family=OsFamilyImpl.DEFAULT)
 class ZookeeperServerLinux(ZookeeperServer):

http://git-wip-us.apache.org/repos/asf/ambari/blob/a086b90d/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_service.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_service.py b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_service.py
index 59ad417..b983983 100644
--- a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_service.py
+++ b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_service.py
@@ -19,14 +19,22 @@ Ambari Agent
 
 """
 
+import os
 from resource_management import *
 from ambari_commons import OSConst
 from ambari_commons.os_family_impl import OsFamilyFuncImpl, OsFamilyImpl
+from resource_management.libraries.functions import conf_select
+from resource_management.libraries.functions import hdp_select
 
 @OsFamilyFuncImpl(os_family=OsFamilyImpl.DEFAULT)
-def zookeeper_service(action='start'):
+def zookeeper_service(action='start', rolling_restart=False):
   import params
 
+  # This path may be missing after Ambari upgrade. We need to create it.
+  if not rolling_restart and not os.path.exists("/usr/hdp/current/zookeeper-server") and params.current_version:
+    conf_select.select(params.stack_name, "zookeeper", params.current_version)
+    hdp_select.select("zookeeper-server", params.version)
+
   cmd = format("env ZOOCFGDIR={config_dir} ZOOCFG=zoo.cfg {zk_bin}/zkServer.sh")
 
   if action == 'start':