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 2014/01/16 16:06:53 UTC
[2/3] git commit: AMBARI-4314. API script for Storm and Falcon does
not allow multinode cluster testing (aonishuk)
AMBARI-4314. API script for Storm and Falcon does not allow multinode
cluster testing (aonishuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/0ecb08e4
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0ecb08e4
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0ecb08e4
Branch: refs/heads/trunk
Commit: 0ecb08e4c0cad254feae4518ee8eb5967de3a7a5
Parents: c4032cb
Author: Andrew Onischuk <ao...@hortonworks.com>
Authored: Thu Jan 16 06:55:01 2014 -0800
Committer: Andrew Onischuk <ao...@hortonworks.com>
Committed: Thu Jan 16 07:06:34 2014 -0800
----------------------------------------------------------------------
.../main/resources/scripts/add_service_api.py | 21 +++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/0ecb08e4/ambari-server/src/main/resources/scripts/add_service_api.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/scripts/add_service_api.py b/ambari-server/src/main/resources/scripts/add_service_api.py
index 4f06718..65faee7 100644
--- a/ambari-server/src/main/resources/scripts/add_service_api.py
+++ b/ambari-server/src/main/resources/scripts/add_service_api.py
@@ -34,11 +34,12 @@ COMPONENTS = [
"SUPERVISOR"
]
-COMPONENTS_TO_HOSTS = {
- "NIMBUS": HOSTNAME,
- "SUPERVISOR": HOSTNAME,
- #"SUPERVISOR": "dev01.hortonworks.com"
-}
+COMPONENTS_TO_HOSTS = [
+ {"NIMBUS": HOSTNAME},
+ {"SUPERVISOR": HOSTNAME},
+ #{"SUPERVISOR": "c6402.ambari.apache.org"},
+ #{"SUPERVISOR": "c6403.ambari.apache.org"}
+]
PROTOCOL = "http"
PORT = "8080"
@@ -48,7 +49,8 @@ STACK_VERSION = "2.0.8"
CONFIGS_TO_CHANGE = {
"storm-site":{
- "nimbus.host":HOSTNAME
+ #"storm.zookeeper.servers":"['c6401.amabri.apache.org','c6402.amabri.apache.org','c6403.amabri.apache.org']",
+ #"nimbus.host": "c6401.ambari.apache.org"
},
#"global":{
# "clientPort":"2182"
@@ -68,9 +70,10 @@ def main():
checked_call('curl -H \'X-Requested-By:anything\' -i -X POST -d \'{{"components":[{{"ServiceComponentInfo":{{"component_name":"{component}"}}}}]}}\' -u admin:admin {server_url}/api/v1/clusters/{cluster_name}/services?ServiceInfo/service_name={service_name}'.
format(service_name=SERVICE_NAME, component=component, server_url=SERVER_URL, cluster_name=CLUSTER_NAME))
- # assign components to hosts
- for component, host in COMPONENTS_TO_HOSTS.iteritems():
- checked_call('curl -H \'X-Requested-By:anything\' -i -X POST -d \'{{"host_components":[{{"HostRoles":{{"component_name":"{component}"}}}}]}}\' -u admin:admin {server_url}/api/v1/clusters/{cluster_name}/hosts?Hosts/host_name={host}'.
+ # assign components to hosts
+ for x in COMPONENTS_TO_HOSTS:
+ for component, host in x.iteritems():
+ checked_call('curl -H \'X-Requested-By:anything\' -i -X POST -d \'{{"host_components":[{{"HostRoles":{{"component_name":"{component}"}}}}]}}\' -u admin:admin {server_url}/api/v1/clusters/{cluster_name}/hosts?Hosts/host_name={host}'.
format(host=host, component=component, server_url=SERVER_URL, cluster_name=CLUSTER_NAME))
# update and create all the service-specific configurations