Created on 03-14-2018 10:59 AM - edited 08-18-2019 02:29 AM
we want to verify by API or any approach by script / command that ZKFailoverController is started ( status green from ambari GUI )
in our cluster ZKFailoverController is on master01 and master03 machines
so how to identify ZKFailoverController is started (green state ) on master01 and master03 machines ?
example from Ambari GUI
Created 03-14-2018 11:13 AM
You can try something like following:
# curl -u admin:admin -H "X-Requested-By: ambari" -X GET "http://amb25101.example.com:8080/api/v1/clusters/plain_ambari/components?fields=ServiceComponentInfo/service_name,ServiceComponentInfo/component_name,ServiceComponentInfo/state,host_components/HostRoles/host_name,host_components/HostRoles/state" | grep -A 2 "\"component_name\" \: \"ZKFC\"" | awk '{print $NF}' > /tmp/requests_details.txt; sed -e '1,2d' -e s'/--//g' -e 's/\n//g' -e 's/"//g' -e '/^$/d' /tmp/requests_details.txt | awk 'NR%3{printf "%s ",$0;next;}1'
.
Example Output:
STARTED ZKFC, amb25102.example.com, STARTED ZKFC, amb25103.example.com,
Created 03-14-2018 11:13 AM
You can try something like following:
# curl -u admin:admin -H "X-Requested-By: ambari" -X GET "http://amb25101.example.com:8080/api/v1/clusters/plain_ambari/components?fields=ServiceComponentInfo/service_name,ServiceComponentInfo/component_name,ServiceComponentInfo/state,host_components/HostRoles/host_name,host_components/HostRoles/state" | grep -A 2 "\"component_name\" \: \"ZKFC\"" | awk '{print $NF}' > /tmp/requests_details.txt; sed -e '1,2d' -e s'/--//g' -e 's/\n//g' -e 's/"//g' -e '/^$/d' /tmp/requests_details.txt | awk 'NR%3{printf "%s ",$0;next;}1'
.
Example Output:
STARTED ZKFC, amb25102.example.com, STARTED ZKFC, amb25103.example.com,