Ambari Shell is an interactive command line tool to administrate Ambari manged HDP clusters. It supports all available functionality provided by the UI of the Ambari web application. Written as a Java application based on a Groovy REST client it further provides tab completion and a context aware commands. In a previous post we already discussed various contexts like service and state will using REST calls to alter them. Ambari Shell is a convenient tool for managing most of the complex aspects discussed there.
With that it can also be used for automated cluster installs based on Ambari Blueprints. While it is fairly simple to use two curl request to do a blueprint based install, Ambari Shell gives the advantage of monitoring the process. In scripted setups and with the use of provisioning tools like Puppet, Chef, or Ansible it gives the possibility to time setup steps after a complete cluster install. Executing a cluster install with –exitOnFinish true will halt the execution of the script until the install has finished.
An example of this is used as part of this Dockerfile where a parameterized script install_cluster.sh. The below example is being used as part of a Puppet install triggered with Vagrant:
#!/bin/bash blueprint_name=$1 java -jar /vagrant/bin/ambari-shell.jar --ambari.host=one.hdp << EOF blueprint add --file /vagrant/blueprints/${blueprint_name}/blueprint.json cluster build --blueprint ${blueprint_name} cluster assign --hostGroup node_1 --host one.hdp cluster create --exitOnFinish true EOF sleep 60
there are puppet inside ambari
LikeLike