Community Articles

Find and share helpful community-sourced technical articles.
Labels (1)
avatar
Super Guru

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 -

2226-screen-shot-2016-02-17-at-34308-pm.png

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

9,666 Views
Comments
avatar
Master Guru

Nice one!

avatar
Master Guru

@Sagar Shimpi, nice article! Are there any prebuilt jars (or rpm/tar's) ready to be installed? There are many places where I cannot install git and gradle, but could show up Ambari shell as a kind of "coming soon" add-on for Ambari. Tnx.

avatar
Super Guru

I see that there are no ready jars available on internet for ambari shell. But what the best way we can do is to build/compile the ambari-shell code on our test/local environment and use the jar directly at other places. You do no need to compile it everytime.

Ever i can pass you the jar on email and you can directly test with below command in your environment...Just need to ensure the OS and java version should be same.

# 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

avatar
Explorer

use --ambari.host and not --ambari.server

I have merged the outstanding pull requests from the sequenceiq repo into mine.

Check it out here: https://github.com/philippeback/ambari-shell

avatar
Explorer

There is a latest-snap.sh file in the repo. Running it will fetch a version.

avatar
Explorer

@sshimpi I am getting this failure error when I do gradle clean build :

 

 

The 'sonar-runner' plugin has been deprecated and is scheduled to be removed in Gradle 3.0. please use the official plugin from SonarQube (http://docs.sonarqube.org/display/SONAR/Analyzing+with+Gradle). :clean :buildInfo :compileJava FAILURE: Build failed with an exception. * What went wrong: Could not resolve all dependencies for configuration ':compile'. > Could not resolve com.sequenceiq:ambari-client20:2.0.1. Required by: com.sequenceiq:ambari-shell:0.1.DEV > Could not resolve com.sequenceiq:ambari-client20:2.0.1. > Could not get resource 'http://maven.sequenceiq.com/snapshots/com/sequenceiq/ambari-client20/2.0.1/ambari-client20-2.0.1.pom'. > Could not GET 'http://maven.sequenceiq.com/snapshots/com/sequenceiq/ambari-client20/2.0.1/ambari-client20-2.0.1.pom'. > maven.sequenceiq.com: Name or service not known > Could not resolve com.sequenceiq:ambari-client20:2.0.1. > Could not get resource 'http://maven.sequenceiq.com/release/com/sequenceiq/ambari-client20/2.0.1/ambari-client20-2.0.1.pom'. > Could not GET 'http://maven.sequenceiq.com/release/com/sequenceiq/ambari-client20/2.0.1/ambari-client20-2.0.1.pom'. > maven.sequenceiq.com > Could not resolve com.sequenceiq:ambari-client20:2.0.1. > Could not get resource 'http://maven.sequenceiq.com/releases/com/sequenceiq/ambari-client20/2.0.1/ambari-client20-2.0.1.pom'. > Could not GET 'http://maven.sequenceiq.com/releases/com/sequenceiq/ambari-client20/2.0.1/ambari-client20-2.0.1.pom'. > maven.sequenceiq.com * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAILED Total time: 11.708 secs

 

 

Please help!