2020-09-03 15:01:16 +08:00
# RGW Multisite
2016-08-17 02:57:01 +08:00
2020-09-03 15:01:16 +08:00
This document contains directions for configuring the RGW Multisite in ceph-ansible.
2020-04-17 03:47:17 +08:00
Multisite replication can be configured either over multiple Ceph clusters or in a single Ceph cluster to isolate RGWs from eachother.
2019-10-05 03:31:25 +08:00
2020-04-17 03:47:17 +08:00
The first two sections are refreshers on working with ansible inventory and RGW Multisite.
The next 4 sections are instructions on deploying the following multisite scenarios:
2019-10-05 03:31:25 +08:00
2020-09-03 15:01:16 +08:00
- Scenario #1: Single Realm with Multiple Ceph Clusters
- Scenario #2: Single Ceph Cluster with Multiple Realms
- Scenario #3: Multiple Realms over Multiple Ceph Clusters
- Scenario #4: Multiple Realms over Multiple Ceph Clusters with Multiple Instances on a Host
2019-10-05 03:31:25 +08:00
2020-09-03 15:01:16 +08:00
## Working with Ansible Inventory
2019-10-05 03:31:25 +08:00
2020-04-17 03:47:17 +08:00
If you are familiar with basic ansible terminology, working with inventory files, and variable precedence feel free to skip this section.
2016-08-17 02:57:01 +08:00
2020-09-03 15:01:16 +08:00
### The Inventory File
2020-04-17 03:47:17 +08:00
2020-09-03 15:01:16 +08:00
Ceph-ansible starts up all the different daemons in a Ceph cluster.
2020-04-17 03:47:17 +08:00
Each daemon (osd.0, mon.1, rgw.a) is given a line in the inventory file. Each line is called a **host** in ansible.
2020-09-03 15:01:16 +08:00
Each type of daemon (osd, mon, rgw, mgr, etc.) is given a **group** with its respective daemons in the ansible inventory file.
2020-04-17 03:47:17 +08:00
Here is an example of an inventory file (in .ini format) for a ceph cluster with 1 ceph-mgr, 4 rgws, 3 osds, and 2 mons:
2020-09-03 15:01:16 +08:00
```ansible-inventory
2020-04-17 03:47:17 +08:00
[mgrs]
2020-09-03 15:01:16 +08:00
mgr-001 ansible_ssh_host=192.168.224.48 ansible_ssh_port=22
2020-04-17 03:47:17 +08:00
[rgws]
2020-09-03 15:01:16 +08:00
rgw-001 ansible_ssh_host=192.168.216.145 ansible_ssh_port=22 radosgw_address=192.168.216.145
rgw-002 ansible_ssh_host=192.168.215.178 ansible_ssh_port=22 radosgw_address=192.168.215.178
2020-04-17 03:47:17 +08:00
[osds]
2020-09-03 15:01:16 +08:00
osd-001 ansible_ssh_host=192.168.230.196 ansible_ssh_port=22
osd-002 ansible_ssh_host=192.168.226.21 ansible_ssh_port=22
osd-003 ansible_ssh_host=192.168.176.118 ansible_ssh_port=22
2020-04-17 03:47:17 +08:00
[mons]
2020-09-03 15:01:16 +08:00
mon-001 ansible_ssh_host=192.168.210.155 ansible_ssh_port=22 monitor_address=192.168.210.155
mon-002 ansible_ssh_host=192.168.179.111 ansible_ssh_port=22 monitor_address=192.168.179.111
2020-04-17 03:47:17 +08:00
```
2020-09-03 15:01:16 +08:00
Notice there are 4 groups defined here: mgrs, rgws, osds, mons.
2020-04-28 06:04:58 +08:00
There is one host (mgr-001) in mgrs, 2 hosts (rgw-001, rgw-002) in rgws, 3 hosts (osd-001, osd-002, osd-003) in osds, and 2 hosts (mon-001, mon-002) in mons.
2020-04-17 03:47:17 +08:00
2020-09-03 15:01:16 +08:00
### group_vars
2020-04-17 03:47:17 +08:00
In the ceph-ansible tree there is a directory called `group_vars` . This directory has a collection of .yml files for variables set for each of the groups.
The rgw multisite specific variables are defined in `all.yml` . This file has variables that apply to all groups in the inventory.
When a variable, for example if `rgw_realm: usa` , is set in `group_vars/all.yml` , `usa` will be the value for `rgw_realm` for all of the rgws.
2020-09-03 15:01:16 +08:00
### host_vars
2020-04-17 03:47:17 +08:00
If you want to set any of the variables defined in `group_vars` for a specific host you have two options.
One option is to edit the line in the inventory file for the host you want to configure. In the above inventory each mon and rgw has a host specific variable for its address.
The preferred option is to create a directory called `host_vars` at the root of the ceph-ansible tree.
2020-04-28 06:04:58 +08:00
In `host_vars/` there can be files with the same name as the host (ex: osd-001, mgr-001, rgw-001) that set variables for each host.
2020-04-17 03:47:17 +08:00
The values for the variables set in `host_vars` have a higher precedence than the values in `group_var` .
2020-04-28 06:04:58 +08:00
Consider this the file `host_vars/rgw-001` :
2020-04-17 03:47:17 +08:00
2020-09-03 15:01:16 +08:00
```yaml
2020-04-17 03:47:17 +08:00
rgw_realm: usa
rgw_zonegroup: alaska
rgw_zone: juneau
rgw_zonemaster: true
rgw_zonesecondary: false
system_access_key: alaskaaccesskey
system_secret_key: alaskasecretkey
```
2020-04-28 06:04:58 +08:00
Even if `rgw_realm` is set to `france` in `group_vars/all.yml` , `rgw_realm` will evaluate to `usa` for tasks run on `rgw-001` .
2020-04-17 03:47:17 +08:00
This is because Ansible gives higher precedence to the values set in `host_vars` over `group_vars` .
2020-09-03 15:01:16 +08:00
For more information on working with inventory in Ansible please visit: < https: / / docs . ansible . com / ansible / latest / user_guide / intro_inventory . html > .
2020-04-17 03:47:17 +08:00
2020-09-03 15:01:16 +08:00
## Brief Multisite Overview
2020-04-17 03:47:17 +08:00
2020-09-03 15:01:16 +08:00
### RGW Multisite terminology
2020-04-17 03:47:17 +08:00
If you are familiar with RGW multisite in detail, feel free to skip this section.
2016-08-17 02:57:01 +08:00
2020-09-03 15:01:16 +08:00
Rados gateways (RGWs) in multisite replication are grouped into zones.
2020-04-17 03:47:17 +08:00
A group of 1 or more RGWs can be grouped into a **zone** .\
A group of 1 or more zones can be grouped into a **zonegroup** .\
A group of 1 or more zonegroups can be grouped into a **realm** .\
2020-09-03 15:01:16 +08:00
A Ceph **cluster** in multisite has 1 or more rgws that use the same backend OSDs.\
2020-04-17 03:47:17 +08:00
There can be mutliple clusters in one realm, multiple realms in a single cluster, or multiple realms over multiple clusters.
2020-09-03 15:01:16 +08:00
### RGW Realms
2020-04-17 03:47:17 +08:00
A realm allows the RGWs inside of it to be independent and isolated from RGWs outside of the realm. A realm contains one or more zonegroups.
Realms can contain 1 or more clusters. There can also be more than 1 realm in a cluster.
2020-09-03 15:01:16 +08:00
### RGW Zonegroups
2020-04-17 03:47:17 +08:00
Similar to zones a zonegroup can be either **master zonegroup** or a **secondary zonegroup** .
`rgw_zonegroupmaster` specifies whether the zonegroup will be the master zonegroup in a realm.
2020-09-03 15:01:16 +08:00
There can only be one master zonegroup per realm. There can be any number of secondary zonegroups in a realm.
2020-04-17 03:47:17 +08:00
Zonegroups that are not master must have `rgw_zonegroupmaster` set to false.
2020-09-03 15:01:16 +08:00
### RGW Zones
2020-04-17 03:47:17 +08:00
A zone is a collection of RGW daemons. A zone can be either **master zone** or a **secondary zone** .
`rgw_zonemaster` specifies that the zone will be the master zone in a zonegroup.
`rgw_zonesecondary` specifies that the zone will be a secondary zone in a zonegroup.
Both `rgw_zonemaster` and `rgw_zonesecondary` need to be defined. They cannot have the same value.
2020-04-23 23:12:13 +08:00
A secondary zone pulls a realm in order to sync data to it.
2020-04-17 03:47:17 +08:00
Finally, The variable `rgw_zone` is set to "default" to enable compression for clusters configured without rgw multi-site.
If multisite is configured `rgw_zone` should not be set to "default".
2020-09-03 15:01:16 +08:00
For more defail information on multisite please visit: < https: / / docs . ceph . com / docs / master / radosgw / multisite / > .
2020-04-23 23:12:13 +08:00
2020-09-03 15:01:16 +08:00
## Deployment Scenario #1: Single Realm & Zonegroup with Multiple Ceph Clusters
2020-04-17 03:47:17 +08:00
2020-09-03 15:01:16 +08:00
### Requirements
2019-10-05 03:31:25 +08:00
2016-08-17 02:57:01 +08:00
* At least 2 Ceph clusters
2020-04-17 03:47:17 +08:00
* 1 RGW per cluster
2016-08-17 02:57:01 +08:00
* Jewel or newer
2020-09-03 15:01:16 +08:00
### Configuring the Master Zone in the Primary Cluster
2016-08-17 02:57:01 +08:00
2020-04-17 03:47:17 +08:00
This will setup a realm, master zonegroup and master zone in the Ceph cluster.
Since there is only 1 realm, 1 zonegroup, and 1 zone for all the rgw hosts, only `group_vars/all.yml` needs to be edited for mulitsite conifguration.
If there is one more that one rgw being deployed in this configuration, the rgw(s) will be added to the master zone.
2016-08-17 02:57:01 +08:00
1. Generate System Access and System Secret Keys
2020-09-03 15:01:16 +08:00
```bash
echo system_access_key: $(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 20 | head -n 1) > multi-site-keys.txt
echo system_secret_key: $(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 40 | head -n 1) >> multi-site-keys.txt
```
2020-04-17 03:47:17 +08:00
2. Edit `group_vars/all.yml` for the 1st cluster
2016-08-17 02:57:01 +08:00
2020-09-03 15:01:16 +08:00
```yaml
rgw_multisite: true
2019-10-05 03:31:25 +08:00
2020-09-03 15:01:16 +08:00
rgw_zone: juneau
rgw_zonegroup: alaska
rgw_realm: usa
2019-10-05 03:31:25 +08:00
2020-09-03 15:01:16 +08:00
rgw_zonemaster: true
rgw_zonesecondary: false
2020-04-17 03:47:17 +08:00
2020-09-03 15:01:16 +08:00
rgw_zonegroupmaster: true
2020-04-17 03:47:17 +08:00
2020-09-03 15:01:16 +08:00
rgw_multisite_proto: http
rgw_zone_user: edward.lewis
rgw_zone_user_display_name: "Edward Lewis"
2020-04-17 03:47:17 +08:00
2020-09-03 15:01:16 +08:00
system_access_key: 6kWkikvapSnHyE22P7nO
system_secret_key: MGecsMrWtKZgngOHZdrd6d3JxGO5CPWgT2lcnpSt
```
2020-04-17 03:47:17 +08:00
2020-09-03 15:01:16 +08:00
**Note:** `rgw_zonemaster` should have the value of `true` and `rgw_zonesecondary` should be `false` . Both values always need to be defined when running multisite.
**Note:** replace the `system_access_key` and `system_secret_key` values with the ones you generated.
2020-04-17 03:47:17 +08:00
3. Run the ceph-ansible playbook for the 1st cluster
2020-09-03 15:01:16 +08:00
### Configuring the Secondary Zone in a Separate Cluster
2020-04-17 03:47:17 +08:00
This will setup a realm, master zonegroup and master zone in the secondary Ceph cluster.
Since there is only 1 realm, 1 zonegroup, and 1 zone for all the rgw hosts, only `group_vars/all.yml` needs to be edited for mulitsite conifguration.
If there is one more that one rgw being deployed in this configuration, the rgw(s) will be added to the secondary zone.
2020-09-03 15:01:16 +08:00
1. Edit `group_vars/all.yml` for the 2nd cluster
2020-04-17 03:47:17 +08:00
2020-09-03 15:01:16 +08:00
```yaml
rgw_multisite: true
2020-04-17 03:47:17 +08:00
2020-09-03 15:01:16 +08:00
rgw_zone: fairbanks
rgw_zonegroup: alaska
rgw_realm: usa
2020-04-17 03:47:17 +08:00
2020-09-03 15:01:16 +08:00
rgw_zonemaster: false
rgw_zonesecondary: true
2020-04-17 03:47:17 +08:00
2020-09-03 15:01:16 +08:00
rgw_zonegroupmaster: true
2020-04-17 03:47:17 +08:00
2020-09-03 15:01:16 +08:00
rgw_multisite_proto: http
rgw_zone_user: edward.lewis
rgw_zone_user_display_name: "Edward Lewis"
2020-04-17 03:47:17 +08:00
2020-09-03 15:01:16 +08:00
system_access_key: 6kWkikvapSnHyE22P7nO
system_secret_key: MGecsMrWtKZgngOHZdrd6d3JxGO5CPWgT2lcnpSt
2020-04-17 03:47:17 +08:00
2020-09-03 15:01:16 +08:00
rgw_pull_proto: http
rgw_pull_port: 8080
rgw_pullhost: rgw-001-hostname
```
2020-04-17 03:47:17 +08:00
2020-09-03 15:01:16 +08:00
**Note:** `rgw_zonemaster` should have the value of `false` and `rgw_zonesecondary` should be `true`
2020-04-17 03:47:17 +08:00
2020-09-03 15:01:16 +08:00
**Note:** The variables `rgw_pull_port` , `rgw_pull_proto` , `rgw_pullhost` , are joined together to make an endpoint string needed to create secondary zones. This endpoint is of one of the RGW endpoints in a master zone in the zonegroup and realm you want to create secondary zones in. This endpoint **must be resolvable** from the mons and rgws in the cluster the secondary zone(s) are being created in.
2020-04-17 03:47:17 +08:00
2020-09-03 15:01:16 +08:00
**Note:** `system_access_key` , and `system_secret_key` should match what you used in the Primary Cluster
2020-04-17 03:47:17 +08:00
2020-09-03 15:01:16 +08:00
2. Run the ceph-ansible playbook on your 2nd cluster
2020-04-17 03:47:17 +08:00
2020-09-03 15:01:16 +08:00
### Conclusion
2020-04-17 03:47:17 +08:00
You should now have a master zone on cluster0 and a secondary zone on cluster1 in an Active-Active mode.
2020-09-03 15:01:16 +08:00
## Deployment Scenario #2: Single Ceph Cluster with Multiple Realms
2020-04-17 03:47:17 +08:00
2020-09-03 15:01:16 +08:00
### Requirements
2020-04-17 03:47:17 +08:00
* Jewel or newer
2020-09-03 15:01:16 +08:00
### Configuring Multiple Realms in a Single Cluster
2020-04-17 03:47:17 +08:00
This configuration will a single Ceph cluster with multiple realms.
Each of the rgws in the inventory should have a file in `host_vars` where the realm, zone, and zonegroup can be set for the rgw along with other variables.
1. Generate System Access and System Secret Keys for each realm
2020-09-03 15:01:16 +08:00
```bash
echo system_access_key: $(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 20 | head -n 1) > multi-site-keys-realm-1.txt
echo system_secret_key: $(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 40 | head -n 1) >> multi-site-keys-realm-1.txt
echo system_access_key: $(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 20 | head -n 1) > multi-site-keys-realm-2.txt
echo system_secret_key: $(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 40 | head -n 1) >> multi-site-keys-realm-2.txt
```
2020-04-17 03:47:17 +08:00
2. Edit `group_vars/all.yml` for the cluster
2020-09-03 15:01:16 +08:00
```yaml
rgw_multisite: true
```
2016-08-17 02:57:01 +08:00
2020-09-03 15:01:16 +08:00
As previously learned, all values set here will be set on all rgw hosts. `rgw_multisite` be set to `true` for all rgw hosts so multisite playbooks can run on all rgws.
2019-02-01 04:43:21 +08:00
2020-04-17 03:47:17 +08:00
3. Create & edit files in `host_vars/` to create realms, zonegroups, and master zones.
2019-02-01 04:43:21 +08:00
2020-09-03 15:01:16 +08:00
Here is an example of the file `host_vars/rgw-001` for the `rgw-001` entry in the `[rgws]` section of for the example ansible inventory.
2016-08-17 02:57:01 +08:00
2020-09-03 15:01:16 +08:00
```yaml
rgw_zonemaster: true
rgw_zonesecondary: false
rgw_zonegroupmaster: true
rgw_multisite_proto: http
rgw_realm: france
rgw_zonegroup: idf
rgw_zone: paris
radosgw_address: "{{ _radosgw_address }}"
radosgw_frontend_port: 8080
rgw_zone_user: jacques.chirac
rgw_zone_user_display_name: "Jacques Chirac"
system_access_key: P9Eb6S8XNyo4dtZZUUMy
system_secret_key: qqHCUtfdNnpHq3PZRHW5un9l0bEBM812Uhow0XfB
```
2016-08-17 02:57:01 +08:00
2020-09-03 15:01:16 +08:00
Here is an example of the file `host_vars/rgw-002` for the `rgw-002` entry in the `[rgws]` section of for the example ansible inventory.
2019-09-11 06:01:48 +08:00
2020-09-03 15:01:16 +08:00
```yaml
rgw_zonemaster: true
rgw_zonesecondary: false
rgw_zonegroupmaster: true
rgw_multisite_proto: http
rgw_realm: usa
rgw_zonegroup: alaska
rgw_zone: juneau
radosgw_address: "{{ _radosgw_address }}"
radosgw_frontend_port: 8080
rgw_zone_user: edward.lewis
rgw_zone_user_display_name: "Edward Lewis"
system_access_key: yu17wkvAx3B8Wyn08XoF
system_secret_key: 5YZfaSUPqxSNIkZQQA3lBZ495hnIV6k2HAz710BY
```
2019-09-11 06:01:48 +08:00
2020-09-03 15:01:16 +08:00
**Note:** Since `rgw_realm` , `rgw_zonegroup` , and `rgw_zone` differ between files, a new realm, zonegroup, and master zone are created containing rgw-001 and rgw-002 respectively.
2020-04-17 03:47:17 +08:00
2020-09-03 15:01:16 +08:00
**Note:** `rgw_zonegroupmaster` is set to true in each of the files since it will be the only zonegroup in each realm.
2020-04-17 03:47:17 +08:00
2020-09-03 15:01:16 +08:00
**Note:** `rgw_zonemaster` should have the value of `true` and `rgw_zonesecondary` should be `false` .
2020-04-17 03:47:17 +08:00
2020-09-03 15:01:16 +08:00
**Note:** replace the `system_access_key` and `system_secret_key` values with the ones you generated.
2020-04-17 03:47:17 +08:00
2020-09-03 15:01:16 +08:00
4. Run the ceph-ansible playbook on your cluster
2020-04-17 03:47:17 +08:00
2020-09-03 15:01:16 +08:00
### Conclusion
2020-04-17 03:47:17 +08:00
2020-09-03 15:01:16 +08:00
The RGWs in the deployed cluster will be split up into 2 realms: `france` and `usa` . France has a zonegroup named `idf` and usa has one called `alaska` .
`Idf` has a master zone called `paris` . `Alaska` has a master zone called `juneau` .
2020-04-17 03:47:17 +08:00
2020-09-03 15:01:16 +08:00
## Deployment Scenario #3: Multiple Realms over Multiple Ceph Clusters
2019-09-11 06:01:48 +08:00
2020-04-17 03:47:17 +08:00
The multisite playbooks in ceph-ansible are flexible enough to create many realms, zonegroups, and zones that span many clusters.
2019-09-11 06:01:48 +08:00
2020-04-17 03:47:17 +08:00
A multisite configuration consisting of multiple realms across multiple clusters can be configured by having files in `host_vars` for the rgws in each cluster similar to scenario #2 .
2016-08-17 02:57:01 +08:00
2020-04-17 03:47:17 +08:00
The host_vars for the rgws in the second cluster would have `rgw_zonesecondary` set to true and the additional `rgw_pull` variables as seen in scenario #2
2019-10-05 03:31:25 +08:00
2020-04-17 03:47:17 +08:00
The inventory for the rgws section of the master cluster for this example looks like:
2016-08-17 02:57:01 +08:00
2020-09-03 15:01:16 +08:00
```ansible-inventory
2020-04-17 03:47:17 +08:00
[rgws]
2020-09-03 15:01:16 +08:00
rgw-001 ansible_ssh_host=192.168.216.145 ansible_ssh_port=22 radosgw_address=192.168.216.145
rgw-002 ansible_ssh_host=192.168.215.178 ansible_ssh_port=22 radosgw_address=192.168.215.178
2020-04-17 03:47:17 +08:00
```
The inventory for the rgws section of the secondary cluster for this example looks like:
2020-09-03 15:01:16 +08:00
```ansible-inventory
2020-04-17 03:47:17 +08:00
[rgws]
2020-09-03 15:01:16 +08:00
rgw-003 ansible_ssh_host=192.168.215.178 ansible_ssh_port=22 radosgw_address=192.168.215.199
rgw-004 ansible_ssh_host=192.168.215.178 ansible_ssh_port=22 radosgw_address=192.168.194.109
2020-04-17 03:47:17 +08:00
```
2020-09-03 15:01:16 +08:00
### Requirements
2020-04-17 03:47:17 +08:00
* At least 2 Ceph clusters
* at least 2 RGW in the master cluster and the secondary clusters
* Jewel or newer
1. Generate System Access and System Secret Keys for each realm
2019-10-05 03:31:25 +08:00
2020-09-03 15:01:16 +08:00
```bash
echo system_access_key: $(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 20 | head -n 1) > multi-site-keys-realm-1.txt
echo system_secret_key: $(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 40 | head -n 1) >> multi-site-keys-realm-1.txt
2020-04-17 03:47:17 +08:00
2020-09-03 15:01:16 +08:00
echo system_access_key: $(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 20 | head -n 1) > multi-site-keys-realm-2.txt
echo system_secret_key: $(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 40 | head -n 1) >> multi-site-keys-realm-2.txt
...
```
2020-04-17 03:47:17 +08:00
2. Edit `group_vars/all.yml` for the cluster
2019-10-05 03:31:25 +08:00
2020-09-03 15:01:16 +08:00
```yaml
rgw_multisite: true
```
2020-04-17 03:47:17 +08:00
2020-09-03 15:01:16 +08:00
As per the previous example, all values set here will be set on all rgw hosts.
2020-04-17 03:47:17 +08:00
3. Create & edit files in `host_vars/` to create realms, zonegroups, and master zones on cluster #1 .
2020-09-03 15:01:16 +08:00
Here is an example of the file `host_vars/rgw-001` for the the master cluster.
2020-04-17 03:47:17 +08:00
2020-09-03 15:01:16 +08:00
```yaml
rgw_zonemaster: true
rgw_zonesecondary: false
rgw_zonegroupmaster: true
rgw_multisite_proto: http
rgw_realm: france
rgw_zonegroup: idf
rgw_zone: paris
radosgw_address: "{{ _radosgw_address }}"
radosgw_frontend_port: 8080
rgw_zone_user: jacques.chirac
rgw_zone_user_display_name: "Jacques Chirac"
system_access_key: P9Eb6S8XNyo4dtZZUUMy
system_secret_key: qqHCUtfdNnpHq3PZRHW5un9l0bEBM812Uhow0XfB
```
2020-04-17 03:47:17 +08:00
2020-09-03 15:01:16 +08:00
Here is an example of the file `host_vars/rgw-002` for the the master cluster.
2020-04-17 03:47:17 +08:00
2020-09-03 15:01:16 +08:00
```yaml
rgw_zonemaster: true
rgw_zonesecondary: false
rgw_zonegroupmaster: true
rgw_multisite_proto: http
rgw_realm: usa
rgw_zonegroup: alaska
rgw_zone: juneau
radosgw_address: "{{ _radosgw_address }}"
radosgw_frontend_port: 8080
rgw_zone_user: edward.lewis
rgw_zone_user_display_name: "Edward Lewis"
system_access_key: yu17wkvAx3B8Wyn08XoF
system_secret_key: 5YZfaSUPqxSNIkZQQA3lBZ495hnIV6k2HAz710BY
```
2020-04-17 03:47:17 +08:00
4. Run the ceph-ansible playbook on your master cluster.
5. Create & edit files in `host_vars/` for the entries in the `[rgws]` section of the inventory on the secondary cluster.
2020-09-03 15:01:16 +08:00
Here is an example of the file `host_vars/rgw-003` for the `rgw-003` entry in the `[rgws]` section for a secondary cluster.
2020-04-17 03:47:17 +08:00
2020-09-03 15:01:16 +08:00
```yaml
rgw_zonemaster: false
rgw_zonesecondary: true
rgw_zonegroupmaster: true
rgw_multisite_proto: http
rgw_realm: france
rgw_zonegroup: idf
rgw_zone: versailles
radosgw_address: "{{ _radosgw_address }}"
radosgw_frontend_port: 8080
rgw_zone_user: jacques.chirac
rgw_zone_user_display_name: "Jacques Chirac"
system_access_key: P9Eb6S8XNyo4dtZZUUMy
system_secret_key: qqHCUtfdNnpHq3PZRHW5un9l0bEBM812Uhow0XfB
rgw_pull_proto: http
rgw_pull_port: 8080
rgw_pullhost: rgw-001-hostname
```
Here is an example of the file `host_vars/rgw-004` for the `rgw-004` entry in the `[rgws]` section for a secondary cluster.
```yaml
rgw_zonemaster: false
rgw_zonesecondary: true
rgw_zonegroupmaster: true
rgw_multisite_proto: http
rgw_realm: usa
rgw_zonegroup: alaska
rgw_zone: juneau
radosgw_address: "{{ _radosgw_address }}"
radosgw_frontend_port: 8080
rgw_zone_user: edward.lewis
rgw_zone_user_display_name: "Edward Lewis"
system_access_key: yu17wkvAx3B8Wyn08XoF
system_secret_key: 5YZfaSUPqxSNIkZQQA3lBZ495hnIV6k2HAz710BY
rgw_pull_proto: http
rgw_pull_port: 8080
rgw_pullhost: rgw-002-hostname
```
2020-04-17 03:47:17 +08:00
6. Run the ceph-ansible playbook on your secondary cluster.
2020-09-03 15:01:16 +08:00
### Conclusion
2019-02-01 04:43:21 +08:00
2020-09-03 15:01:16 +08:00
There will be 2 realms in this configuration, `france` and `usa` , with RGWs and RGW zones in both clusters. Cluster0 will has the master zones and Cluster1 has the secondary zones.
2020-04-23 23:12:13 +08:00
Data is realm france will be replicated over both clusters and remain isolated from rgws in realm usa and vice versa.
2019-02-01 04:43:21 +08:00
2020-09-03 15:01:16 +08:00
## Deployment Scenario #4: Multiple Realms over Multiple Ceph Clusters with Multiple Instances
2019-02-01 04:43:21 +08:00
2020-04-17 03:47:17 +08:00
More than 1 RGW can be running on a single host. To configure multisite for a host with more than one rgw instance running on the host, `rgw_instances` must be configured.
2020-09-03 15:01:16 +08:00
Each item in `rgw_instances` (declared in a host_vars file) represents an RGW on that host. In each item is the multisite configuration for that RGW.
2020-04-17 03:47:17 +08:00
Here is an example:
2019-09-11 06:01:48 +08:00
2020-09-03 15:01:16 +08:00
```yaml
2020-04-17 03:47:17 +08:00
rgw_instances:
2020-04-28 06:04:58 +08:00
- instance_name: rgw1
rgw_realm: usa
rgw_zonegroup: alaska
rgw_zone: juneau
2020-04-17 03:47:17 +08:00
radosgw_address: "{{ _radosgw_address }}"
radosgw_frontend_port: 8080
rgw_zone_user: edward.lewis
rgw_zone_user_display_name: "Edward Lewis"
system_access_key: yu17wkvAx3B8Wyn08XoF
system_secret_key: 5YZfaSUPqxSNIkZQQA3lBZ495hnIV6k2HAz710BY
2019-09-11 06:01:48 +08:00
```
2020-09-03 15:01:16 +08:00
### Setting rgw_instances for a host in the master zone
2020-04-23 23:12:13 +08:00
2020-04-28 06:04:58 +08:00
Here is an example of a host_vars for a host (ex: rgw-001 in the examples) containing 2 rgw_instances:
2019-09-11 06:01:48 +08:00
2020-09-03 15:01:16 +08:00
```yaml
2020-04-17 03:47:17 +08:00
rgw_zonemaster: true
rgw_zonesecondary: false
rgw_zonegroupmaster: true
2020-04-28 06:04:58 +08:00
rgw_multisite_proto: http
2020-04-17 03:47:17 +08:00
rgw_instances:
2020-04-28 06:04:58 +08:00
- instance_name: rgw1
rgw_realm: usa
rgw_zonegroup: alaska
rgw_zone: juneau
2020-04-17 03:47:17 +08:00
radosgw_address: "{{ _radosgw_address }}"
radosgw_frontend_port: 8080
rgw_zone_user: edward.lewis
rgw_zone_user_display_name: "Edward Lewis"
system_access_key: yu17wkvAx3B8Wyn08XoF
system_secret_key: 5YZfaSUPqxSNIkZQQA3lBZ495hnIV6k2HAz710BY
2020-04-28 06:04:58 +08:00
- instance_name: rgw2
rgw_realm: france
rgw_zonegroup: idf
rgw_zone: paris
2020-04-17 03:47:17 +08:00
radosgw_address: "{{ _radosgw_address }}"
radosgw_frontend_port: 8081
rgw_zone_user: jacques.chirac
rgw_zone_user_display_name: "Jacques Chirac"
system_access_key: P9Eb6S8XNyo4dtZZUUMy
system_secret_key: qqHCUtfdNnpHq3PZRHW5un9l0bEBM812Uhow0XfB
```
2019-09-11 06:01:48 +08:00
2020-09-03 15:01:16 +08:00
This example starts up 2 rgws on host rgw-001. `rgw1` is configured to be in realm usa and `rgw2` is configured to be in realm france.
2016-08-17 02:57:01 +08:00
2020-04-17 03:47:17 +08:00
The variables `rgw_zonemaster` , `rgw_zonesecondary` , `rgw_zonegroupmaster` , `rgw_multisite_proto` cannot be set in an item of rgw_instances. All of these variables must be set in group_vars/ or host_vars/.
2020-09-03 15:01:16 +08:00
### Setting rgw_instances for a host in a secondary zone
2020-04-23 23:12:13 +08:00
To start up multiple rgws on a host that are in a secondary zone, `endpoint` must be added to rgw_instances.
2020-09-03 15:01:16 +08:00
The value of `endpoint` should be the endpoint of an RGW in the master zone of the realm that is resolvable from the host.`rgw_pull_{proto, host, port}` are not necessary since `endpoint` is a combination of all three.
2020-04-23 23:12:13 +08:00
Here is an example of a host_vars for a host containing 2 rgw_instances in a secondary zone:
2020-09-03 15:01:16 +08:00
```yaml
2020-04-23 23:12:13 +08:00
rgw_zonemaster: false
rgw_zonesecondary: true
rgw_zonegroupmaster: true
rgw_multisite_proto: "http"
rgw_instances:
2020-04-28 06:04:58 +08:00
- instance_name: rgw3
rgw_realm: usa
rgw_zonegroup: alaska
rgw_zone: fairbanks
2020-04-23 23:12:13 +08:00
radosgw_address: "{{ _radosgw_address }}"
radosgw_frontend_port: 8080
rgw_zone_user: edward.lewis
rgw_zone_user_display_name: "Edward Lewis"
system_access_key: yu17wkvAx3B8Wyn08XoF
system_secret_key: 5YZfaSUPqxSNIkZQQA3lBZ495hnIV6k2HAz710BY
2020-04-28 06:04:58 +08:00
endpoint: https://rgw-001-hostname:8080
- instance_name: rgw4
rgw_realm: france
rgw_zonegroup: idf
rgw_zone: versailles
2020-04-23 23:12:13 +08:00
radosgw_address: "{{ _radosgw_address }}"
radosgw_frontend_port: 8081
rgw_zone_user: jacques.chirac
rgw_zone_user_display_name: "Jacques Chirac"
system_access_key: P9Eb6S8XNyo4dtZZUUMy
system_secret_key: qqHCUtfdNnpHq3PZRHW5un9l0bEBM812Uhow0XfB
2020-04-28 06:04:58 +08:00
endpoint: https://rgw-001-hostname:8081
2020-04-23 23:12:13 +08:00
```
2020-09-03 15:01:16 +08:00
This example starts up 2 rgws on the host that will pull the realm from the rgws on rgw-001 above. `rgw3` is pulling from the rgw endpoint in realm usa in the master zone example above (instance name rgw1). `rgw4` is pulling from the rgw endpoint in realm france in the master zone example above (instance name rgw2).
2020-04-23 23:12:13 +08:00
Just like the example on the master zone, the variables `rgw_zonemaster` , `rgw_zonesecondary` , `rgw_zonegroupmaster` , `rgw_multisite_proto` cannot be set in an item of rgw_instances. All of these variables must be set in group_vars/ or host_vars/.
2020-09-03 15:01:16 +08:00
### Conclusion
2020-04-23 23:12:13 +08:00
2020-04-17 03:47:17 +08:00
`rgw_instances` can be used in host_vars for multisite deployments like scenarios 2 and 3