hi All,
Please find attached a simple shell script to dynamically determine the
active namenode in the HA Cluster and subsequently run the Hive job / query
via Talend OS generated workflows.

It was tried successfully on a HDP2.1 cluster with 2 nn, 7 dn running on
CentOS 6.5.
Each ETL job invokes this script first in our framework to derive the NN
FQDN and then run the hive jobs subsequently to avoid failures.
Takes a max. of 2 secs to execute (small cost in our case, as compared to
dealing with a failure and then recalculating the NN to resubmit the job).

Sharing it with you in case you can leverage the same without spending
effort to code it.

Do share your feedback/ fixes if you spot any.

-- 
Devopam Mittra
Life and Relations are not binary

Attachment: findActiveNameNode.sh
Description: Bourne shell script

Reply via email to