首先,我的问题是如下:
Traceback (most recent call last): File "/var/lib/ambari-agent/cache/common-services/AMBARI_METRICS/0.1.0/package/scripts/service_check.py", line 165, in <module> AMSServiceCheck().execute() File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 219, in execute method(env) File "/usr/lib/python2.6/site-packages/ambari_commons/os_family_impl.py", line 89, 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 160, 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 1490951249000 were not found in the response.
我这里采取的是先删除,再添加服务的方式。
Ambari里如何删除某指定的服务(图文详解)
解决办法
https://community.hortonworks.com/questions/15818/ambari-metrics-collector-now-starting.html
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没事,去步骤三吧!
Steps 2:. Kill all the metrics processes
ambari-metrics-monitor status
ambari-metrics-collector status
ambari-metrics-monitor stop
ambari-metrics-collector stop
kill -9 26554
kill -9 46277
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
Steps:5 Add Service
Steps:6 . Select 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安装之部署 (Metrics Collector和 Metrics Monitor) Install Pending ...问题
最终是一定可以解决,Ambari Metrics无法启动的问题。