You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by nc...@apache.org on 2015/10/19 15:54:18 UTC
[32/50] [abbrv] ambari git commit: Revert "AMBARI-13427: NAMENODE
START failed with both NN's being passive (jluniya)"
Revert "AMBARI-13427: NAMENODE START failed with both NN's being passive (jluniya)"
This reverts commit ce356ddc8ca233737e270fec097381192bc4bcb8.
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/dec7c8ee
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/dec7c8ee
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/dec7c8ee
Branch: refs/heads/branch-dev-patch-upgrade
Commit: dec7c8eed63393e8fbc5e3114695eb6b43b6c25e
Parents: ce356dd
Author: Jayush Luniya <jl...@hortonworks.com>
Authored: Fri Oct 16 09:26:20 2015 -0700
Committer: Jayush Luniya <jl...@hortonworks.com>
Committed: Fri Oct 16 09:26:20 2015 -0700
----------------------------------------------------------------------
.../libraries/functions/namenode_ha_utils.py | 27 ++------------------
1 file changed, 2 insertions(+), 25 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/dec7c8ee/ambari-common/src/main/python/resource_management/libraries/functions/namenode_ha_utils.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/namenode_ha_utils.py b/ambari-common/src/main/python/resource_management/libraries/functions/namenode_ha_utils.py
index 0920e85..99f90b8 100644
--- a/ambari-common/src/main/python/resource_management/libraries/functions/namenode_ha_utils.py
+++ b/ambari-common/src/main/python/resource_management/libraries/functions/namenode_ha_utils.py
@@ -23,8 +23,6 @@ from resource_management.libraries.functions.format import format
from resource_management.libraries.functions.jmx import get_value_from_jmx
from resource_management.core.base import Fail
from resource_management.core import shell
-from resource_management.core.logger import Logger
-from resource_management.libraries.functions.decorator import retry
__all__ = ["get_namenode_states", "get_active_namenode", "get_property_for_active_namenode"]
@@ -34,29 +32,8 @@ HDFS_NN_STATE_STANDBY = 'standby'
NAMENODE_HTTP_FRAGMENT = 'dfs.namenode.http-address.{0}.{1}'
NAMENODE_HTTPS_FRAGMENT = 'dfs.namenode.https-address.{0}.{1}'
JMX_URI_FRAGMENT = "{0}://{1}/jmx?qry=Hadoop:service=NameNode,name=FSNamesystem"
-
-def get_namenode_states(hdfs_site, security_enabled, run_user, times=10, sleep_time=1, backoff_factor=2):
- """
- return format [('nn1', 'hdfs://hostname1:port1'), ('nn2', 'hdfs://hostname2:port2')] , [....], [....]
- """
- @retry(times=times, sleep_time=sleep_time, backoff_factor=backoff_factor, err_class=Fail)
- def doRetries(hdfs_site, security_enabled, run_user):
- doRetries.attempt += 1
- active_namenodes, standby_namenodes, unknown_namenodes = get_namenode_states_noretries(hdfs_site, security_enabled, run_user)
- Logger.info(
- "NameNode HA states: active_namenodes = {0}, standby_namenodes = {1}, unknown_namenodes = {2}".format(
- active_namenodes, standby_namenodes, unknown_namenodes))
- if active_namenodes:
- return active_namenodes, standby_namenodes, unknown_namenodes
- elif doRetries.attempt == times:
- Logger.warning("No active NameNode was found after {0} retries. Will return current NameNode HA states".format(times))
- return active_namenodes, standby_namenodes, unknown_namenodes
- raise Fail('No active NameNode was found.')
-
- doRetries.attempt = 0
- return doRetries(hdfs_site, security_enabled, run_user)
-
-def get_namenode_states_noretries(hdfs_site, security_enabled, run_user):
+
+def get_namenode_states(hdfs_site, security_enabled, run_user):
"""
return format [('nn1', 'hdfs://hostname1:port1'), ('nn2', 'hdfs://hostname2:port2')] , [....], [....]
"""