您好,登錄后才能下訂單哦!
參照官方文檔中的快速安裝,結(jié)合國內(nèi)環(huán)境,將相關(guān)安裝源修改為國內(nèi)鏡像源提高安裝速度。
http://docs.ceph.org.cn/start/
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo
yum update -y```
### 關(guān)閉防火墻、SELinux
systemctl stop firewalld && systemctl disable firewalld
setenforce 0
sed -i 's/^SELINUX=.*/SELINUX=disabled/' /etc/selinux/config
### 添加hosts主機(jī)名解析(集群采用四臺虛擬機(jī))
四臺機(jī)器均添加
echo "192.168.5.191 admin-node
192.168.5.192 node1
192.168.5.193 node2
192.168.5.194 node3" >> /etc/hosts```
yum install ntp ntpdate ntp-doc -y ```
### 免密鑰登錄
admin-node #到node1 node2 node3之間
ssh-keygen #生成密鑰文件```
分別添加至三個node
hostname=(admin-node node1 node2 node3)
for i in ${hostname[*]};do echo yes|ssh-copy-id -i id_rsa.pub root@$i ;done
yum install -y yum-utils && yum-config-manager --add-repo http://mirrors.ustc.edu.cn/epel/7/x86_64/ && yum install --nogpgcheck -y epel-release && rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 && rm -rf /etc/yum.repos.d/mirrors.ustc.edu.cn_epel*
cat >> /etc/yum.repos.d/ceph.repo << EOF
[Ceph]
name=Ceph packages for $basearch
baseurl=http://mirrors.163.com/ceph/rpm-nautilus/el7/x86_64/
enabled=1
gpgcheck=0
type=rpm-md
gpgkey=http://mirrors.163.com/ceph/keys/release.asc
priority=1
[Ceph-noarch]
name=Ceph noarch packages
baseurl=http://mirrors.163.com/ceph/rpm-nautilus/el7/noarch/
enabled=1
gpgcheck=0
type=rpm-md
gpgkey=http://mirrors.163.com/ceph/keys/release.asc
priority=1
[ceph-source]
name=Ceph source packages
baseurl=http://mirrors.163.com/ceph/rpm-nautilus/el7/SRPMS/
enabled=1
gpgcheck=0
type=rpm-md
gpgkey=http://mirrors.163.com/ceph/keys/release.asc
priority=1
EOF
yum -y update && yum -y install ceph-deploy```
### 使用ceph-deploy在所有節(jié)點安裝軟件包
#### 命令清除配置:
ceph-deploy purgedata {ceph-node} [{ceph-node}]
ceph-deploy forgetkeys
#### 連 Ceph 安裝包一起清除
ceph-deploy purge {ceph-node} [{ceph-node}]
在管理節(jié)點(admin-node)
`mkdir my-cluster && cd my-cluster`
##### ceph-deploy new admin-node node1 node2 node3 創(chuàng)建集群。
sed -i '2a osd pool default size = 2' ceph.conf # 修改默認(rèn)副本數(shù)從 3 改成 2
sed -i '3a public network = 10.0.5.0/24' ceph.conf
#### 修改ceph-deploy安裝過程中的源
export CEPH_DEPLOY_REPO_URL=http://mirrors.163.com/ceph/rpm-nautilus/el7/
export CEPH_DEPLOY_GPG_URL=http://mirrors.163.com/ceph/keys/release.asc
ceph-deploy install admin-node node1 node2 node3
#### 生成密鑰環(huán)
ceph-deploy mon create-initial```
ceph-deploy admin admin-node node1 node2 node3```
#### 檢查集群健康狀態(tài)
ceph health ```
ceph-deploy osd create node1 --data /dev/sdb
ceph-deploy osd create node1 --data /dev/sdb
ceph-deploy osd create node3 --data /dev/sdb
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。