How to install ambari-shell
Please follow the steps below to install ambari-shell on your system -
Environment setup details -
Virtual Box : 5.0.14 OS : CentOS release 6.7 (64-bit) Ambari-shell code : https://github.com/sequenceiq/ambari-shell.git Gradle Version: gradle-1.12 [ https://services.gradle.org/distributions/gradle-2.11-all.zip ] Java Version: 1.7.0_79
Installation steps:
1.Login using root/superuser 2.Install "git" package using rpm/yum command
# yum install -y git
[Note: Make sure you have internet access to your system and /etc/yum.repos.d/CentOS-Base.repo in place unless you have local repository configured to download packages]
3.Download Gradle from the link given above and unzip it in a directory. Here i will download code in /opt directory
# cd /opt # wget https://services.gradle.org/distributions/gradle-2.11-all.zip # unzip
# cd /opt
# wget https://services.gradle.org/distributions/gradle-2.11-all.zip
# unzip gradle-2.11-all.zip
4. Export gradle home path
# export PATH=$PATH:/opt/gradle-2.11/bin
5. Make sure you have Java installed and set the JAVA_HOME variable in your path
[root@test opt]# rpm -qa |grep java-1.7.0
java-1.7.0-openjdk-1.7.0.79-2.5.5.4.el6.x86_64
#export JAVA_HOME=/usr/jdk64/jdk1.7.0_67/
Note: I have installed java in "/usr/jdk64". Please replace the path, where you have java installed.
6. Download "ambari-shell" code from git and compile the code using gradle -
# cd /opt/# git clone https://github.com/sequenceiq/ambari-shell.git
# cd /opt/ambari-shell
# gradle clean build
7. The above command will successfully compile ambari-shell code and you should be able to see sample output as shown below -
......
:processResources
:classes
:jar
:startScripts
:distTar
:distZip
:bootRepackage
:assemble
:compileTestJava
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
:processTestResources
:testClasses
:test
:check
:build
BUILD SUCCESSFUL
Total time: 32.558 secs
8. Once build is successful it will create a jar which will be located in below path -
[root@test ~]# ls /opt/ambari-shell/build/libs/
ambari-shell-0.1.DEV.jar ambari-shell-0.1.DEV.jar.original
9. After compiling the project, the shell is ready to use (make sure you use Java 7 or above).
# java -jar /opt/ambari-shell/build/libs/ambari-shell-0.1.DEV.jar --ambari.server=localhost --ambari.port=8080 --ambari.user=admin --ambari.password=admin
Below is sample output after executing above command -

10. Login to ambari-shell and try building your cluster. Please refer "https://github.com/sequenceiq/ambari-shell" for more details.

