CEPH快速搭建七(ceph对象存储)

Ceph 对象存储可以简称为 RGW,Ceph RGW 是基于 librados,为应用提供 RESTful 类型的对象存储接口,其接口方式支持 S3(兼容 Amazon S3 RESTful API) 和 Swift(兼容 OpenStack Swift API) 两种类型
 

安装
需要安装一个对象存储网关服务(ceph-radosgw),这个地方以ceph-node1,ceph-node2为对象存储网关服务器
在ceph-deploy服务器上执行
export CEPH_DEPLOY_REPO_URL=http://mirrors.163.com/ceph/rpm-jewel/el7
export CEPH_DEPLOY_GPG_URL=http://mirrors.163.com/ceph/keys/release.asc
ceph-deploy install --rgw ceph-node1 ceph-node2
#下面这个命令会同步配置和启动服务
ceph-deploy --overwrite rgw create ceph-node1 ceph-node2

ceph gw 默认使用自带Civetweb提供服务,在浏览器输入host:7480,可以看到正确运行

CEPH快速搭建七(ceph对象存储)_第1张图片

配置各个节点的网关
在node1和node2上执行
[root@ceph-node1 ~]# ceph auth get client.rgw.ceph-node1 > /etc/ceph/ceph.client.radosgw.keyring
[root@ceph-node2 ~]# ceph auth get client.rgw.ceph-node2 > /etc/ceph/ceph.client.radosgw.keyring

配置ceph.conf配置(在admin的ceph后追加)
[client.rgw.ceph-node1]
rgw_frontends = "civetweb port=8899"
host = ceph-node1
keyring = /etc/ceph/ceph.client.radosgw.keyring
rgw socket path = /var/run/ceph/ceph-client.rgw.ceph-node1.asok
rgw content length compat = true
[client.rgw.ceph-node2]
rgw_frontends = "civetweb port=8899"
host = ceph-node2
keyring = /etc/ceph/ceph.client.radosgw.keyring
rgw socket path = /var/run/ceph/ceph-client.rgw.ceph-node2.asok
rgw content length compat = true

同步配置到所有服务器
ceph-deploy --overwrite-conf config push ceph-admin ceph-node1 ceph-node2 ceph-node3

重启服务
systemctl restart ceph-radosgw.target

创建对象存储池
wget https://raw.githubusercontent.com/aishangwei/ceph-demo/master/ceph-deploy/rgw/pool
wget https://raw.githubusercontent.com/aishangwei/ceph-demo/master/ceph-deploy/rgw/create_pool.sh
sed -i "s#/root#`pwd`#g" create_pool.sh
sh create_pool.sh

 

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

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

CEPH快速搭建八(Amazon S3 RESTful API访问ceph对象存储)

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

你可能感兴趣的:(ceph)