修改/etc/hosts
IP地址 主机名
172.25.55.11 xiaozhuang1
172.25.55.12 xiaozhuang2
172.25.55.13 xiaozhuang3
配置ssh免密码登录
##ssh-keygen -t rsa # 一路回车
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
ef:79:38:51:85:ec:01:6b:62:28:2d:82:01:11:dd:37 root@master
The key's randomart image is:
+--[ RSA 2048]----+
|*+ . .o . |
| o. ..E. .+ . |
|. . o.o.o o. o |
| . o . o o |
| S . |
| .. |
| .o |
| .o.. |
| oo |
+-----------------+
1) 直接使用命令复制公钥
[root@master ~]# ssh-copy-id -i .ssh/id_rsa.pub root@node01
[root@master ~]# ssh-copy-id -i .ssh/id_rsa.pub root@node02
2) 某些情况下需要手动复制,下面以node01节点的操作为例:
[root@xiaozhuang1 ~]# scp .ssh/id_rsa.pub root@node01:/tmp
[root@xiaozhuang1 ~]# mkdir .ssh && chmod 700 .ssh
[root@xiaozhuang1 ~]# cat /tmp/id_rsa.pub >> .ssh/authorized_keys [此文件权限必须为600]
[root@master ~]# ssh node01
首次执行会提示yes/no确认 之后不再提示!
安装Docker
yum install -y docker-engine-17.03.1.ce-1.el7.centos.x86_64.rpm
docker-engine-selinux-17.03.1.ce-1.el7.centos.noarch.rpm
systemctl start docker
systemctl restart docker
查看Docker是否安装成功
[root@xiaozhuang1 ~]# docker version
Client:
Version: 17.03.1-ce
API version: 1.27
Go version: go1.7.5
Git commit: c6d412e
Built: Fri Mar 24 00:36:45 2017
OS/Arch: linux/amd64
Server:
Version: 17.03.1-ce
API version: 1.27 (minimum version 1.12)
Go version: go1.7.5
Git commit: c6d412e
Built: Fri Mar 24