Support Questions

Find answers, ask questions, and share your expertise

how to verify JournalNodes status by API or command

avatar

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

64609-capture.png

Michael-Bronson
1 ACCEPTED SOLUTION

avatar
Master Mentor

@Michael Bronson

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,

.

View solution in original post

1 REPLY 1

avatar
Master Mentor

@Michael Bronson

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,

.