手动增加ceph对象网关(可在一个节点增加多个网关)

手动增加ceph对象网关(可在一个节点增加多个网关)

以下步骤建议在centos 子用户下进行,不建议在root用户下

1、安装radosgw

若已安装,请自行跳过此步骤

yum -y install ceph-radosgw

2、创建keyring

sudo ceph-authtool --create-keyring /etc/ceph/ceph.client.radosgw.keyring

3、修改文件权限

sudo chown ceph:ceph /etc/ceph/ceph.client.radosgw.keyring

4、生成ceph-radosgw服务对应的用户和Key

sudo ceph-authtool /etc/ceph/ceph.client.radosgw.keyring -n 用户名 --gen-key

例:用户名为client.rgw.ceph-node1-1

sudo ceph-authtool /etc/ceph/ceph.client.radosgw.keyring -n client.rgw.ceph-node1-1 --gen-key

5、为用户添加访问权限

sudo ceph-authtool -n client.rgw.ceph-node1-1 --cap osd 'allow rwx' --cap mon 'allow rwx' /etc/ceph/ceph.client.radosgw.keyring

6、导入keyring到集群中

sudo ceph -k /etc/ceph/ceph.client.admin.keyring auth add client.rgw.ceph-node1-1 -i /etc/ceph/ceph.client.radosgw.keyring

7、查看集群中是否已有对应的用户

ceph auth list

8、配置ceph.conf

vi /etc/ceph/ceph.conf

在配置文件中增加以下内容

[client.rgw.ceph-node1-1]
host=ceph-node1
keyring=/etc/ceph/ceph.client.radosgw.keyring
log file=/var/log/radosgw/client.radosgw.gateway.log
rgw_s3_auth_use_keystone = False
rgw_frontends = civetweb port=7481

9、创建日志目录并修改权限

mkdir /var/log/radosgw
chown ceph:ceph /var/log/radosgw

10、启动rgw并查看状态

systemctl start ceph-radosgw@rgw.ceph-node1-1
systemctl restart ceph-radosgw.target
systemctl status ceph-radosgw@rgw.ceph-node1-1
netstat -antpu | grep 7481

11、设置rgw开机启动

systemctl enable ceph-radosgw@rgw.ceph-node1-1

12、验证

curl http://主机名:端口号

返回

<?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>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值