Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

grafana install

grafana install

Expert Contributor

Trouble adding Grafana

[ambari@lxhdpmastinf001 ~]$ curl -u admin:admin -H "X-Requested-By:ambari" -i -X POST http://localhost:8080/api/v1/clusters/HDPINF/servces/AMBARI_METRICS/components/METRICS_GRAFANA HTTP/1.1 409 Conflict X-Frame-Options: DENY X-XSS-Protection: 1; mode=block Set-Cookie: AMBARISESSIONID=scyj3uu5keq7j0dmokk1yd0;Path=/;HttpOnly Expires: Thu, 01 Jan 1970 00:00:00 GMT User: admin Content-Type: text/plain Content-Length: 236 Server: Jetty(8.1.19.v20160209) { "status" : 409, "message" : "Attempted to create one or more components which already exist:[clusterName=HDPINF, serviceName=AMBARI_METRICS, componentName=HDPINF, desiredState=null, recoveryEnabled=null, componentCategory=null]" }[ambari@llocalhost ~]$

1 REPLY 1
Highlighted

Re: grafana install

Guru

@Raja Sekhar Chintalapati, You are getting this error because it might be already added to your server. I also faced same issue and later I checked that it is already added.

[root@m1 ~]# curl -u admin:admin -H "X-Requested-By:ambari" -i -X POST -d '{"host_components":[{"HostRoles":{"component_name":"METRICS_GRAFANA"}}]}' http://192.168.56.41:8080/api/v1/clusters/hdp22/host?Hosts/host_name=w3.hdp22

HTTP/1.1 201 Created

X-Frame-Options: DENY

X-XSS-Protection: 1; mode=block

Set-Cookie: AMBARISESSIONID=4lhu16caqgqw4ovygjkxjxq4;Path=/;HttpOnly

Expires: Thu, 01 Jan 1970 00:00:00 GMT

User: admin

Content-Type: text/plain

Content-Length: 0

Server: Jetty(8.1.19.v20160209)

[root@m1 ~]# curl -u admin:admin -H "X-Requested-By:ambari" -i -X POST -d '{"host_components":[{"HostRoles":{"component_name":"METRICS_GRAFANA"}}]}' http://192.168.56.41:8080/api/v1/clusters/hdp22/hosts?Hosts/host_name=w3.hdp22

HTTP/1.1 409 Conflict

X-Frame-Options: DENY

X-XSS-Protection: 1; mode=block

Set-Cookie: AMBARISESSIONID=ng5zfui170vxt682hkfxgfob;Path=/;HttpOnly

Expires: Thu, 01 Jan 1970 00:00:00 GMT

User: admin

Content-Type: text/plain

Content-Length: 238

Server: Jetty(8.1.19.v20160209)

