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 2016/06/23 10:46:33 UTC
[2/2] ambari git commit: AMBARI-17375. [RU/EU] According to Atlas
run-book, implement upgrade for Atlas component (aonishuk)
AMBARI-17375. [RU/EU] According to Atlas run-book, implement upgrade for Atlas component (aonishuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/3283b09c
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/3283b09c
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/3283b09c
Branch: refs/heads/branch-2.4
Commit: 3283b09c22d182e25ad5d7cafcc92c3289c0bf1a
Parents: 7616eda
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Thu Jun 23 13:46:24 2016 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Thu Jun 23 13:46:24 2016 +0300
----------------------------------------------------------------------
.../libraries/functions/constants.py | 7 ++++--
.../0.1.0.2.3/package/scripts/atlas_client.py | 23 +++++++-----------
.../package/scripts/metadata_server.py | 10 ++++----
.../HDP/2.0.6/properties/stack_features.json | 5 ++++
.../HDP/2.3/upgrades/nonrolling-upgrade-2.3.xml | 25 --------------------
.../stacks/HDP/2.3/upgrades/upgrade-2.3.xml | 10 --------
.../HDP/2.4/upgrades/nonrolling-upgrade-2.4.xml | 25 --------------------
.../stacks/HDP/2.4/upgrades/upgrade-2.4.xml | 10 --------
.../HDP/2.5/upgrades/nonrolling-upgrade-2.5.xml | 18 +++++++++++---
.../stacks/HDP/2.5/upgrades/upgrade-2.5.xml | 24 ++++++++++++++++++-
10 files changed, 61 insertions(+), 96 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/3283b09c/ambari-common/src/main/python/resource_management/libraries/functions/constants.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/constants.py b/ambari-common/src/main/python/resource_management/libraries/functions/constants.py
index 7e85115..be2a4c8 100644
--- a/ambari-common/src/main/python/resource_management/libraries/functions/constants.py
+++ b/ambari-common/src/main/python/resource_management/libraries/functions/constants.py
@@ -20,6 +20,7 @@ limitations under the License.
__all__ = ["Direction", "SafeMode", "StackFeature"]
+
class Direction:
"""
Stack Upgrade direction
@@ -27,6 +28,7 @@ class Direction:
UPGRADE = "upgrade"
DOWNGRADE = "downgrade"
+
class SafeMode:
"""
Namenode Safe Mode state
@@ -34,7 +36,8 @@ class SafeMode:
ON = "ON"
OFF = "OFF"
UNKNOWN = "UNKNOWN"
-
+
+
class StackFeature:
"""
Stack Feature supported
@@ -68,7 +71,6 @@ class StackFeature:
ACCUMULO_KERBEROS_USER_AUTH = "accumulo_kerberos_user_auth"
KNOX_VERSIONED_DATA_DIR = "knox_versioned_data_dir"
KNOX_SSO_TOPOLOGY = "knox_sso_topology"
- ATLAS_ROLLING_UPGRADE = "atlas_rolling_upgrade"
OOZIE_ADMIN_USER = "oozie_admin_user"
OOZIE_CREATE_HIVE_TEZ_CONFIGS = "oozie_create_hive_tez_configs"
OOZIE_SETUP_SHARED_LIB = "oozie_setup_shared_lib"
@@ -87,3 +89,4 @@ class StackFeature:
LOGSEARCH_SUPPORT = "logsearch_support"
HBASE_HOME_DIRECTORY = "hbase_home_directory"
ATLAS_RANGER_PLUGIN_SUPPORT = "atlas_ranger_plugin_support"
+ ATLAS_UPGRADE_SUPPORT = "atlas_upgrade_support"
http://git-wip-us.apache.org/repos/asf/ambari/blob/3283b09c/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/atlas_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/atlas_client.py b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/atlas_client.py
index a642d14..2376ff9 100644
--- a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/atlas_client.py
+++ b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/atlas_client.py
@@ -27,30 +27,25 @@ from resource_management.libraries.functions import StackFeature
from metadata import metadata
-# todo: support rolling upgrade
+
class AtlasClient(Script):
def get_component_name(self):
return "atlas-client"
- # ToDo: currently <stack-selector-tool> doesn't contain atlas-client, uncomment this block when
- # ToDo: atlas-client will be available
- # def pre_upgrade_restart(self, env, upgrade_type=None):
- # import params
- # env.set_params(params)
- #
- # TODO: Add ATLAS_CONFIG_VERSIONING stack feature and uncomment this code when config versioning for Atlas is supported
- # if params.version and check_stack_feature(StackFeature.ATLAS_CONFIG_VERSIONING, params.version):
- # conf_select.select(params.stack_name, "atlas", params.version)
- # TODO: Add ATLAS_CLIENT_ROLLING_UPGRADE stack feature and uncomment this code when rolling upgrade for Atlas client is supported
- # if params.version and check_stack_feature(StackFeature.ATLAS_CLIENT_ROLLING_UPGRADE, params.version):
- # stack_select.select("atlas-client", params.version)
+ def pre_upgrade_restart(self, env, upgrade_type=None):
+ import params
+ env.set_params(params)
+
+ if check_stack_feature(StackFeature.ATLAS_UPGRADE_SUPPORT, params.version):
+ conf_select.select(params.stack_name, "atlas", params.version)
+ stack_select.select("atlas-client", params.version)
def install(self, env):
self.install_packages(env)
self.configure(env)
- def configure(self, env):
+ def configure(self, env, upgrade_type=None, config_dir=None):
import params
env.set_params(params)
metadata('client')
http://git-wip-us.apache.org/repos/asf/ambari/blob/3283b09c/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata_server.py b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata_server.py
index bf3125e..062e8ef 100644
--- a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata_server.py
+++ b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata_server.py
@@ -32,6 +32,7 @@ import shutil
from resource_management.core.logger import Logger
from setup_ranger_atlas import setup_ranger_atlas
+
class MetadataServer(Script):
def get_component_name(self):
@@ -47,7 +48,7 @@ class MetadataServer(Script):
self.install_packages(env)
- def configure(self, env):
+ def configure(self, env, upgrade_type=None, config_dir=None):
import params
env.set_params(params)
metadata()
@@ -56,11 +57,8 @@ class MetadataServer(Script):
import params
env.set_params(params)
- # TODO: Add ATLAS_CONFIG_VERSIONING stack feature and uncomment this code when config versioning for Atlas is supported
- #if params.version and check_stack_feature(StackFeature.ATLAS_CONFIG_VERSIONING, params.version):
- # conf_select.select(params.stack_name, "atlas", params.version)
-
- if params.version and check_stack_feature(StackFeature.ATLAS_ROLLING_UPGRADE, params.version):
+ if check_stack_feature(StackFeature.ATLAS_UPGRADE_SUPPORT, params.version):
+ conf_select.select(params.stack_name, "atlas", params.version)
stack_select.select("atlas-server", params.version)
def start(self, env, upgrade_type=None):
http://git-wip-us.apache.org/repos/asf/ambari/blob/3283b09c/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json b/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json
index 8ad53da..574264e 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json
@@ -245,6 +245,11 @@
"name": "atlas_ranger_plugin_support",
"description": "Atlas Ranger plugin support",
"min_version": "2.5.0.0"
+ },
+ {
+ "name": "atlas_upgrade_support",
+ "description": "Atlas supports express and rolling upgrades",
+ "min_version": "2.5.0.0"
}
]
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/3283b09c/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.3.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.3.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.3.xml
index 432657f..d23412d 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.3.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.3.xml
@@ -69,11 +69,6 @@
<parallel-scheduler/>
<service-check>false</service-check>
- <!-- TODO, Atlas doesn't yet support upgrades and the client doesn't exist in hdp-select. -->
- <service name="ATLAS">
- <component>ATLAS_SERVER</component>
- </service>
-
<service name="FLUME">
<component>FLUME_HANDLER</component>
</service>
@@ -480,17 +475,6 @@
</service>
</group>
- <!-- TODO, Atlas doesn't yet support upgrades and the client doesn't exist in hdp-select. -->
- <group xsi:type="restart" name="ATLAS" title="Atlas">
- <service-check>false</service-check>
- <skippable>true</skippable>
- <supports-auto-skip-failure>false</supports-auto-skip-failure>
- <parallel-scheduler/>
- <service name="ATLAS">
- <component>ATLAS_SERVER</component>
- </service>
- </group>
-
<group xsi:type="restart" name="OOZIE" title="Oozie">
<service-check>false</service-check>
<skippable>true</skippable>
@@ -1045,14 +1029,5 @@
</component>
</service>
- <!-- TODO, Atlas doesn't yet support upgrades and the client doesn't exist in hdp-select. -->
- <service name="ATLAS">
- <component name="ATLAS_SERVER">
- <upgrade>
- <task xsi:type="restart-task"/>
- </upgrade>
- </component>
-
- </service>
</processing>
</upgrade>
http://git-wip-us.apache.org/repos/asf/ambari/blob/3283b09c/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.3.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.3.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.3.xml
index 30175ab..44ceee3 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.3.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.3.xml
@@ -239,16 +239,6 @@
</service>
</group>
- <!-- TODO, Atlas doesn't yet support upgrades and the client doesn't exist in hdp-select. -->
- <group name="ATLAS" title="Atlas">
- <service-check>false</service-check>
- <skippable>true</skippable>
- <supports-auto-skip-failure>false</supports-auto-skip-failure>
- <service name="ATLAS">
- <component>ATLAS_SERVER</component>
- </service>
- </group>
-
<group name="OOZIE" title="Oozie">
<skippable>true</skippable>
<supports-auto-skip-failure>false</supports-auto-skip-failure>
http://git-wip-us.apache.org/repos/asf/ambari/blob/3283b09c/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.4.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.4.xml b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.4.xml
index 5b2860a..fb91a25 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.4.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.4.xml
@@ -69,11 +69,6 @@
<parallel-scheduler/>
<service-check>false</service-check>
- <!-- TODO, Atlas doesn't yet support upgrades and the client doesn't exist in hdp-select. -->
- <service name="ATLAS">
- <component>ATLAS_SERVER</component>
- </service>
-
<service name="FLUME">
<component>FLUME_HANDLER</component>
</service>
@@ -475,17 +470,6 @@
</service>
</group>
- <!-- TODO, Atlas doesn't yet support upgrades and the client doesn't exist in hdp-select. -->
- <group xsi:type="restart" name="ATLAS" title="Atlas">
- <service-check>false</service-check>
- <skippable>true</skippable>
- <supports-auto-skip-failure>false</supports-auto-skip-failure>
- <parallel-scheduler/>
- <service name="ATLAS">
- <component>ATLAS_SERVER</component>
- </service>
- </group>
-
<group xsi:type="restart" name="OOZIE" title="Oozie">
<service-check>false</service-check>
<skippable>true</skippable>
@@ -1040,14 +1024,5 @@
</component>
</service>
- <!-- TODO, Atlas doesn't yet support upgrades and the client doesn't exist in hdp-select. -->
- <service name="ATLAS">
- <component name="ATLAS_SERVER">
- <upgrade>
- <task xsi:type="restart-task"/>
- </upgrade>
- </component>
-
- </service>
</processing>
</upgrade>
http://git-wip-us.apache.org/repos/asf/ambari/blob/3283b09c/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.4.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.4.xml b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.4.xml
index ea4cf17..821a5b4 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.4.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.4.xml
@@ -237,16 +237,6 @@
</service>
</group>
- <!-- TODO, Atlas doesn't yet support upgrades and the client doesn't exist in hdp-select. -->
- <group name="ATLAS" title="Atlas">
- <service-check>false</service-check>
- <skippable>true</skippable>
- <supports-auto-skip-failure>false</supports-auto-skip-failure>
- <service name="ATLAS">
- <component>ATLAS_SERVER</component>
- </service>
- </group>
-
<group name="OOZIE" title="Oozie">
<skippable>true</skippable>
<supports-auto-skip-failure>false</supports-auto-skip-failure>
http://git-wip-us.apache.org/repos/asf/ambari/blob/3283b09c/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.5.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.5.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.5.xml
index 0a9a1f0..579b5ff 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.5.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.5.xml
@@ -69,7 +69,6 @@
<parallel-scheduler/>
<service-check>false</service-check>
- <!-- TODO, Atlas doesn't yet support upgrades and the client doesn't exist in hdp-select. -->
<service name="ATLAS">
<component>ATLAS_SERVER</component>
</service>
@@ -485,7 +484,6 @@
</service>
</group>
- <!-- TODO, Atlas doesn't yet support upgrades and the client doesn't exist in hdp-select. -->
<group xsi:type="restart" name="ATLAS" title="Atlas">
<service-check>false</service-check>
<skippable>true</skippable>
@@ -496,6 +494,16 @@
</service>
</group>
+ <group xsi:type="restart" name="ATLAS_CLIENTS" title="Atlas Clients">
+ <service-check>false</service-check>
+ <skippable>true</skippable>
+ <supports-auto-skip-failure>true</supports-auto-skip-failure>
+ <parallel-scheduler/>
+ <service name="ATLAS">
+ <component>ATLAS_CLIENT</component>
+ </service>
+ </group>
+
<group xsi:type="restart" name="OOZIE" title="Oozie">
<service-check>false</service-check>
<skippable>true</skippable>
@@ -1053,7 +1061,6 @@
</component>
</service>
- <!-- TODO, Atlas doesn't yet support upgrades and the client doesn't exist in hdp-select. -->
<service name="ATLAS">
<component name="ATLAS_SERVER">
<upgrade>
@@ -1061,6 +1068,11 @@
</upgrade>
</component>
+ <component name="ATLAS_CLIENT">
+ <upgrade>
+ <task xsi:type="restart-task"/>
+ </upgrade>
+ </component>
</service>
</processing>
</upgrade>
http://git-wip-us.apache.org/repos/asf/ambari/blob/3283b09c/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.5.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.5.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.5.xml
index ae87268..699982c 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.5.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.5.xml
@@ -247,7 +247,6 @@
</service>
</group>
- <!-- TODO, Atlas doesn't yet support upgrades and the client doesn't exist in hdp-select. -->
<group name="ATLAS" title="Atlas">
<service-check>false</service-check>
<skippable>true</skippable>
@@ -257,6 +256,15 @@
</service>
</group>
+ <group name="ATLAS_CLIENTS" title="Atlas Clients">
+ <service-check>false</service-check>
+ <skippable>true</skippable>
+ <supports-auto-skip-failure>true</supports-auto-skip-failure>
+ <service name="ATLAS">
+ <component>ATLAS_CLIENT</component>
+ </service>
+ </group>
+
<group name="OOZIE" title="Oozie">
<skippable>true</skippable>
<supports-auto-skip-failure>false</supports-auto-skip-failure>
@@ -881,5 +889,19 @@
</upgrade>
</component>
</service>
+
+ <service name="ATLAS">
+ <component name="ATLAS_SERVER">
+ <upgrade>
+ <task xsi:type="restart-task"/>
+ </upgrade>
+ </component>
+ <component name="ATLAS_CLIENT">
+ <upgrade>
+ <task xsi:type="restart-task"/>
+ </upgrade>
+ </component>
+ </service>
+
</processing>
</upgrade>