My requirements:
I want to check the status of master so that my batches can adapt to changes of master automatically, then I will change the environment variable and restart the job.
However, when I try to use
hdfs haadmin -getServiceState nn1
to get the status, I was told:
Operation failed: Access denied for user xxx. Superuser privilege is required
Do I have other ways to get the status of master?