CEPH高可用配置

就是再增加一个对象网关rgw

一、查看集群现在状态

[root@node1 ~]#  ceph -s
    rgw: 1 daemons active (node1)  # 现在只有一个rgw节点

二、部署第二个RGW

# 1、在管理节点的工作目录下,给 Ceph 对象网关节点安装Ceph对象所需的软件包
[root@node1 ~]# yum install -y ceph-radosgw  # 之前在三个节点都安装过了

# 2、部署rgw
[root@node1 ~]# cd /app/ceph-deploy/ceph-deploy/
[root@node1 ceph-deploy]# ceph-deploy rgw create node2

# 3、端口检查
[root@node1 ceph-deploy]# ss -ntl | grep 7480 
LISTEN     0      128          *:7480                     *:*                  
LISTEN     0      128         :::7480                    :::*  

# 4、curl一下(出现一下情况是正常的了)
[root@node1 ceph-deploy]# curl http://node1:7480
<?xml version="1.0" encoding="UTF-8"?><ListAllMyBucketsResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Owner><ID>anonymous</ID><DisplayName></DisplayName></Owner><Buckets></Buckets></ListAllMyBucketsResult

# 5、查看集群状态
[root@node1 ceph-deploy]# ceph -s
    rgw: 2 daemons active (node1, node2)  # 已经2个rgw节点了

三、修改网关默认端口

# 1、在ceph.conf 末尾加上
[root@node1 ceph-deploy]# vim ceph.conf 
[client.rgw.node2]  # 原本是有个[client.rgw.node1]的表示修改node的端口
rgw_frontends = "civetweb port=80"

# 2、推送文件
[root@node1 ceph-deploy]# ceph-deploy --overwrite-conf config push node1 node2 node3 

# 3、重启
[root@node2 ceph-deploy]# systemctl restart ceph.target      # (重启node2)

# 4、测试是否更改成功
[root@node1 ceph-deploy]# curl http://node2:80
<?xml version="1.0" encoding="UTF-8"?><ListAllMyBucketsResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Owner><ID>anonymous</ID><DisplayName></DisplayName></Owner><Buckets></Buckets></ListAllMyBucketsResult>[root@node1

四、haproxy+keepalived构建RGW⾼可⽤集群

4.1、安装haproxy(node1、node2)

[root@node1 ~]# yum install haproxy -y
posted @ 2021-03-16 00:48  taotaozh  阅读(340)  评论(0编辑  收藏  举报