鲲鹏社区首页
中文
注册
我要评分
文档获取效率
文档正确性
内容完整性
文档易理解
在线提单
论坛求助

配置对象存储

本小节仅需在主节点ceph1节点上执行。

定义Ceph服务需求

  1. 进入site.yml文件。
    1
    2
    cp /home/ceph-ansible/site.yml.sample /home/ceph-ansible/site.yml
    vim /home/ceph-ansible/site.yml
    
  2. “hosts”选项下,增加rgws的定义。
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    - hosts:
    - mons
    - osds
    #  - mdss
    - rgws
    #  - nfss
    #  - rbdmirrors
    - clients
    - mgrs
    #  - iscsigws
    #  - iscsi-gws # for backward compatibility only!
    #  - grafana-server
    #  - rgwloadbalancers
    

定义集群主机服务

1
vim /home/ceph-ansible/hosts
定义RGW服务所在的节点,本例为ceph1,ceph2主机。
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
[mons]
ceph1

[mgrs]
ceph1

[osds]
ceph1
ceph2

#[mdss]
#ceph1
#ceph2

[rgws]
ceph1
ceph2

[clients]
client3


[grafana-server]
ceph1

定义Ceph集群配置

1
vim /home/ceph-ansible/group_vars/all.yml

在all.yml中,设置前端网络类型,端口,每个RGW节点的RGW实例数。

  • Ceph在线下载方式:
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    ceph_origin: repository
    ceph_repository: community
    ceph_mirror: http://download.ceph.com
    ceph_stable_release: nautilus
    ceph_stable_repo: "{{ ceph_mirror }}/rpm-{{ ceph_stable_release }}"
    ceph_stable_redhat_distro: el7
    monitor_interface: enp133s0
    journal_size: 5120
    public_network: 172.19.106.0/0
    cluster_network: 172.19.106.0/0
    
    osd_objectstore: bluestore
    
    
    ## Rados Gateway options
    radosgw_frontend_type: beast
    radosgw_frontend_port: 12345
    radosgw_interface: "{{monitor_interface}}"
    radosgw_num_instances: 3
    

    部分参数填写说明如表1所示。

    表1 参数填写说明

    参数

    说明

    monitor_interface

    Public Network的网口设备ID

    radosgw_frontend_type

    RGW前端类型,根据需要选填

    radosgw_frontend_port

    RGW前端端口,根据需要选填

    radosgw_num_instances

    设置每个节点上RGW的实例个数,此时RGW的访问端口基于radosgw_frontend_port指定的端口号递增

  • Ceph离线下载方式:
    1
    2
    3
    ceph_origin: distro
    ceph_repository: local
    ceph_stable_release: nautilus
    

设置RGW服务的权限

在rgws.yml文件中设置RGW默认数据池和索引池的pg num和size,以及RGW服务能否访问私有设备的权限。

  • CentOS 7.6
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    rgw_create_pools:
    defaults.rgw.buckets.data:
    pg_num: 8
    size: ""
    defaults.rgw.buckets.index:
    pg_num: 8
    size: ""
    ###########
    # SYSTEMD #
    ###########
    # ceph_rgw_systemd_overrides will override the systemd settings
    # for the ceph-rgw services.
    # For example,to set "PrivateDevices=false" you can specify:
    ceph_rgw_systemd_overrides:
    Service:
    PrivateDevices: False
    
  • openEuler 20.03
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    rgw_create_pools: 
      defaults.rgw.buckets.data: 
          pg_num: 64 
          size: 3 
      defaults.rgw.buckets.index: 
          pg_num: 64
          size: 3 
    ########### 
    # SYSTEMD # 
    ########### 
    # ceph_rgw_systemd_overrides will override the systemd settings 
    # for the ceph-rgw services. 
    # For example,to set "PrivateDevices=false" you can specify: 
    ceph_rgw_systemd_overrides: 
      Service: 
         PrivateDevices: False
    

定义OSD

参照定义OSD的方法,定义相应的OSD。