incubator-ambari-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbuy0710 <juby0...@gmail.com>
Subject Re: Add service to stack and cluster fail
Date Wed, 29 May 2013 02:30:25 GMT
Hi,

There are two scenarios.
1.
Adding a new service which is already in stack like NAGIOS,ZOOKEEPER,...etc.
2.
adding a new service which is not defined before into stack.
===========================================
For scenario 1 , I try to add NAGIOS into cluster by api , and the
following is the commands:

curl -u admin:admin -i -X POST -d '{"ServiceInfo":
{"service_name":"NAGIOS"}}'
http://10.1.191.20:8080/api/v1/clusters/ambari5f/services

curl -u admin:admin -i -X POST
http://10.1.191.20:8080/api/v1/clusters/ambari5f/services/NAGIOS/components/NAGIOS_SERVER

curl -u admin:admin -i -X POST -d '{"type": "nagios", "tag": "v1",
"properties" : { "nagios_web_password" : "admin","nagios_contact" :
"admin@admin.admin","nagios_group" : "nagios","nagios_web_login" :
"nagiosadmin","nagios_user" : "nagios"}}'
http://10.1.191.20:8080/api/v1/clusters/ambari5f/configurations

curl -u admin:admin -i -X PUT -d '{"config": {"nagios": "v1" }}'
http://10.1.191.20:8080/api/v1/clusters/ambari5f/services/NAGIOS

curl -u admin:admin -i -X POST -d '{"host_components" :
[{"HostRoles":{"component_name":"NAGIOS_SERVER"}}]}'
http://10.1.191.20:8080/api/v1/clusters/ambari5f/hosts?Hosts/host_name=ambariserver.ambari

curl -u admin:admin -i -X PUT -d '{"ServiceInfo": {"state" : "INSTALLED"}}'
http://10.1.191.20:8080/api/v1/clusters/ambari5f/services/NAGIOS

curl -u admin:admin -i -X PUT -d '{"ServiceInfo": {"state" : "STARTED"}}'
http://10.1.191.20:8080/api/v1/clusters/ambari5f/services/NAGIOS


After these steps , NAGIOS service is installed and started , but the web
page Services -> Nagios -> Configs  is empty.

If I install NAGIOS by install wizard , this page will contain some
information like "Nagios Admin password".

I also try to install other services like ZOOKEEPER , the config page may
have some information but not complete.

==============================================

For Scenario 2 , I think I found the root cause.

After creating the new service directory with its metainfo.xml , you have
to restart the ambari-server service by execute "ambari-server restart".

After I restart the service , I can add the service into Cluster.


Best Regards

Mime
View raw message