Regenerating Kerberos Keytabs from Ambari API
Short Description:
Describes ways to manually regenerate keytabs for services through Ambari REST API
Article
Make sure KDC credentials are added to Ambari credentials store. You can follow this Article to perform.
Once KDC credentials are added. You can use the below Ambari's REST API to regenerate keytabs.
curl -H "X-Requested-By:ambari" -u <Ambari_Admin_username>:<Amabri_Admin_password> -X PUT -d '{ "Clusters": { "security_type" : "KERBEROS" } }' http://<Ambari_HOST>:8080/api/v1/clusters/<Cluster_Name>/?regenerate_keytabs=all
Example :
curl -H "X-Requested-By:ambari" -u admin:admin -X PUT -d '{ "Clusters": { "security_type" : "KERBEROS" } }' http://172.26.108.142:8080/api/v1/clusters/vinod/?regenerate_keytabs=all&ignore_config_updates=true
Once the Keytabs are regenerated it requires Service restart to use the newly generated keytabs.

