Skip to content

Instantly share code, notes, and snippets.

@Nimfadora
Created January 17, 2019 13:24
Show Gist options
  • Save Nimfadora/d98779eb26ebac7ac7232a4534c38aab to your computer and use it in GitHub Desktop.
Save Nimfadora/d98779eb26ebac7ac7232a4534c38aab to your computer and use it in GitHub Desktop.
setup high-availability Hadoop cluster (ha) on docker
#perform all steps from this tutorial till "A note about vsyscall"
https://docs.docker.com/samples/library/centos/
#proceed with download and configuration steps from
https://www.edureka.co/blog/how-to-set-up-hadoop-cluster-with-hdfs-high-availability/
#commit your container
#stop and remove running container
#create separate network
https://docs.docker.com/network/bridge/
#run 3 containers from saved image as follows
# changing {name}, {hostname} and host ports in forwarding section
docker run --name namenode--hostname nn --network ha-net -ti --privileged=true -v /sys/fs/cgroup:/sys/fs/cgroup:ro -p 81:80 -p 21:22 -p 8881:8485 -p 2171:2181 -p 9001:9000 -p 50071:50070 -p 2881:2888 -p 3881:3888 hdfs/namenode:v4
#install sshd with this:
https://dzone.com/articles/docker-how-to-ssh-to-a-running-container
(add ' where \n + add . before /set_root_pw.ssh)
#change password in all the containers
passwd
#now you can reach containers with
ssh root@localhost -p {port that you specified on run when forwarded 22 port}
#proceed with
https://www.edureka.co/blog/how-to-set-up-hadoop-cluster-with-hdfs-high-availability/
#zookeeper may not start from the first attempt, just try again (overriding ha-cluster dir when prompted)
#namenode or standby node can shutdown unexpectedly, just restart hadoop-deamon
#host for checking nn and secondary-nn in browser will also be localhost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment