本文只对本博主有价值,其他人勿用
废弃命令
docker run -v E:\COURSE\spark:/home -it --network hadoop -h "node01" --name "node01" -p 9870:9870 -p 8088:8088 -p 4040:4040 -p 8080:8080 -p 50070:50070 -p 9001:9001 -p 8030:8030 -p 8031:8031 -p 8032:8032 -p 8042:8042 -p 19888:19888 -p 22:22 pyspark_hadoop_centos /bin/bash
docker run -it --network hadoop -h "node02" --name "node02" pyspark_hadoop_centos /bin/bash
docker run -it --network hadoop -h "node03" --name "node03" pyspark_hadoop_centos /bin/bash
有效命令
docker run -v E:\COURSE\spark:/home -itd --privileged --network hadoop -h "node01" --name "node01" -p 9870:9870 -p 8088:8088 -p 4040:4040 -p 8080:8080 -p 50070:50070 -p 9001:9001 -p 8030:8030 -p 8031:8031 -p 8032:8032 -p 8042:8042 -p 19888:19888 -p 22:22 pyspark_hadoop_centos /usr/sbin/init
docker run -itd --privileged --network hadoop -h "node02" --name "node02" pyspark_hadoop_centos /usr/sbin/init
docker run -itd --privileged --network hadoop -h "node03" --name "node03" pyspark_hadoop_centos /usr/sbin/init
vim /etc/hosts
172.18.0.2 node01
172.18.0.3 node02
172.18.0.4 node03