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.

Kafka Ambari alert configuration when not using port 6667

Solved Go to solution

Re: Kafka Ambari alert configuration when not using port 6667

Super Collaborator

Yes, that should also work. You'll want to PUT the entire JSON back, not just the 1 changed line.

How interesting - that seems like a bug that it's still using the older value on clean 2.4 installs.

Highlighted

Re: Kafka Ambari alert configuration when not using port 6667

New Contributor

even after I updated port number 6667.0 to 9092 and upload the alert.jason file still I see the port number is coming as Float(9092.0),I am using hdp2.3 and below are the json files before and after upload.

still I am abserving this alert in ambari:

Connection failed: [Errno 111] Connection refused to hostname:9092

before: updated port number 6667.0 to 9092 and updated uri from

"uri" : "{{kafka-broker/port}}" to "uri" : "{{kafka-broker/listeners}}"

{
  "AlertDefinition" : {
    "cluster_name" : "hdp",
    "component_name" : "KAFKA_BROKER",
    "description" : "This host-level alert is triggered if the Kafka Broker cannot be determined to be up.",
    "enabled" : true,
    "id" : 101,
    "ignore_host" : false,
    "interval" : 1,
    "label" : "Kafka Broker Process",
    "name" : "kafka_broker_process",
    "scope" : "HOST",
    "service_name" : "KAFKA",
    "source" : {
      "default_port" : 9092,
      "reporting" : {
        "critical" : {
          "value" : 5.0,
          "text" : "Connection failed: {0} to {1}:{2}"
        },
        "warning" : {
          "text" : "TCP OK - {0:.3f}s response on port {1}",
          "value" : 1.5
        },
        "ok" : {
          "text" : "TCP OK - {0:.3f}s response on port {1}"
        }
      },
      "type" : "PORT",
      "uri" : "{{kafka-broker/listeners}}"
    }
  }
}

after i upload this update json file using the below curl command:

curl -u admin:admin -H 'X-Requested-By: ambari' -X PUT "http://awedva3uttpm01.cloud.tiaa-cref.org:8080/api/v1/clusters/hdp/alert_definitions/101" -d @alerts.json

json file after upload:

here my questions is how can i send the port number as integer rather than float.

also checked Ambari logs here it is it doesnt complain about float data type:

05 Oct 2016 10:01:37,178 INFO [qtp-client-24] StackAdvisorRunner:71 - advisor script stderr: 05 Oct 2016 10:01:38,390 ERROR [qtp-client-1225] MetricsPropertyProvider:185 - Error getting timeline metrics. Can not connect to collector, socket error. 05 Oct 2016 10:01:38,740 ERROR [qtp-client-719] MetricsPropertyProvider:185 - Error getting timeline metrics. Can not connect to collector, socket error. 05 Oct 2016 10:01:51,248 INFO [qtp-client-24] PersistKeyValueService:82 - Looking for keyName time-range-service-KAFKA 05 Oct 2016 10:02:59,497 INFO [qtp-client-24] PersistKeyValueService:82 - Looking for keyName mainAlertInstancesController-pagination-displayLength-admin 05 Oct 2016 10:03:09,278 INFO [qtp-client-1225] PersistKeyValueService:82 - Looking for keyName mainHostAlertsController-pagination-displayLength-admin 05 Oct 2016 10:03:16,632 ERROR [qtp-client-23] MetricsPropertyProvider:185 - Error getting timeline metrics. Can not connect to collector, socket error. 05 Oct 2016 10:03:22,145 INFO [qtp-ambari-agent-1466] HeartBeatHandler:657 - State of service component METRICS_MONITOR of service AMBARI_METRICS of cluster hdp has changed from STARTED to INSTALLED at host awedva3uttpm02.cloud.tiaa-cref.org 05 Oct 2016 10:04:24,188 INFO [qtp-ambari-agent-1466] HeartBeatHandler:657 - State of service component METRICS_MONITOR of service AMBARI_METRICS of cluster hdp has changed from INSTALLED to STARTED at host awedva3uttpm02.cloud.tiaa-cref.org

{
  "href" : "http://awedva3uttpm01.cloud.tiaa-cref.org:8080/api/v1/clusters/hdp/alert_definitions/101",
  "AlertDefinition" : {
    "cluster_name" : "hdp",
    "component_name" : "KAFKA_BROKER",
    "description" : "This host-level alert is triggered if the Kafka Broker cannot be determined to be up.",
    "enabled" : true,
    "id" : 101,
    "ignore_host" : false,
    "interval" : 1,
    "label" : "Kafka Broker Process",
    "name" : "kafka_broker_process",
    "scope" : "HOST",
    "service_name" : "KAFKA",
    "source" : {
      "default_port" : 9092.0,
      "reporting" : {
        "critical" : {
          "value" : 5.0,
          "text" : "Connection failed: {0} to {1}:{2}"
        },
        "warning" : {
          "text" : "TCP OK - {0:.3f}s response on port {1}",
          "value" : 1.5
        },
        "ok" : {
          "text" : "TCP OK - {0:.3f}s response on port {1}"
        }
      },
      "type" : "PORT",
      "uri" : "{{kafka-broker/listeners}}"
    }
  }
}
Highlighted

Re: Kafka Ambari alert configuration when not using port 6667

New Contributor

I had to resolve this issue by removing KAFKA service and component from Ambari and adding again from Amabri Server and I have used below Curl commands to update API.

// Get service info

curl-uadmin:admin-H"X-Requested-by:ambari"-i-k-XGET http://<HOST>:8080/api/v1/clusters/<CLUSTER_NAME>/services/KAFKA

// Stop component KAFKA_BROKER

curl-uadmin:admin-H"X-Requested-by:ambari"-i-k-XPUT -d'{"ServiceComponentInfo": {"state": "INSTALLED"}}' http://<HOST>:8080/api/v1/clusters/<CLUSTER_NAME>/services/KNOX/components/KAFKA_BROKER

// Stop service KAFKA

curl-uadmin:admin-H"X-Requested-by:ambari"-i-k-XPUT -d'{"ServiceInfo": {"state": "INSTALLED"}}' http://<HOST>:8080/api/v1/clusters/<CLUSTER_NAME>/services/KAFKA

// Delete component

curl-uadmin:admin-H"X-Requested-by:ambari"-i-k-XDELETE http://<HOST>:8080/api/v1/clusters/<CLUSTER_NAME>/hosts/<HOST_FQDN>/host_components/KAFKA_BROKER

// Delete service

curl-uadmin:admin-H"X-Requested-by:ambari"-i-k-XDELETE http://<HOST>:8080/api/v1/clusters/<CLUSTER_NAME>/services/KAFKA

Thanks for all your help

Madhu

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