搭建Ceph分布式存储

主机名(登录用户)

 

承载角色

 

CentOS 7.4 64Bit 1611

 

10.199.100.170

 

dlp(yzyu)

ceph-client(root)

 

admin-node

ceph-client

 

Centos 7.4 64Bit 1611

 

10.199.100.171

 

node1(yzyu)

添加一块硬盘

 

mon-node

osd0-node

mds-node

 

Centos 7.4 64Bit 1611

 

10.199.100.172

 

node2(yzyu)

添加一块硬盘

 

mon-node

osd1-node

 

 

配置基础环境

[root@dlp ~]# useradd yzyu [root@dlp ~]# echo "dhhy" |passwd --stdin dhhy [root@dlp ~]# cat <<END >>/etc/hosts 10.199.100.170 dlp 10.199.100.171 node1 10.199.100.172 node2 END [root@dlp ~]# echo "yzyu ALL = (root) NOPASSWD:ALL" >> /etc/sudoers.d/yzyu [root@dlp ~]# chmod 0440 /etc/sudoers.d/yzyu

[root@node1~]# useradd yzyu [root@node1 ~]# echo "yzyu" |passwd --stdin yzyu [root@node1 ~]# cat <<END >>/etc/hosts 10.199.100.170 dlp 10.199.100.171 node1 10.199.100.172 node2 END [root@node1 ~]# echo "yzyu ALL = (root) NOPASSWD:ALL" >> /etc/sudoers.d/yzyu [root@node1 ~]# chmod 0440 /etc/sudoers.d/yzyu
[root@node2
~]# useradd yzyu [root@node2 ~]# echo "yzyu" |passwd --stdin yzyu [root@node2 ~]# cat <<END >>/etc/hosts 10.199.100.170 dlp 10.199.100.171 node1 10.199.100.172 node2 END [root@node2 ~]# echo "yzyu ALL = (root) NOPASSWD:ALL" >> /etc/sudoers.d/yzyu [root@node2 ~]# chmod 0440 /etc/sudoers.d/yzyu

配置ntp时间服务

[root@dlp ~]# yum -y install ntp ntpdate [root@dlp ~]# sed -i '/^server/s/^/#/g' /etc/ntp.conf [root@dlp ~]# sed -i '25aserver 127.127.1.0\nfudge 127.127.1.0 stratum 8' /etc/ntp.conf [root@dlp ~]# systemctl start ntpd [root@dlp ~]# systemctl enable ntpd [root@dlp ~]# netstat -lntup

[root@node1 ~]# yum -y install ntpdate [root@node1 ~]# /usr/sbin/ntpdate 10.199.100.170 [root@node1 ~]# echo "/usr/sbin/ntpdate 10.199.100.170" >>/etc/rc.local [root@node1 ~]# chmod +x /etc/rc.local [root@node2 ~]# yum -y install ntpdate [root@node2 ~]# /usr/sbin/ntpdate 10.199.100.170 [root@node2 ~]# echo "/usr/sbin/ntpdate 10.199.100.170" >>/etc/rc.local [root@node2 ~]# chmod +x /etc/rc.local

分别在dlp节点、node1、node2节点上安装Ceph

[root@dlp ~]# yum -y install yum-utils [root@dlp ~]# yum-config-manager --add-repo https://dl.Fedoraproject.org/pub/epel/7/x86_64/ [root@dlp ~]# yum -y install epel-release --nogpgcheck [root@dlp ~]# cat <<END >>/etc/yum.repos.d/ceph.repo [Ceph] name=Ceph packages for \$basearch baseurl=http://mirrors.163.com/ceph/rpm-jewel/el7/\$basearch enabled=1 gpgcheck=0 type=rpm-md gpgkey=https://mirrors.163.com/ceph/keys/release.asc priority=1 [Ceph-noarch] name=Ceph noarch packages baseurl=http://mirrors.163.com/ceph/rpm-jewel/el7/noarch enabled=1 gpgcheck=0 type=rpm-md gpgkey=https://mirrors.163.com/ceph/keys/release.asc priority=1 [ceph-source] name=Ceph source packages baseurl=http://mirrors.163.com/ceph/rpm-jewel/el7/SRPMS enabled=1 gpgcheck=0 type=rpm-md gpgkey=https://mirrors.163.com/ceph/keys/release.asc priority=1 END

[root@dlp ~]# ls /etc/yum.repos.d/  ##必须保证有默认的官网源,结合epel源和网易的ceph源,才可以进行安装;

bak                    CentOS-fasttrack.repo  ceph.repo

CentOS-Base.repo       CentOS-Media.repo      dl.fedoraproject.org_pub_epel_7_x86_64_.repo

CentOS-CR.repo         CentOS-Sources.repo    epel.repo

CentOS-Debuginfo.repo  CentOS-Vault.repo      epel-testing.repo

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/ce6e3211f97f639ed8c3ac486e3c7337.html