The following curl command gives the token (but uses the name node directly).
$ curl -s --negotiate -u : "http://<active-namenode-hostname>:50070/webhdfs/v1/?op=GETDELEGATIONTOKEN"
Is it possible to use dfs.nameservices property to get the token instead.
Unfortunately, this is not possible. You have to use the active Namenode or deploy Httpfs, which is used as a central webhdfs access point in a HDFS HA environment.
Regarding httpfs, see this https://community.hortonworks.com/articles/804/httpfs-configure-and-run-with-hdp-224x.html
View solution in original post