首先,我的問題是如下:
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無法啟動的問題。