Created 02-21-2017 01:37 AM
Encrypting passwords. I'm trying to install hdp via blueprints (with kerberos). I need to call ambari-server setup-security then option #2 (pass/pass). Is there a way to script this? I'm doing this so i can pass PERSISTED for kerberos cred
Created 02-22-2017 10:35 PM
Unfortunately I'm not able to upgrade. Somewhat of a hack, but i put together an 'expect' script. In case someone else is stuck in similar situation. 🙂
#!/usr/bin/env expect spawn ambari-server setup-security sleep 0.5 set timeout 3 expect { "*Choose one of the following options:*" { send "2\r" } timeout } expect { -re "Please provide master key for locking the credential store:" { send "dev\r" } timeout } expect { -re "Re-enter master key:" { send "dev\r" } timeout } expect { "Do you want to persist master key.*" { send "y\r" } } expect eof
This is obviously not great, but does work given no other option ...
Created 02-21-2017 11:10 PM
Has anyone been able to automate ambari-server commands ? e.g. ssl / encryption setup etc.
Created 02-22-2017 03:34 AM
If you are using Ambari 2.4 then you can use the automated way to setup security as mentioned in:
https://issues.apache.org/jira/browse/AMBARI-14627
Example:
ambari-server setup-security --security-option=encrypt-passwords --master-key=masterkey --master-key-persist=true
.
Created 02-22-2017 04:20 AM
Thanks for the response. we are actually stuck on 2.2.x
Created 02-22-2017 04:25 AM
Unfortunately this feature is available since Ambari 2.4 onwards. Is there any possibility for you to try upgrading to ambari 2.4 it has lots of improvements in terms of Views, also has a lots of bug fixes and new features to make things more easy. Upgrading to ambari 2.4 will be quite easy though.
Created 02-22-2017 04:04 AM
I have written a very simple article on this feature for enabling HTTPs you can refer to the same as well:
- I would suggest you to use the "ambari-server --help" to get more information about those arguments, there might be slight changes in the argument names.
Created 02-22-2017 10:35 PM
Unfortunately I'm not able to upgrade. Somewhat of a hack, but i put together an 'expect' script. In case someone else is stuck in similar situation. 🙂
#!/usr/bin/env expect spawn ambari-server setup-security sleep 0.5 set timeout 3 expect { "*Choose one of the following options:*" { send "2\r" } timeout } expect { -re "Please provide master key for locking the credential store:" { send "dev\r" } timeout } expect { -re "Re-enter master key:" { send "dev\r" } timeout } expect { "Do you want to persist master key.*" { send "y\r" } } expect eof
This is obviously not great, but does work given no other option ...