主机准备

  • Hostname: node3
  • IPADDR: 192.168.0.64
  • NTP Server: 192.168.200.20
  • CEPH USER: cephadmin
  • OSD: /dev/sdb
## node3端配置 ##
# 安装前准备
echo node3 >/etc/hostname

# 修改IP地址
vi /etc/sysconfig/network-scripts/ifcfg-eth0
...

# 关闭Selinux/firewalld
systemctl stop firewalld
systemctl disable firewalld
setenforce 0
sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config

# 配置源
echo '# 阿里CEPH源
[ceph]
name=ceph
baseurl=http://mirrors.aliyun.com/ceph/rpm-mimic/el7/x86_64/
gpgcheck=0
[ceph-noarch]
name=cephnoarch
baseurl=http://mirrors.aliyun.com/ceph/rpm-mimic/el7/noarch/
gpgcheck=0
[ceph-source]
name=ceph-source
baseurl=http://mirrors.aliyun.com/ceph/rpm-mimic/el7/SRPMS/
gpgcheck=0
#'>/etc/yum.repos.d/ceph.repo

# 配置ntp
yum install -y ntp
ntpdate 192.168.200.20

# 配置用户
useradd -d /home/cephadmin -m cephadmin
passwd cephadmin

# 配置sudo免密码
echo "cephadmin ALL=(root) NOPASSWD:ALL" | tee /etc/sudoers.d/cephadmin
chmod 0440 /etc/sudoers.d/cephadmin

# 重启
reboot

## master端配置##
# 配置hosts
echo "192.168.0.64 node3" >>/etc/hosts
cd ~/.ssh

# 配置SSH选项,增加如下格式配置
vi config
Host node3
    Hostname node3
    User cephadmin

# 分发密钥
ssh-copy-id cephadmin@node3

# 安装ceph
ceph-deploy install node3

# 分发权限
ceph admin node3

# 创建osd data
ceph-deploy osd create --date /dev/sdb node3

# 查看状态
ceph -s
Last modification:May 7th, 2019 at 03:16 pm