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 2017/10/31 13:02:13 UTC
ambari git commit: Revert "AMBARI-22336. Alerts UPDATE/DELETE should
work deleting and adding a cluster (aonishuk)"
Repository: ambari
Updated Branches:
refs/heads/branch-3.0-perf 05c5bf798 -> 442509a80
Revert "AMBARI-22336. Alerts UPDATE/DELETE should work deleting and adding a cluster (aonishuk)"
This reverts commit 05c5bf798c2b69d41f3ddfa340cffc7c447ea9fb.
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/442509a8
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/442509a8
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/442509a8
Branch: refs/heads/branch-3.0-perf
Commit: 442509a80204b9d48c87a6e095dc3155aa3e140d
Parents: 05c5bf7
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Tue Oct 31 15:01:43 2017 +0200
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Tue Oct 31 15:01:43 2017 +0200
----------------------------------------------------------------------
.../ClusterAlertDefinitionsCache.py | 22 --------------------
.../ambari/server/stack/StackManager.java | 2 +-
.../apache/ambari/server/state/ServiceInfo.java | 2 +-
.../custom_actions/scripts/check_host.py | 1 -
.../stacks/PERF/1.0/repos/repoinfo.xml | 1 -
.../stacks/PERF/2.0/repos/repoinfo.xml | 1 -
contrib/utils/perf/deploy-gce-perf-cluster.py | 16 ++++++++------
7 files changed, 12 insertions(+), 33 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/442509a8/ambari-agent/src/main/python/ambari_agent/ClusterAlertDefinitionsCache.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/ClusterAlertDefinitionsCache.py b/ambari-agent/src/main/python/ambari_agent/ClusterAlertDefinitionsCache.py
index e2ed4cf..914f453 100644
--- a/ambari-agent/src/main/python/ambari_agent/ClusterAlertDefinitionsCache.py
+++ b/ambari-agent/src/main/python/ambari_agent/ClusterAlertDefinitionsCache.py
@@ -39,9 +39,6 @@ limitations under the License.
"""
from ambari_agent.ClusterCache import ClusterCache
-import logging
-
-logger = logging.getLogger(__name__)
class ClusterAlertDefinitionsCache(ClusterCache):
"""
@@ -73,11 +70,6 @@ class ClusterAlertDefinitionsCache(ClusterCache):
mutable_dict = self._get_mutable_copy()
for cluster_id in cache_update:
- # adding a new cluster via UPDATE
- if not cluster_id in mutable_dict:
- mutable_dict[cluster_id] = cache_update[cluster_id]
- continue
-
for alert_definition in cache_update[cluster_id]['alertDefinitions']:
id_to_update = alert_definition['definitionId']
index_of_alert = self.get_alert_definition_index_by_id(mutable_dict, cluster_id, id_to_update)
@@ -90,20 +82,9 @@ class ClusterAlertDefinitionsCache(ClusterCache):
def cache_delete(self, cache_update, cache_hash):
mutable_dict = self._get_mutable_copy()
- clusters_ids_to_delete = []
for cluster_id in cache_update:
- if not cluster_id in mutable_dict:
- logger.error("Cannot do alert_definitions delete for cluster cluster_id={0}, because do not have information about the cluster".format(cluster_id))
- continue
-
- # deleting whole cluster
- if cache_update[cluster_id] == {}:
- clusters_ids_to_delete.append(cluster_id)
- continue
-
for alert_definition in cache_update[cluster_id]['alertDefinitions']:
-
id_to_update = alert_definition['definitionId']
index_of_alert = self.get_alert_definition_index_by_id(mutable_dict, cluster_id, id_to_update)
@@ -112,9 +93,6 @@ class ClusterAlertDefinitionsCache(ClusterCache):
del mutable_dict[cluster_id]['alertDefinitions'][index_of_alert]
- for cluster_id in clusters_ids_to_delete:
- del mutable_dict[cluster_id]
-
self.rewrite_cache(mutable_dict, cache_hash)
http://git-wip-us.apache.org/repos/asf/ambari/blob/442509a8/ambari-server/src/main/java/org/apache/ambari/server/stack/StackManager.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/StackManager.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/StackManager.java
index 239d9cf..eb6737a 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/stack/StackManager.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/StackManager.java
@@ -81,7 +81,7 @@ public class StackManager {
/**
* Prefix used for common stack hooks parent path string
*/
- public static final String DEFAULT_HOOKS_FOLDER = "stacks/PERF/1.0/hooks";
+ public static final String DEFAULT_HOOKS_FOLDER = "stack-hooks";
/**
* Prefix used for extension services parent path string
http://git-wip-us.apache.org/repos/asf/ambari/blob/442509a8/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceInfo.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceInfo.java b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceInfo.java
index eb45572..8fe6583 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceInfo.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceInfo.java
@@ -87,7 +87,7 @@ public class ServiceInfo implements Validable{
JAVA
}
@XmlElement(name="service_advisor_type")
- private ServiceAdvisorType serviceAdvisorType = ServiceAdvisorType.PYTHON;
+ private ServiceAdvisorType serviceAdvisorType = null;
@XmlTransient
private List<PropertyInfo> properties;
http://git-wip-us.apache.org/repos/asf/ambari/blob/442509a8/ambari-server/src/main/resources/custom_actions/scripts/check_host.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/custom_actions/scripts/check_host.py b/ambari-server/src/main/resources/custom_actions/scripts/check_host.py
index 0ccbd88..e610307 100644
--- a/ambari-server/src/main/resources/custom_actions/scripts/check_host.py
+++ b/ambari-server/src/main/resources/custom_actions/scripts/check_host.py
@@ -116,7 +116,6 @@ class CheckHost(Script):
self.pkg_provider = get_provider("Package")
def actionexecute(self, env):
- raise Exception("Skip")
Logger.info("Host checks started.")
config = Script.get_config()
tmp_dir = Script.get_tmp_dir()
http://git-wip-us.apache.org/repos/asf/ambari/blob/442509a8/ambari-server/src/main/resources/stacks/PERF/1.0/repos/repoinfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/repos/repoinfo.xml b/ambari-server/src/main/resources/stacks/PERF/1.0/repos/repoinfo.xml
old mode 100755
new mode 100644
index 3801e0c..0895fab
--- a/ambari-server/src/main/resources/stacks/PERF/1.0/repos/repoinfo.xml
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/repos/repoinfo.xml
@@ -16,7 +16,6 @@
limitations under the License.
-->
<reposinfo>
- <latest>/var/lib/ambari-server/resources/stacks/PERF/1.0/hdp_urlinfo.json</latest>
<os family="redhat6">
<repo>
<baseurl>http://foo-1.0.1.0-1</baseurl>
http://git-wip-us.apache.org/repos/asf/ambari/blob/442509a8/ambari-server/src/main/resources/stacks/PERF/2.0/repos/repoinfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/2.0/repos/repoinfo.xml b/ambari-server/src/main/resources/stacks/PERF/2.0/repos/repoinfo.xml
old mode 100755
new mode 100644
index 3bb0235..5c3b40b
--- a/ambari-server/src/main/resources/stacks/PERF/2.0/repos/repoinfo.xml
+++ b/ambari-server/src/main/resources/stacks/PERF/2.0/repos/repoinfo.xml
@@ -16,7 +16,6 @@
limitations under the License.
-->
<reposinfo>
- <latest>/var/lib/ambari-server/resources/stacks/PERF/2.0/hdp_urlinfo.json</latest>
<os family="redhat6">
<repo>
<baseurl>http://foo-2.0.0.0-1</baseurl>
http://git-wip-us.apache.org/repos/asf/ambari/blob/442509a8/contrib/utils/perf/deploy-gce-perf-cluster.py
----------------------------------------------------------------------
diff --git a/contrib/utils/perf/deploy-gce-perf-cluster.py b/contrib/utils/perf/deploy-gce-perf-cluster.py
index 69aabe3..7431ae9 100644
--- a/contrib/utils/perf/deploy-gce-perf-cluster.py
+++ b/contrib/utils/perf/deploy-gce-perf-cluster.py
@@ -28,12 +28,12 @@ import re
import socket
cluster_prefix = "perf"
-ambari_repo_file_url = "http://10.240.0.30/ambari.repo"
+ambari_repo_file_url = "http://s3.amazonaws.com/dev.hortonworks.com/ambari/centos6/2.x/updates/2.5.0.0/ambaribn.repo"
public_hostname_script = "foo"
hostname_script = "foo"
-NUMBER_OF_AGENTS_ON_HOST = 70
+NUMBER_OF_AGENTS_ON_HOST = 50
class SSH:
@@ -330,7 +330,10 @@ def create_server_script(server_host_name):
contents = "#!/bin/bash\n" + \
"wget -O /etc/yum.repos.d/ambari.repo {0}\n".format(ambari_repo_file_url) + \
- "yum clean all; yum install ambari-server -y\n" + \
+ "yum clean all; yum install git ambari-server -y\n" + \
+ "mkdir /home ; cd /home ; git clone https://github.com/apache/ambari.git ; cd ambari ; git checkout branch-2.5\n" + \
+ "cp -r /home/ambari/ambari-server/src/main/resources/stacks/PERF /var/lib/ambari-server/resources/stacks/PERF\n" + \
+ "cp -r /home/ambari/ambari-server/src/main/resources/stacks/PERF /var/lib/ambari-agent/cache/stacks/PERF\n" + \
"sed -i -f /home/ambari/ambari-server/src/main/resources/stacks/PERF/install_packages.sed /var/lib/ambari-server/resources/custom_actions/scripts/install_packages.py\n" + \
"sed -i -f /home/ambari/ambari-server/src/main/resources/stacks/PERF/install_packages.sed /var/lib/ambari-agent/cache/custom_actions/scripts/install_packages.py\n" + \
"\n" + \
@@ -396,11 +399,13 @@ def create_agent_script(server_host_name):
# TODO, instead of cloning Ambari repo on each VM, do it on the server once and distribute to all of the agents.
contents = "#!/bin/bash\n" + \
"wget -O /etc/yum.repos.d/ambari.repo {0}\n".format(ambari_repo_file_url) + \
- "yum clean all; yum install krb5-workstation ambari-agent -y\n" + \
+ "yum clean all; yum install krb5-workstation git ambari-agent -y\n" + \
+ "mkdir /home ; cd /home; git clone https://github.com/apache/ambari.git ; cd ambari ; git checkout branch-2.5\n" + \
+ "cp -r /home/ambari/ambari-server/src/main/resources/stacks/PERF /var/lib/ambari-agent/cache/stacks/PERF\n" + \
"sed -i -f /var/lib/ambari-agent/cache/stacks/PERF/PythonExecutor.sed /usr/lib/python2.6/site-packages/ambari_agent/PythonExecutor.py\n" + \
"sed -i -e 's/hostname=localhost/hostname={0}/g' /etc/ambari-agent/conf/ambari-agent.ini\n".format(server_host_name) + \
"sed -i -e 's/agent]/agent]\\nhostname_script={0}\\npublic_hostname_script={1}\\n/1' /etc/ambari-agent/conf/ambari-agent.ini\n".format(hostname_script, public_hostname_script) + \
- "wget http://10.240.0.30/agent-multiplier.py ; python agent-multiplier.py start\n" + \
+ "python /home/ambari/ambari-agent/conf/unix/agent-multiplier.py start\n" + \
"exit 0"
with open("agent.sh", "w") as f:
@@ -424,7 +429,6 @@ def execute_command(args, ip, cmd, fail_message, custom_option='', login='root')
if status_code != 0:
raise Exception(ssh_result["errormsg"])
- print ssh_result
return ssh_result["log"][0]