[root@ceph-node1 ~]# mount /dev/sdb /var/local/osd0/
[root@ceph-node2 ~]# mount /dev/sdb /var/local/osd1/
[root@ceph-node3 ~]# mount /dev/sdb /var/local/osd2/
[root@ceph-node1 ~]# vim /etc/hosts
[root@ceph-node2 ~]# vim /etc/hosts
[root@ceph-node3 ~]# vim /etc/hosts
[root@client1 ~]# vim /etc/hosts
[root@client2 ~]# vim /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.1.180 ceph-node1
192.168.1.179 ceph-node2
192.168.1.178 ceph-node3
192.168.1.172 client1
192.168.1.173 client2
8.ceph-node1节点生成Root SSH密钥,并将它复制到其他节点
[root@ceph-node1 ~]# ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):回车
Created directory '/root/.ssh'.
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:
SHA256:D9VwitoJ8Ac8M00VWZZHF1O9d7c/xFbfNVIBK2uZYAU root@ceph-node1
The key's randomart image is:
+---[RSA 2048]----+
| ...o.E==++o+B|
| o=...o*. ooo|
| o+ooo..o. .|
| =.o. =. o*|
| . S = o @|
| o. =o|
| . o .|
| ..|
| .|
+----[SHA256]-----+
[root@ceph-node1 ~]# ssh-copy-id ceph-node1
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
The authenticity of host 'ceph-node1 (192.168.1.180)' can't be established.
ECDSA key fingerprint is SHA256:wYjcu/pQkoX10MFoSZKg+0Mog67KxMCscQ95IJZ9URY.
ECDSA key fingerprint is MD5:3e:03:bf:f4:70:77:0b:3a:b4:84:97:48:56:de:ad:0b.
Are you sure you want to continue connecting (yes/no)? yes
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
root@ceph-node1's password:Number of key(s) added: 1Now try logging into the machine, with: "ssh 'ceph-node1'"
and check to make sure that only the key(s) you wanted were added.
[root@ceph-node1 ~]# ssh-copy-id ceph-node2
[root@ceph-node1 ~]# ssh-copy-id ceph-node3
[root@ceph-node1 ~]# ssh-copy-id client1
[root@ceph-node1 ~]# ssh-copy-id client2
9.配置阿里yum网络源(每一台虚拟机)
[root@ceph-node1 ~]# mv /etc/yum.repos.d/* /media/
[root@ceph-node2 ~]# mv /etc/yum.repos.d/* /media/
[root@ceph-node3 ~]# mv /etc/yum.repos.d/* /media/
[root@ceph-client1 ~]# mv /etc/yum.repos.d/* /media/
[root@ceph-client2 ~]# mv /etc/yum.repos.d/* /media/
将 /etc/yum.repos.d/ 目录下的所有文件移动到 /media/ 目录,原有的 YUM 源配置文件将被移走。
[root@ceph-node1 ~]# curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo% Total % Received % Xferd Average Speed Time Time Time CurrentDload Upload Total Spent Left Speed
100 2523 100 2523 0 0 1551 0 0:00:01 0:00:01 --:--:-- 1551
10.安装NTP服务,使用互联网上提供的NTP服务,三台主机的时间保持一致(主机需要能够正常联网)
[root@ceph-node1 ~]# yum -y install ntp
[root@ceph-node1 ~]# ntpdate ntp1.aliyun.com
20 Dec 10:24:16 ntpdate[13005]: adjust time server 120.25.115.20 offset -0.000328 sec