{

"status" : 409,

"message" : "org.apache.ambari.server.controller.spi.ResourceAlreadyExistsException: Attempted to create a host_component which already exists: [clusterName=hdp22, hostName=w3.hdp22, componentName=METRICS_GRAFANA]"

You can check it by running following command.

[root@m1 resources]# curl -u admin:admin -H "X-Requested-By: ambari" -X GET http://m1.hdp22:8080/api/v1/clusters/hdp22/services/AMBARI_METRICS

{

"href" : "http://m1.hdp22:8080/api/v1/clusters/hdp22/services/AMBARI_METRICS",

"ServiceInfo" : {

"cluster_name" : "hdp22",

"maintenance_state" : "OFF",

"service_name" : "AMBARI_METRICS",

"state" : "STARTED"

},

"alerts_summary" : {

"CRITICAL" : 0,

"MAINTENANCE" : 0,

"OK" : 10,

"UNKNOWN" : 0,

"WARNING" : 0

},

"alerts" : [

{

"href" : "http://m1.hdp22:8080/api/v1/clusters/hdp22/services/AMBARI_METRICS/alerts/204",

"Alert" : {

"cluster_name" : "hdp22",

"definition_id" : 156,

"definition_name" : "ams_metrics_monitor_process",

"host_name" : "m2.hdp22",

"id" : 204,

"service_name" : "AMBARI_METRICS"

}

},

{

"href" : "http://m1.hdp22:8080/api/v1/clusters/hdp22/services/AMBARI_METRICS/alerts/205",

"Alert" : {

"cluster_name" : "hdp22",

"definition_id" : 153,

"definition_name" : "metrics_monitor_process_percent",

"host_name" : null,

"id" : 205,

"service_name" : "AMBARI_METRICS"

}

},

{

"href" : "http://m1.hdp22:8080/api/v1/clusters/hdp22/services/AMBARI_METRICS/alerts/207",

"Alert" : {

"cluster_name" : "hdp22",

"definition_id" : 156,

"definition_name" : "ams_metrics_monitor_process",

"host_name" : "m1.hdp22",

"id" : 207,

"service_name" : "AMBARI_METRICS"

}

},

{

"href" : "http://m1.hdp22:8080/api/v1/clusters/hdp22/services/AMBARI_METRICS/alerts/208",

"Alert" : {

"cluster_name" : "hdp22",

"definition_id" : 156,

"definition_name" : "ams_metrics_monitor_process",

"host_name" : "w1.hdp22",

"id" : 208,

"service_name" : "AMBARI_METRICS"

}

},

{

"href" : "http://m1.hdp22:8080/api/v1/clusters/hdp22/services/AMBARI_METRICS/alerts/214",

"Alert" : {

"cluster_name" : "hdp22",

"definition_id" : 156,

"definition_name" : "ams_metrics_monitor_process",

"host_name" : "w2.hdp22",

"id" : 214,

"service_name" : "AMBARI_METRICS"

}

},

{

"href" : "http://m1.hdp22:8080/api/v1/clusters/hdp22/services/AMBARI_METRICS/alerts/409",

"Alert" : {

"cluster_name" : "hdp22",

"definition_id" : 159,

"definition_name" : "ams_metrics_collector_hbase_master_process",

"host_name" : "w2.hdp22",

"id" : 409,

"service_name" : "AMBARI_METRICS"

}

},

{

"href" : "http://m1.hdp22:8080/api/v1/clusters/hdp22/services/AMBARI_METRICS/alerts/410",

"Alert" : {

"cluster_name" : "hdp22",

"definition_id" : 158,

"definition_name" : "ams_metrics_collector_autostart",

"host_name" : "w2.hdp22",

"id" : 410,

"service_name" : "AMBARI_METRICS"

}

},

{

"href" : "http://m1.hdp22:8080/api/v1/clusters/hdp22/services/AMBARI_METRICS/alerts/411",

"Alert" : {

"cluster_name" : "hdp22",

"definition_id" : 154,

"definition_name" : "ams_metrics_collector_hbase_master_cpu",

"host_name" : "w2.hdp22",

"id" : 411,

"service_name" : "AMBARI_METRICS"

}

},

{

"href" : "http://m1.hdp22:8080/api/v1/clusters/hdp22/services/AMBARI_METRICS/alerts/625",

"Alert" : {

"cluster_name" : "hdp22",

"definition_id" : 156,

"definition_name" : "ams_metrics_monitor_process",

"host_name" : "w3.hdp22",

"id" : 625,

"service_name" : "AMBARI_METRICS"

}

},

{

"href" : "http://m1.hdp22:8080/api/v1/clusters/hdp22/services/AMBARI_METRICS/alerts/655",

"Alert" : {

"cluster_name" : "hdp22",

"definition_id" : 666,

"definition_name" : "grafana_webui",

"host_name" : "w3.hdp22",

"id" : 655,

"service_name" : "AMBARI_METRICS"

}

}

],

"components" : [

{

"href" : "http://m1.hdp22:8080/api/v1/clusters/hdp22/services/AMBARI_METRICS/components/METRICS_COLLECTOR",

"ServiceComponentInfo" : {

"cluster_name" : "hdp22",

"component_name" : "METRICS_COLLECTOR",

"service_name" : "AMBARI_METRICS"

}

},

{

"href" : "http://m1.hdp22:8080/api/v1/clusters/hdp22/services/AMBARI_METRICS/components/METRICS_GRAFANA",

"ServiceComponentInfo" : {

"cluster_name" : "hdp22",

"component_name" : "METRICS_GRAFANA",

"service_name" : "AMBARI_METRICS"

}

},

{

"href" : "http://m1.hdp22:8080/api/v1/clusters/hdp22/services/AMBARI_METRICS/components/METRICS_MONITOR",

"ServiceComponentInfo" : {

"cluster_name" : "hdp22",

"component_name" : "METRICS_MONITOR",

"service_name" : "AMBARI_METRICS"

}

}

],

"artifacts" : [ ]

}

Don't have an account?
Coming from Hortonworks? Activate your account here