To change the master key:
If you know the current master key or if the current master key has been persisted:
Re-run the encryption setup command and follow the prompts.
ambari-server setup-security
Select 4 for Encrypt passwords stored in ambari.properties file.
Enter the current master key when prompted if necessary (if it is not persisted or set as an environment variable).
At the Do you want to reset Master Key prompt, enter yes.
At the prompt, enter the new master key and confirm.
If you do not know the current master key: