CEPH快速搭建三(ceph的环境搭建)

1.在admin节点执行(ceph-deploy安装)
sudo yum -y install python2-pip ceph-deploy

2.安装ceph(在admin节点操作)
#export的目的是为了加速安装,采用国内镜像源
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 ceph-admin ceph-node1 ceph-node2 ceph-node3 #如果安装缓慢,可以用下面这个方式

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
以上安装可能非常慢,可以切换为离线模式安装(然后再执行下上面这个语句,放置错误遗漏)
mkdir packages -p
cd packages
sudo yum install --downloadonly --downloaddir=`pwd` ceph-deploy ceph ceph-radosgw
cd ..
for node in {ceph-admin,ceph-node1,ceph-node2,ceph-node3};do scp -r packages $node:~/;done
for node in {ceph-admin,ceph-node1,ceph-node2,ceph-node3};do ssh $node -x "sudo yum install epel-release yum-plugin-priorities -y";done
for node in {ceph-admin,ceph-node1,ceph-node2,ceph-node3};do ssh $node -x "sudo yum install /home/ceph/packages/*.rpm -y";done
ceph-deploy install ceph-admin ceph-node1 ceph-node2 ceph-node3
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


3.添加管理节点(mon)
mkdir cluster
cd cluster
ceph-deploy new ceph-admin ceph-node1 ceph-node2


4.修改基础的配置ceph.conf
[ceph@localhost cluster]$ vim ceph.conf
^^^^
public network=10.34.44.0/24 #定义集群网络
osd pool default size=3 #定义默认的osd副本数,其实默认就是3个

5.激活监控节点
ceph-deploy mon create-initial


6.磁盘操作
#添加磁盘
ceph-deploy disk zap ceph-admin:/dev/sdb ceph-admin:/dev/sdc ceph-node1:/dev/sdb ceph-node1:/dev/sdc ceph-node2:/dev/sdb ceph-node2:/dev/sdc ceph-node3:/dev/sdb ceph-node3:/dev/sdc
#格式化盘
ceph-deploy osd prepare ceph-admin:/dev/sdb ceph-admin:/dev/sdc ceph-node1:/dev/sdb ceph-node1:/dev/sdc ceph-node2:/dev/sdb ceph-node2:/dev/sdc ceph-node3:/dev/sdb ceph-node3:/dev/sdc
#激活磁盘(这一步不用操作了,再上一步prepare后已经激活了)
ceph-deploy osd activate ceph-admin:/dev/sdb ceph-admin:/dev/sdc ceph-node1:/dev/sdb ceph-node1:/dev/sdc ceph-node2:/dev/sdb ceph-node2:/dev/sdc ceph-node3:/dev/sdb ceph-node3:/dev/sdc

7.查看ceph集群状态
ceph -s


8.配置ceph管理节点
[ceph@ceph-admin ~]$ ceph mds stat
e2: 0/0/1 up
[ceph@ceph-admin ~]$ cd cluster/
[ceph@ceph-admin cluster]$ ceph-deploy mds create ceph-admin
[ceph@ceph-admin cluster]$ ceph mds stat
e5: 1/1/1 up {0=ceph-admin=up:active}

下一章节:

CEPH主要有文件存储 块存储 和 对象存储,

下一章节我把块存储提到文件存储前面来,因为文件存储也利用了块存储的部分东西

 

书写文档不易,如果你觉得我写得可以打个赏呗

https://www.fageka.com/store/item/s/id/Yx6TZ1m0747.html

CEPH快速搭建四(ceph的pool池)

https://blog.csdn.net/xx496146653/article/details/89247828

你可能感兴趣的:(ceph)