ドッキングウィンドウのビルドhadoop2.8.5

1.ホスト上でダウンロード優れたインストールパッケージ:Hadoopの-2.8.5.tar.gz;二つのパケットのjdk1.8.0_131.tar.gz合計

2.ドッカーは、ミラーリポジトリに私を得ました: 

               ドッキングウィンドウプルCentOSの

3.コンテナを作成します。 

              ドッキングウィンドウの実行-i -t -d --name centos_hdpのCentOS:CentOSの

ホストコピーのHadoop-2.8.5.tar.gz 4.は、容器に2つのパッケージがjdk1.8.0_131.tar.gz:

             ドッキングウィンドウCP JDK-8u131-のlinux-x64.tar.gzの   centos_hdp:は/ usr / local

             ドッキングウィンドウのcpのHadoop-2.8.5.tar.gz  centos_hdpます。/ opt /

容器の中にバックグラウンドで実行されます:

           ドッキングウィンドウのexec -it centos_hdpバッシュ

           タール-zxvf /usr/local/jdk1.8.0_131.tar.gz -Cは/ usr / local /

           タール-zxvf /opt/hadoop-2.8.5.tar.gz -Cは/ opt /

           vimのは/ etc / proflie

         ソースは/ etc / profile

                 vimの/opt/hadoop-2.8.5/etc/hadoop/core-site.xml

  

              vimの/opt/hadoop-2.8.5/etc/hadoop/hdfs-site.xml

            vimの/opt/hadoop-2.8.5/etc/hadoop/mapred-site.xml

         vimの/opt/hadoop-2.8.5/etc/hadoop/yarn-site.xml

          vimの/opt/hadoop-2.8.5/etc/hadoop/hadoop-env.sh

          猫/opt/hadoop-2.8.5/etc/hadoop/slave

6.コンテナを終了し、コンテナはカレントミラーに詰め:

                ドッキングウィンドウは、-a "mayunzhen" -m "のHadoopベース・イメージ" centos_hdp centos_hdpをコミット:2.8.5

ジャーパッケージ鏡の中へ7.エクスポート

               centos_hdp保存ドッキングウィンドウ:2.8.5 -o centos_hdp.jar 

他のホストへの8.centos_hdp.jarイメージパッケージの広がり

               SCP centos_hdp.jar [email protected]:/

               SCP centos_hdp.jar  [email protected] 7:/

               SCP centos_hdp.jar  [email protected] 8:/

9.ラン3(192.168.130.166,192.168.130.167,192.168.130.168)ホスト上にインポートされた画像

              ドッキングウィンドウ負荷-i centos_hdp.jar

各ホスト構成ドッカー織り10.、容器が別のホスト上で通信できるように

         详情见链接:https://www.cnblogs.com/kevingrace/p/6859173.html

11.运行hadoop容器命令:

       (192.168.130.166主机上)docker run  -itd  -h master --name master  -v /etc/localtime:/etc/localtime:ro  centos_hdp:2.8.5

                                                    weave attach 192.168.1.1/24 master

       (192.168.130.167主机上)docker run  -itd  -h slave1 --name slave1 -v /etc/localtime:/etc/localtime:ro centos_hdp:2.8.5

                                                    weave attach 192.168.1.2/24 slave1

       (192.168.130.168主机上)docker run  -itd  -h slave2 --name slave2  -v /etc/localtime:/etc/localtime:ro centos_hdp:2.8.5

                                                    weave attach 192.168.1.3/24 slave2

        测试三个容器IP(192.168.1.1,192.168.1.2,192.168.1.3)互相能通信:

12.分别在三个容器(192.168.1.1,192.168.1.2,192.168.1.3)上配置/etc/hosts

 

13.分别在三个容器(192.168.1.1,192.168.1.2,192.168.1.3)上配置无密码登录

        详情:https://www.cnblogs.com/shuochen/p/10441455.html

14.master容器中执行启动hadoop

         source /etc/profile

        start-all.sh

15.查看集群状态:

 

 

 

 

 

 

制作好的docker hadoop:2.8.5镜像已经上传到https://hub.docker.com/repository/docker/iammayunzhen/centos_hdp(或者可 docker pull  iammayunzhen/centos_hdp:2.8.5进行下载),有需要,可供大家下载,参考。

Refereces:

docker hadoop镜像制作:https://www.jianshu.com/p/bf76dfedef2f

docker容器时间和宿主机同步:https://www.cnblogs.com/kevingrace/p/5570597.html 

多宿主机容器之间通信:https://www.cnblogs.com/kevingrace/p/6859173.html

docker容器中IP无法ssh登录:http://blog.chinaunix.net/uid-26168435-id-5732463.html

查看端口情况:netstat -tulnp |grep 22

安装passwd命令:yum install -y passwd

多容器IP无密码登录:https://www.cnblogs.com/shuochen/p/10441455.html 

 

おすすめ

転載: www.cnblogs.com/yunger/p/12061173.html