You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by vi...@apache.org on 2012/06/06 23:30:21 UTC
svn commit: r1347144 - in /incubator/ambari/branches/ambari-186: CHANGES.txt
hmc/php/frontend/uninstall/cleanupProcesses.php
hmc/php/puppet/genmanifest/PuppetClassDependencies.php
hmc/php/puppet/genmanifest/generateManifest.php
Author: vikram
Date: Wed Jun 6 21:30:20 2012
New Revision: 1347144
URL: http://svn.apache.org/viewvc?rev=1347144&view=rev
Log:
AMBARI-377. Uninstall does not handle component dependencies. (Contributed by Jitendra)
Modified:
incubator/ambari/branches/ambari-186/CHANGES.txt
incubator/ambari/branches/ambari-186/hmc/php/frontend/uninstall/cleanupProcesses.php
incubator/ambari/branches/ambari-186/hmc/php/puppet/genmanifest/PuppetClassDependencies.php
incubator/ambari/branches/ambari-186/hmc/php/puppet/genmanifest/generateManifest.php
Modified: incubator/ambari/branches/ambari-186/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/ambari-186/CHANGES.txt?rev=1347144&r1=1347143&r2=1347144&view=diff
==============================================================================
--- incubator/ambari/branches/ambari-186/CHANGES.txt (original)
+++ incubator/ambari/branches/ambari-186/CHANGES.txt Wed Jun 6 21:30:20 2012
@@ -6,6 +6,8 @@ characters wide.
Release 0.1.x - unreleased
+ AMBARI-377. Uninstall does not handle component dependencies. (Jitendra via Vikram)
+
AMBARI-380. Clean up messages for Add Nodes and Deploy progress result (Yusaku via Vikram)
AMBARI-379. Remove puppet start stub on uninstall. (Mahadev via Vikram)
Modified: incubator/ambari/branches/ambari-186/hmc/php/frontend/uninstall/cleanupProcesses.php
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/ambari-186/hmc/php/frontend/uninstall/cleanupProcesses.php?rev=1347144&r1=1347143&r2=1347144&view=diff
==============================================================================
--- incubator/ambari/branches/ambari-186/hmc/php/frontend/uninstall/cleanupProcesses.php (original)
+++ incubator/ambari/branches/ambari-186/hmc/php/frontend/uninstall/cleanupProcesses.php Wed Jun 6 21:30:20 2012
@@ -11,7 +11,7 @@ $logger = new HMCLogger("CleanupProcesse
$dbAccessor = new HMCDBAccessor($GLOBALS["DB_PATH"]);
function getCommandLine() {
- $cmdLine = " killall puppet ; rm -rf /var/lib/puppet/ssl ; ";
+ $cmdLine = " killall puppet ; ";
return $cmdLine;
}
Modified: incubator/ambari/branches/ambari-186/hmc/php/puppet/genmanifest/PuppetClassDependencies.php
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/ambari-186/hmc/php/puppet/genmanifest/PuppetClassDependencies.php?rev=1347144&r1=1347143&r2=1347144&view=diff
==============================================================================
--- incubator/ambari/branches/ambari-186/hmc/php/puppet/genmanifest/PuppetClassDependencies.php (original)
+++ incubator/ambari/branches/ambari-186/hmc/php/puppet/genmanifest/PuppetClassDependencies.php Wed Jun 6 21:30:20 2012
@@ -45,6 +45,11 @@ class PuppetClassDependencies {
$this->addDependency("hdp-hbase::master", SERVICE_STATE_RUNNING, "hdp-hadoop::client",
array("service_state" => SERVICE_STATE_NO_OP));
+ $this->addDependency("hdp-hbase::master", SERVICE_STATE_UNINSTALLED, "hdp-zookeeper::client",
+ array("service_state" => SERVICE_STATE_UNINSTALLED));
+ $this->addDependency("hdp-hbase::master", SERVICE_STATE_UNINSTALLED, "hdp-hadoop::client",
+ array("service_state" => SERVICE_STATE_UNINSTALLED));
+
$this->addDependency("hdp-hbase::regionserver", SERVICE_STATE_INSTALLED_AND_CONFIGURED, "hdp-zookeeper::client",
array("service_state" => SERVICE_STATE_INSTALLED_AND_CONFIGURED));
$this->addDependency("hdp-hbase::regionserver", SERVICE_STATE_INSTALLED_AND_CONFIGURED, "hdp-hadoop::client",
@@ -55,19 +60,31 @@ class PuppetClassDependencies {
$this->addDependency("hdp-hbase::regionserver", SERVICE_STATE_RUNNING, "hdp-hadoop::client",
array("service_state" => SERVICE_STATE_NO_OP));
+ $this->addDependency("hdp-hbase::regionserver", SERVICE_STATE_UNINSTALLED, "hdp-zookeeper::client",
+ array("service_state" => SERVICE_STATE_UNINSTALLED));
+ $this->addDependency("hdp-hbase::regionserver", SERVICE_STATE_UNINSTALLED, "hdp-hadoop::client",
+ array("service_state" => SERVICE_STATE_UNINSTALLED));
+
//Oozie
$this->addDependency("hdp-oozie::server", SERVICE_STATE_INSTALLED_AND_CONFIGURED, "hdp-hadoop::client",
array("service_state" => SERVICE_STATE_INSTALLED_AND_CONFIGURED));
$this->addDependency("hdp-oozie::server", SERVICE_STATE_RUNNING, "hdp-hadoop::client",
array("service_state" => SERVICE_STATE_NO_OP));
+ $this->addDependency("hdp-oozie::server", SERVICE_STATE_UNINSTALLED, "hdp-hadoop::client",
+ array("service_state" => SERVICE_STATE_UNINSTALLED));
//Hive depends on Hcat
$this->addDependency("hdp-hive::server", SERVICE_STATE_INSTALLED_AND_CONFIGURED, "hdp-hcat",
array("service_state" => SERVICE_STATE_INSTALLED_AND_CONFIGURED));
$this->addDependency("hdp-hive::server", SERVICE_STATE_RUNNING, "hdp-hcat",
array("service_state" => SERVICE_STATE_NO_OP));
+ $this->addDependency("hdp-hive::server", SERVICE_STATE_UNINSTALLED, "hdp-hcat",
+ array("service_state" => SERVICE_STATE_UNINSTALLED));
+
$this->addDependency("hdp-hive::client", SERVICE_STATE_INSTALLED_AND_CONFIGURED, "hdp-hcat",
array("service_state" => SERVICE_STATE_INSTALLED_AND_CONFIGURED));
+ $this->addDependency("hdp-hive::client", SERVICE_STATE_UNINSTALLED, "hdp-hcat",
+ array("service_state" => SERVICE_STATE_UNINSTALLED));
//Hive Service Check
$this->addDependency("hdp-hive::hive::service_check", SERVICE_STATE_NOT_APPLICABLE,
@@ -77,10 +94,16 @@ class PuppetClassDependencies {
$this->addDependency("hdp-pig", SERVICE_STATE_INSTALLED_AND_CONFIGURED, "hdp-hadoop::client",
array("service_state" => SERVICE_STATE_INSTALLED_AND_CONFIGURED));
+ $this->addDependency("hdp-pig", SERVICE_STATE_UNINSTALLED, "hdp-hadoop::client",
+ array("service_state" => SERVICE_STATE_UNINSTALLED));
+
//Sqoop
$this->addDependency("hdp-sqoop", SERVICE_STATE_INSTALLED_AND_CONFIGURED, "hdp-hadoop::client",
array("service_state" => SERVICE_STATE_INSTALLED_AND_CONFIGURED));
+ $this->addDependency("hdp-sqoop", SERVICE_STATE_UNINSTALLED, "hdp-hadoop::client",
+ array("service_state" => SERVICE_STATE_UNINSTALLED));
+
//Templeton
$this->addDependency("hdp-templeton::server", SERVICE_STATE_INSTALLED_AND_CONFIGURED, "hdp-zookeeper::client",
array("service_state" => SERVICE_STATE_INSTALLED_AND_CONFIGURED));
@@ -100,6 +123,15 @@ class PuppetClassDependencies {
$this->addDependency("hdp-templeton::server", SERVICE_STATE_RUNNING, "hdp-hcat",
array("service_state" => SERVICE_STATE_NO_OP));
+ $this->addDependency("hdp-templeton::server", SERVICE_STATE_UNINSTALLED, "hdp-zookeeper::client",
+ array("service_state" => SERVICE_STATE_UNINSTALLED));
+ $this->addDependency("hdp-templeton::server", SERVICE_STATE_UNINSTALLED, "hdp-hadoop::client",
+ array("service_state" => SERVICE_STATE_UNINSTALLED));
+ $this->addDependency("hdp-templeton::server", SERVICE_STATE_UNINSTALLED, "hdp-pig",
+ array("service_state" => SERVICE_STATE_UNINSTALLED));
+ $this->addDependency("hdp-templeton::server", SERVICE_STATE_UNINSTALLED, "hdp-hcat",
+ array("service_state" => SERVICE_STATE_UNINSTALLED));
+
//Ganglia
$this->addDependency("hdp-ganglia::monitor", SERVICE_STATE_RUNNING, "hdp-ganglia::hdp-gmond::service_check", array());
$this->addDependency("hdp-ganglia::monitor_and_server", SERVICE_STATE_RUNNING, "hdp-ganglia::hdp-gmond::service_check", array());
@@ -121,6 +153,13 @@ class PuppetClassDependencies {
$this->addDependency("hdp-nagios::server", SERVICE_STATE_RUNNING, "hdp-hive::client",
array("service_state" => SERVICE_STATE_NO_OP));
+ $this->addDependency("hdp-nagios::server", SERVICE_STATE_UNINSTALLED, "hdp-oozie::client",
+ array("service_state" => SERVICE_STATE_UNINSTALLED));
+ $this->addDependency("hdp-nagios::server", SERVICE_STATE_UNINSTALLED, "hdp-hcat",
+ array("service_state" => SERVICE_STATE_UNINSTALLED));
+ $this->addDependency("hdp-nagios::server", SERVICE_STATE_UNINSTALLED, "hdp-hive::client",
+ array("service_state" => SERVICE_STATE_UNINSTALLED));
+
$this->addDependency("hdp-nagios::server", SERVICE_STATE_RUNNING, "hdp-nagios::nagios::service_check", array());
$this->addDependency("hdp-nagios::server", SERVICE_STATE_RUNNING, "hdp-monitor-webserver", array());
Modified: incubator/ambari/branches/ambari-186/hmc/php/puppet/genmanifest/generateManifest.php
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/ambari-186/hmc/php/puppet/genmanifest/generateManifest.php?rev=1347144&r1=1347143&r2=1347144&view=diff
==============================================================================
--- incubator/ambari/branches/ambari-186/hmc/php/puppet/genmanifest/generateManifest.php (original)
+++ incubator/ambari/branches/ambari-186/hmc/php/puppet/genmanifest/generateManifest.php Wed Jun 6 21:30:20 2012
@@ -41,10 +41,9 @@ include "RoleDependencies.php";
$serviceState);
foreach ($hostLevelDependencies as $depRole => $rstates) {
$roleList[] = $depRole;
- foreach ($rstates as $k => $v) {
- //Assuming no conflicting states
- $rolesStates[$depRole][$k] = $v;
- }
+ //The state could be conflicting, pick the appropriate state
+ //e.g. a dependency shows up with two different service states
+ ManifestGenerator::resolveDepRoleStates($depRole, $rstates, $rolesStates);
}
}
$roleList = array_unique($roleList);
@@ -67,7 +66,44 @@ include "RoleDependencies.php";
fclose($fh);
}
- static function optimizePackageInstall($node, &$manifestObj, $rolesStatesDs,
+ private static function priorityState($u, $v) {
+ $order = array (
+ SERVICE_STATE_NOT_APPLICABLE => 0,
+ SERVICE_STATE_UNINSTALLED => 1,
+ SERVICE_STATE_STOPPED => 2,
+ SERVICE_STATE_NO_OP => 3,
+ SERVICE_STATE_INSTALLED_AND_CONFIGURED => 4,
+ SERVICE_STATE_RUNNING => 5
+ );
+
+ if (!isset($v)) {
+ return $u;
+ } else if (!isset($u)) {
+ return $v;
+ } else if ($order[$u] > $order[$v]) {
+ return $u;
+ } else {
+ return $v;
+ }
+ }
+
+ private static function resolveDepRoleStates($depRole, $rstates, &$rolesStates) {
+ foreach ($rstates as $k => $v) {
+ if ($k == SERVICE_STATE_KEY) {
+ $alreadySetSvcState = NULL;
+ if (isset($rolesStates[$depRole][$k])) {
+ $alreadySetSvcState = $rolesStates[$depRole][$k];
+ }
+ $rolesStates[$depRole][$k] =
+ ManifestGenerator::priorityState($v, $alreadySetSvcState);
+ } else {
+ //Assume no conflicts for this key
+ $rolesStates[$depRole][$k] = $v;
+ }
+ }
+ }
+
+ private static function optimizePackageInstall($node, &$manifestObj, $rolesStatesDs,
$configInfo, $roleStages) {
//Figure out the state
$serviceState = SERVICE_STATE_INSTALLED_AND_CONFIGURED;
@@ -171,8 +207,8 @@ include "RoleDependencies.php";
"hdp-hadoop::client" => "hadoop hadoop-libhdfs.i386 hadoop-native.i386 hadoop-pipes.i386 hadoop-sbin.i386",
"hdp-hadoop::datanode" => "hadoop hadoop-libhdfs.i386 hadoop-native.i386 hadoop-pipes.i386 hadoop-sbin.i386",
"hdp-hadoop::tasktracker" => "hadoop hadoop-libhdfs.i386 hadoop-native.i386 hadoop-pipes.i386 hadoop-sbin.i386",
- "hdp-hadoop::zookeeper" => "zookeeper",
- "hdp-hadoop::zookeeper::client" => "zookeeper",
+ "hdp-zookeeper" => "zookeeper",
+ "hdp-zookeeper::client" => "zookeeper",
"hdp-hbase::master" => "hbase",
"hdp-hbase::regionserver" => "hbase",
"hdp-hbase::client" => "hbase",