Skip to content

Instantly share code, notes, and snippets.

@matyix
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matyix/a8e6f3642cc401877b02 to your computer and use it in GitHub Desktop.
Save matyix/a8e6f3642cc401877b02 to your computer and use it in GitHub Desktop.
ambari-shell demo

##Start Docker

docker-kill-last
dpsa
docker run -d -h server.ambari.com --dns 127.0.0.1 --name ambari sequenceiq/ambari 
	-d damon (background)
	-h hostname
	--dns get the DNS from the host
	--name name

##Get the IP address

docker inspect -f "{{.NetworkSettings.IPAddress}}" $(docker ps -lq)
	get the IP address (groovy)
	
docker inspect $(docker ps -ql)|grep IPA 

###Check routing

sudo route add -net 172.21.0.0/16 192.168.59.103
netstat -nr

###Check Ambari

curl -u admin:admin 172.17.0.2:8080/api/v1/clusters, hosts, blueprints

###Start Ambari shell

java -jar ~/prj/ambari-shell/target/ambari-shell-1.0-SNAPSHOT.jar --ambari.host=172.17.0.2

###Shell commands

hello
blueprint list
blueprint defaults
blueprint list
blueprint show --id  single-node-hdfs-yarn
cluster build --blueprint single-node-hdfs-yarn
cluster preview
cluster assign --hostGroup host_group_1 --host server.ambari.com
cluster preview
cluster create
tasks 

###Run a script

script --file ./single.ash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment