Ambari部署时问题之Ambari Metrics无法启动

时间:2023-01-15 20:30:21

  首先,我的问题是如下:

Ambari部署时问题之Ambari Metrics无法启动

Ambari部署时问题之Ambari Metrics无法启动

Traceback (most recent call last):
File "/var/lib/ambari-agent/cache/common-services/AMBARI_METRICS/0.1.0/package/scripts/service_check.py", line , in <module>
AMSServiceCheck().execute()
File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line , in execute
method(env)
File "/usr/lib/python2.6/site-packages/ambari_commons/os_family_impl.py", line , in thunk
return fn(*args, **kwargs)
File "/var/lib/ambari-agent/cache/common-services/AMBARI_METRICS/0.1.0/package/scripts/service_check.py", line , in service_check
raise Fail("Values %s and %s were not found in the response." % (random_value1, current_time))
resource_management.core.exceptions.Fail: Values 0.32072445008 and were not found in the response.

Ambari部署时问题之Ambari Metrics无法启动

  我这里采取的是先删除,再添加服务的方式。

Ambari里如何删除某指定的服务(图文详解)

解决办法

https://community.hortonworks.com/questions/15818/ambari-metrics-collector-now-starting.html

Ambari部署时问题之Ambari Metrics无法启动

I could finally solve it by combining some of the steps mentioned above.

I first checked what is the value of `zookeeper.znode.parent` in HBase. I tried setting that same value in Ambari, but that did not work because some of the metrics processes were already running on that machine. So, i had to `ps -ef | grep metrics` and kill all of them as they were caching the `/hbase` value.

Watch the ambari metrics collector logs ( /var/log/ambari-metrics-collector/ambari-metrics-collector.log) while you do the below steps

其实,说白了,以下就是如何删除Ambari中已有的服务!

步骤

  Steps:0.

tail -f /var/log/ambari-metrics-collector/ambari-metrics-collector.log  (这一也可以跳过,说白了就是查看对应的ambari-metrics-collector的日志而已)

       tail -f /var/log/ambari-metrics-collector/ambari-metrics-monitor.log  (这一也可以跳过,说白了就是查看对应的ambari-metrics-monitor的日志而已)

   Steps:1. Stop Ambari Metrics

   注意: 若是这步,关不掉Ambari  Metrics没事,去步骤三吧!

Ambari部署时问题之Ambari Metrics无法启动

  Steps 2:. Kill all the metrics processes

Ambari部署时问题之Ambari Metrics无法启动

ambari-metrics-monitor status
ambari-metrics-collector status

Ambari部署时问题之Ambari Metrics无法启动

ambari-metrics-monitor stop
ambari-metrics-collector stop
kill -9 26554 
kill -9 46277

Ambari部署时问题之Ambari Metrics无法启动

Steps:3 停止服务

curl -u admin:admin -H "X-Requested-By: ambari" -X PUT -d '{"RequestInfo": {"context":"Stop Service"},"Body":{"ServiceInfo":{"state":"INSTALLED"}}}' http://192.168.80.144:8080/api/v1/clusters/hdpCluster/services/AMBARI_METRICS

注意:

192.168.80.144是我这台机器ambari01(即搭建了ambari)的ip,你注意改为你自己的!

hdpCluster是我集群的名字,你注意改为你自己的!

AMBARI_METRICS这里是停止该服务并要从ambari里删除它。

Steps:4 删除服务(快速立即执行)

curl -u admin:admin -H "X-Requested-By: ambari" -X DELETE http://192.168.80.144:8080/api/v1/clusters/hdpCluster/services/AMBARI_METRICS

注意:

192.168.80.144是我这台机器ambari01(即搭建了ambari)的ip,你注意改为你自己的!

hdpCluster是我集群的名字,你注意改为你自己的!

AMBARI_METRICS这里是停止该服务并要从ambari里删除它。

Steps:4   Refresh Ambari UI

Ambari部署时问题之Ambari Metrics无法启动

Steps:5  Add Service

Ambari部署时问题之Ambari Metrics无法启动

Steps:6 . Select Ambari Metrics

Ambari部署时问题之Ambari Metrics无法启动

Ambari部署时问题之Ambari Metrics无法启动

Ambari部署时问题之Ambari Metrics无法启动

7. In the configuration screen, make sure to set the value of `zookeeper.znode.parent` to what is configured in the HBase service. By default in Ambari Metrics it is set to empty value.

8. Deploy

Ambari部署时问题之Ambari Metrics无法启动

Ambari部署时问题之Ambari Metrics无法启动

Ambari部署时问题之Ambari Metrics无法启动

Ambari部署时问题之Ambari Metrics无法启动

Ambari部署时问题之Ambari Metrics无法启动

Ambari部署时问题之Ambari Metrics无法启动

  如果依然,上述的方法做了之后,出现,如下的情况,继续解决:

Ambari安装之部署 (Metrics Collector和 Metrics Monitor) Install Pending ...问题

  最终是一定可以解决,Ambari Metrics无法启动的问题。