继上篇 docker系列3:docker搭建cdh单机版, 只有一个节点,若想搭建多节点集群,可以参考官方文档:https://hub.docker.com/r/cloudera/clusterdock

1, 运行脚本:启动容器

# docker-cdh集群:单机模拟多节点
source /dev/stdin <<< "$(curl -sL http://tiny.cloudera.com/clusterdock.sh)"  
 
#两个节点
 clusterdock_run ./bin/start_cluster cdh
 
# 拉取镜像,运行容器 
# 		cloudera/clusterdock   latest                        3e15a0e12577        2 years ago         463MB
# 		cloudera/clusterdock   cdh580_cm581_secondary-node   31b6f9ea419e        2 years ago         4.64GB
#	    cloudera/clusterdock   cdh580_cm581_primary-node     1e180df693af        2 years ago         4.5GB

#	  sudo docker run --net=host -t \                                                            
#      --privileged \                                                                         
#      ${TARGET_DIR_MOUNT} \                                                                   
#      ${TOPOLOGY_VOLUME} \                                                                        
#      ${REGISTRY_INSECURE} \                                                                 
#      ${REGISTRY_USERNAME} \                                                                 
#      ${REGISTRY_PASSWORD} \                                                                 
#      -v /tmp/clusterdock \                                                                  
#      -v /etc/hosts:/etc/hosts \                                          
#      -v /etc/localtime:/etc/localtime \                            
#      -v /var/run/docker.sock:/var/run/docker.sock \                
#      "${CLUSTERDOCK_IMAGE}" $@          

#四个节点: cluster in which the containers are named node-1.testing, node-2.testing, node-3.testing, and node-4.testing:
clusterdock_run ./bin/start_cluster -n testing cdh --primary-node=node-1 --secondary-nodes='node-{2..4}'

在这里插入图片描述
查看启动后的容器:
在这里插入图片描述

2, 登录web页面

密码: admin / admin
在这里插入图片描述

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