Created on 03-14-2018 11:10 AM - edited 08-18-2019 02:28 AM
from ambari GUI when we look on the JournalNodes status we see that
JournalNodes | 3 / 3 |
its mean all JournalNodes are alive and status is OK
in case one of the JN is down then we need to see like this - JournalNode 2/3 ,
so my question is how to verify the Journal node by API or command
Example from ambari GUI
Created 03-14-2018 11:16 AM
In the other thread : https://community.hortonworks.com/questions/176682/api-via-script-how-to-verify-zkfailovercontroller...
If you just replace the ZKFC with JOURNALNODE then you should be able to find the same.
# 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\" \: \"JOURNALNODE\"" | 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 JOURNALNODE, amb25101.example.com, STARTED JOURNALNODE, amb25102.example.com, STARTED JOURNALNODE, amb25103.example.com,
.
Created 03-14-2018 11:16 AM
In the other thread : https://community.hortonworks.com/questions/176682/api-via-script-how-to-verify-zkfailovercontroller...
If you just replace the ZKFC with JOURNALNODE then you should be able to find the same.
# 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\" \: \"JOURNALNODE\"" | 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 JOURNALNODE, amb25101.example.com, STARTED JOURNALNODE, amb25102.example.com, STARTED JOURNALNODE, amb25103.example.com,
.