]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
rgw multisite: add more than 1 rgw to the master or secondary zone
authorAli Maredia <amaredia@redhat.com>
Thu, 31 Jan 2019 20:43:21 +0000 (20:43 +0000)
committerGuillaume Abrioux <gabrioux@redhat.com>
Sat, 6 Apr 2019 06:01:19 +0000 (08:01 +0200)
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1664869
Signed-off-by: Ali Maredia <amaredia@redhat.com>
12 files changed:
README-MULTISITE.md
group_vars/all.yml.sample
group_vars/rhcs.yml.sample
roles/ceph-defaults/defaults/main.yml
roles/ceph-rgw/tasks/multisite/master.yml
roles/ceph-rgw/tasks/multisite/secondary.yml
tests/functional/rgw-multisite/container/group_vars/rgws
tests/functional/rgw-multisite/container/hosts
tests/functional/rgw-multisite/container/secondary/hosts
tests/functional/rgw-multisite/group_vars/rgws
tests/functional/rgw-multisite/hosts
tests/functional/rgw-multisite/secondary/hosts

index a921a35b88921af8bcdaa0e3b940b8795b6d8fb6..ef4dc4b4dc5fa80207bf02b155ba62964c5aaa15 100644 (file)
@@ -33,7 +33,9 @@ rgw_multisite: true
 rgw_zone: jupiter
 rgw_zonemaster: true
 rgw_zonesecondary: false
+rgw_multisite_proto: "http"
 rgw_multisite_endpoint_addr: "{{ ansible_fqdn }}"
+rgw_multisite_endpoints_list: "{{ rgw_multisite_proto }}://{{ ansible_fqdn }}:{{ radosgw_frontend_port }}"
 rgw_zonegroup: solarsystem
 rgw_zone_user: zone.user
 rgw_realm: milkyway
@@ -41,9 +43,17 @@ system_access_key: 6kWkikvapSnHyE22P7nO
 system_secret_key: MGecsMrWtKZgngOHZdrd6d3JxGO5CPWgT2lcnpSt
 ```
 
-**Note:** rgw_zonemaster should have the value of true and rgw_zonesecondary should be false
-**Note:** replace the system_access_key and system_secret_key values with the ones you generated
-**Note:** `ansible_fqdn` domain name assigned to rgw_multisite_endpoint_addr must be resolvable from the secondary Ceph cluster's mon and rgw node(s)
+**Note:** `rgw_zonemaster` should have the value of `true` and `rgw_zonesecondary` should be `false`
+
+**Note:** replace the `system_access_key` and `system_secret_key` values with the ones you generated
+
+**Note:** `ansible_fqdn` domain name assigned to `rgw_multisite_endpoint_addr` must be resolvable from the secondary Ceph clusters mon and rgw node(s)
+
+**Note:** if there is more than 1 RGW in the cluster, `rgw_multisite_endpoints` needs to be set.<br/>
+`rgw_multisite_endpoints` is a comma seperated list, with no spaces, of the RGW endpoints in the format:<br/>
+`{{ rgw_multisite_proto }}://{{ ansible_fqdn }}:{{ radosgw_frontend_port }}`<br/>
+for example: `rgw_multisite_endpoints: http://foo.example.com:8080,http://bar.example.com:8080,http://baz.example.com:8080`
+
 
 3. Run the ceph-ansible playbook on your 1st cluster
 
@@ -58,7 +68,9 @@ rgw_multisite: true
 rgw_zone: mars
 rgw_zonemaster: false
 rgw_zonesecondary: true
+rgw_multisite_proto: "http"
 rgw_multisite_endpoint_addr: "{{ ansible_fqdn }}"
+rgw_multisite_endpoints_list: "{{ rgw_multisite_proto }}://{{ ansible_fqdn }}:{{ radosgw_frontend_port }}"
 rgw_zonegroup: solarsystem
 rgw_zone_user: zone.user
 rgw_realm: milkyway
@@ -69,10 +81,15 @@ rgw_pull_port: 8080
 rgw_pullhost: cluster0-rgw0
 ```
 
-**Note:** rgw_zonemaster should have the value of false and rgw_zonesecondary should be true
-**Note:** pullhost should be the rgw_multisite_endpoint_addr of the RGW that is configured as the Zone Master
-**Note:** rgw_zone_user, system_access_key, and system_secret_key should match what you used in the master cluster
-**Note:** `ansible_fqdn` domain name assigned to rgw_multisite_endpoint_addr must be resolvable from the master Ceph cluster's mon and rgw node(s)
+**Note:** `rgw_zonemaster` should have the value of `false` and `rgw_zonesecondary` should be `true`
+
+**Note:** `rgw_pullhost` should be the `rgw_multisite_endpoint_addr` of the RGW that is configured in the Primary Cluster
+
+**Note:** `rgw_zone_user`, `system_access_key`, and `system_secret_key` should match what you used in the Primary Cluster
+
+**Note:** `ansible_fqdn` domain name assigned to `rgw_multisite_endpoint_addr` must be resolvable from the Primary Ceph cluster's mon and rgw node(s)
+
+**Note:** if there is more than 1 RGW in the Secondary Cluster, `rgw_multisite_endpoints` needs to be set with the RGWs in the Secondary Cluster just like it was set in the Primary Cluster
 
 5. Run the ceph-ansible playbook on your 2nd cluster
 
index b28c78034e713f61780d42ebf5351fb7541bbc5c..bdaeea97892ad523b94a154b5d608be268f134e5 100644 (file)
@@ -478,13 +478,22 @@ dummy:
 #rgw_multisite: false
 
 # The following Multi-site related variables should be set by the user.
+#
+# If there is more than 1 RGW in a master or secondary cluster than rgw_multisite_endpoints needs to be a comma seperated list (with no spaces) of the RGW endpoints in the format:
+# {{ rgw_multisite_proto }}://{{ ansible_fqdn }}:{{ radosgw_frontend_port }}
+# ex: rgw_multisite_endpoints: http://foo.example.com:8080,http://bar.example.com:8080,http://baz.example.com:8080
+#
+# If there is only 1 RGW in the inventory, rgw_multisite_endpoints does not need to change
+#
 # 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". See README-MULTISITE.md for an example.
 #rgw_zone: default
 
 #rgw_zonemaster: true
 #rgw_zonesecondary: false
+#rgw_multisite_proto: "http"
 #rgw_multisite_endpoint_addr: "{{ ansible_fqdn }}"
+#rgw_multisite_endpoints_list: "{{ rgw_multisite_proto }}://{{ ansible_fqdn }}:{{ radosgw_frontend_port }}"
 #rgw_zonegroup: solarsystem # should be set by the user
 #rgw_zone_user: zone.user
 #rgw_realm: milkyway # should be set by the user
@@ -493,8 +502,8 @@ dummy:
 
 # Multi-site remote pull URL variables
 #rgw_pull_port: "{{ radosgw_civetweb_port }}"
-#rgw_pull_proto: "http"
-#rgw_pullhost: localhost # rgw_pullhost only needs to be declared if there is a zone secondary. It should be the same as rgw_multisite_endpoint_addr for the master cluster
+#rgw_pull_proto: "http" # should be the same as rgw_multisite_proto for the master zone cluster
+#rgw_pullhost: localhost # rgw_pullhost only needs to be declared if there is a zone secondary. It should be the same as rgw_multisite_endpoint_addr for the master zone cluster
 
 
 ###################
index 28b745834ff1e28cf3e31fe91116f0c53b9b3f8c..124f3e4c4d44e4ac9126e85410fa087325ff07ca 100644 (file)
@@ -478,13 +478,22 @@ ceph_rhcs_version: 3
 #rgw_multisite: false
 
 # The following Multi-site related variables should be set by the user.
+#
+# If there is more than 1 RGW in a master or secondary cluster than rgw_multisite_endpoints needs to be a comma seperated list (with no spaces) of the RGW endpoints in the format:
+# {{ rgw_multisite_proto }}://{{ ansible_fqdn }}:{{ radosgw_frontend_port }}
+# ex: rgw_multisite_endpoints: http://foo.example.com:8080,http://bar.example.com:8080,http://baz.example.com:8080
+#
+# If there is only 1 RGW in the inventory, rgw_multisite_endpoints does not need to change
+#
 # 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". See README-MULTISITE.md for an example.
 #rgw_zone: default
 
 #rgw_zonemaster: true
 #rgw_zonesecondary: false
+#rgw_multisite_proto: "http"
 #rgw_multisite_endpoint_addr: "{{ ansible_fqdn }}"
+#rgw_multisite_endpoints_list: "{{ rgw_multisite_proto }}://{{ ansible_fqdn }}:{{ radosgw_frontend_port }}"
 #rgw_zonegroup: solarsystem # should be set by the user
 #rgw_zone_user: zone.user
 #rgw_realm: milkyway # should be set by the user
@@ -493,8 +502,8 @@ ceph_rhcs_version: 3
 
 # Multi-site remote pull URL variables
 #rgw_pull_port: "{{ radosgw_civetweb_port }}"
-#rgw_pull_proto: "http"
-#rgw_pullhost: localhost # rgw_pullhost only needs to be declared if there is a zone secondary. It should be the same as rgw_multisite_endpoint_addr for the master cluster
+#rgw_pull_proto: "http" # should be the same as rgw_multisite_proto for the master zone cluster
+#rgw_pullhost: localhost # rgw_pullhost only needs to be declared if there is a zone secondary. It should be the same as rgw_multisite_endpoint_addr for the master zone cluster
 
 
 ###################
index 798e9064938f87ce32917e0122a05ed596e8cd39..db56b08775f2e10286e2c3b339b5702ee78cbe85 100644 (file)
@@ -470,13 +470,22 @@ nfs_obj_gw: true
 rgw_multisite: false
 
 # The following Multi-site related variables should be set by the user.
+#
+# If there is more than 1 RGW in a master or secondary cluster than rgw_multisite_endpoints needs to be a comma seperated list (with no spaces) of the RGW endpoints in the format:
+# {{ rgw_multisite_proto }}://{{ ansible_fqdn }}:{{ radosgw_frontend_port }}
+# ex: rgw_multisite_endpoints: http://foo.example.com:8080,http://bar.example.com:8080,http://baz.example.com:8080
+#
+# If there is only 1 RGW in the inventory, rgw_multisite_endpoints does not need to change
+#
 # 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". See README-MULTISITE.md for an example.
 rgw_zone: default
 
 rgw_zonemaster: true
 rgw_zonesecondary: false
+rgw_multisite_proto: "http"
 rgw_multisite_endpoint_addr: "{{ ansible_fqdn }}"
+#rgw_multisite_endpoints_list: "{{ rgw_multisite_proto }}://{{ ansible_fqdn }}:{{ radosgw_frontend_port }}"
 #rgw_zonegroup: solarsystem # should be set by the user
 #rgw_zone_user: zone.user
 #rgw_realm: milkyway # should be set by the user
@@ -485,8 +494,8 @@ rgw_multisite_endpoint_addr: "{{ ansible_fqdn }}"
 
 # Multi-site remote pull URL variables
 rgw_pull_port: "{{ radosgw_civetweb_port }}"
-rgw_pull_proto: "http"
-#rgw_pullhost: localhost # rgw_pullhost only needs to be declared if there is a zone secondary. It should be the same as rgw_multisite_endpoint_addr for the master cluster
+rgw_pull_proto: "http" # should be the same as rgw_multisite_proto for the master zone cluster
+#rgw_pullhost: localhost # rgw_pullhost only needs to be declared if there is a zone secondary. It should be the same as rgw_multisite_endpoint_addr for the master zone cluster
 
 
 ###################
index 8982e960e4c42fcc87197a25fb653c32039abf21..26449f3f33bddf588a4700a984fa5b23c082a157 100644 (file)
@@ -7,14 +7,14 @@
     - "'No such file or directory' in realmcheck.stderr"
 
 - name: create the zonegroup
-  command: "{{ docker_exec_cmd }} radosgw-admin zonegroup create --rgw-zonegroup={{ rgw_zonegroup }} --endpoints=http://{{ rgw_multisite_endpoint_addr }}:{{ radosgw_frontend_port }} --master --default"
+  command: "{{ docker_exec_cmd }} radosgw-admin zonegroup create --rgw-zonegroup={{ rgw_zonegroup }} --endpoints={{ rgw_multisite_proto }}://{{ rgw_multisite_endpoint_addr }}:{{ radosgw_frontend_port }} --master --default"
   delegate_to: "{{ groups[mon_group_name][0] }}"
   run_once: true
   when:
     - "'No such file or directory' in zonegroupcheck.stderr"
 
 - name: create the zone
-  command: "{{ docker_exec_cmd }} radosgw-admin zone create --rgw-zonegroup={{ rgw_zonegroup }} --rgw-zone={{ rgw_zone }} --endpoints=http://{{ rgw_multisite_endpoint_addr }}:{{ radosgw_frontend_port }} --access-key={{ system_access_key }} --secret={{ system_secret_key }} --default --master"
+  command: "{{ docker_exec_cmd }} radosgw-admin zone create --rgw-zonegroup={{ rgw_zonegroup }} --rgw-zone={{ rgw_zone }} --endpoints={{ rgw_multisite_proto }}://{{ rgw_multisite_endpoint_addr }}:{{ radosgw_frontend_port }} --access-key={{ system_access_key }} --secret={{ system_secret_key }} --default --master"
   delegate_to: "{{ groups[mon_group_name][0] }}"
   run_once: true
   when:
     - "'could not fetch user info: no user info saved' in usercheck.stderr"
   notify:
     - update period
+
+- name: add other endpoints to the zone
+  command: "{{ docker_exec_cmd }} radosgw-admin zone modify --rgw-zone={{ rgw_zone }} --endpoints {{ rgw_multisite_endpoints_list }}" 
+  delegate_to: "{{ groups[mon_group_name][0] }}"
+  run_once: true
+  when:
+    - rgw_multisite_endpoints_list is defined
+  notify:
+    - update period
index 413749c9d6ddd75471f785219bf5084e4e5c6408..24a44cf46bfc80121ccdf1b1cc9beeff53c7595b 100644 (file)
   run_once: true
 
 - name: create the zone
-  command: "{{ docker_exec_cmd }} radosgw-admin zone create --rgw-zonegroup={{ rgw_zonegroup }} --rgw-zone={{ rgw_zone }} --endpoints=http://{{ rgw_multisite_endpoint_addr }}:{{ radosgw_frontend_port }} --access-key={{ system_access_key }} --secret={{ system_secret_key }} --default"
+  command: "{{ docker_exec_cmd }} radosgw-admin zone create --rgw-zonegroup={{ rgw_zonegroup }} --rgw-zone={{ rgw_zone }} --endpoints={{ rgw_multisite_proto }}://{{ rgw_multisite_endpoint_addr }}:{{ radosgw_frontend_port }} --access-key={{ system_access_key }} --secret={{ system_secret_key }} --default"
   delegate_to: "{{ groups[mon_group_name][0] }}"
   run_once: true
   when:
     - "'No such file or directory' in zonecheck.stderr"
   notify:
     - update period
+
+- name: add other endpoints to the zone
+  command: "{{ docker_exec_cmd }} radosgw-admin zone modify --rgw-zone={{ rgw_zone }} --endpoints {{ rgw_multisite_endpoints_list }}" 
+  delegate_to: "{{ groups[mon_group_name][0] }}"
+  run_once: true
+  when:
+    - rgw_multisite_endpoints_list is defined
+  notify:
+    - update period
index 6ecc36f69d193647c1b961c6dd3775f3f13fd918..23b6f80d8e4c1a5a51c52acbf9e414ff27b793a2 100644 (file)
@@ -5,6 +5,7 @@ rgw_multisite: true
 rgw_zone: jupiter
 rgw_zonemaster: true
 rgw_zonesecondary: false
+rgw_multisite_proto: http
 rgw_zonegroup: solarsystem
 rgw_zone_user: zone.user
 rgw_realm: milkyway
@@ -16,4 +17,4 @@ rgw_create_pools:
   bar:
     pg_num: 19
 rgw_override_bucket_index_max_shards: 16
-rgw_bucket_default_quota_max_objects: 1638400
\ No newline at end of file
+rgw_bucket_default_quota_max_objects: 1638400
index 3901c5a3f37eecb1034d5317b8f01953259e20ea..6c57190d7ed3601c8f6db6ca037e5a16cd63b67b 100644 (file)
@@ -5,4 +5,4 @@ mon0
 osd0
 
 [rgws]
-osd0 rgw_multisite_endpoint_addr=192.168.105.100
+osd0 rgw_multisite_proto=http rgw_multisite_endpoint_addr=192.168.105.100
index e2e0c30e4846488b4dad8f89ba89cc80e41b043b..7ba05df9a0a6795f2b4b53a55d03d6db2354ffe4 100644 (file)
@@ -5,4 +5,4 @@ mon0
 osd0
 
 [rgws]
-osd0 copy_admin_key=True rgw_multisite=True rgw_zone=mars rgw_zonemaster=False rgw_zonesecondary=True rgw_zonegroup=solarsystem rgw_zone_user=zone.user rgw_realm=milkyway rgw_multisite_endpoint_addr=192.168.107.100 system_access_key=6kWkikvapSnHyE22P7nO system_secret_key=MGecsMrWtKZgngOHZdrd6d3JxGO5CPWgT2lcnpSt rgw_pull_proto=http rgw_pull_port=8080 rgw_pullhost=192.168.105.100
+osd0 copy_admin_key=True rgw_multisite=True rgw_zone=mars rgw_zonemaster=False rgw_zonesecondary=True rgw_zonegroup=solarsystem rgw_zone_user=zone.user rgw_realm=milkyway rgw_multisite_proto=http rgw_multisite_endpoint_addr=192.168.107.100 system_access_key=6kWkikvapSnHyE22P7nO system_secret_key=MGecsMrWtKZgngOHZdrd6d3JxGO5CPWgT2lcnpSt rgw_pull_proto=http rgw_pull_port=8080 rgw_pullhost=192.168.105.100
index 6ecc36f69d193647c1b961c6dd3775f3f13fd918..23b6f80d8e4c1a5a51c52acbf9e414ff27b793a2 100644 (file)
@@ -5,6 +5,7 @@ rgw_multisite: true
 rgw_zone: jupiter
 rgw_zonemaster: true
 rgw_zonesecondary: false
+rgw_multisite_proto: http
 rgw_zonegroup: solarsystem
 rgw_zone_user: zone.user
 rgw_realm: milkyway
@@ -16,4 +17,4 @@ rgw_create_pools:
   bar:
     pg_num: 19
 rgw_override_bucket_index_max_shards: 16
-rgw_bucket_default_quota_max_objects: 1638400
\ No newline at end of file
+rgw_bucket_default_quota_max_objects: 1638400
index 2450624898e1c3a1e9a2c74c8447a95e7c9e5410..48c12701d9a89a5eb7b5f797f820d04715dd6e68 100644 (file)
@@ -5,4 +5,4 @@ mon0
 osd0
 
 [rgws]
-osd0 rgw_multisite_endpoint_addr=192.168.101.100
+osd0 rgw_multisite_proto=http rgw_multisite_endpoint_addr=192.168.101.100
index 2e1a40ad387ad692151d12ef07c7d76590b10e54..1e119a24fb605e2d95a8767b0b0c1264d52f1513 100644 (file)
@@ -5,4 +5,4 @@ mon0
 osd0
 
 [rgws]
-osd0 rgw_multisite=True rgw_zone=mars rgw_zonemaster=False rgw_zonesecondary=True rgw_zonegroup=solarsystem rgw_zone_user=zone.user rgw_realm=milkyway rgw_multisite_endpoint_addr=192.168.103.100 system_access_key=6kWkikvapSnHyE22P7nO system_secret_key=MGecsMrWtKZgngOHZdrd6d3JxGO5CPWgT2lcnpSt rgw_pull_proto=http rgw_pull_port=8080 rgw_pullhost=192.168.101.100
+osd0 rgw_multisite=True rgw_zone=mars rgw_zonemaster=False rgw_zonesecondary=True rgw_zonegroup=solarsystem rgw_zone_user=zone.user rgw_realm=milkyway rgw_multisite_proto=http rgw_multisite_endpoint_addr=192.168.103.100 system_access_key=6kWkikvapSnHyE22P7nO system_secret_key=MGecsMrWtKZgngOHZdrd6d3JxGO5CPWgT2lcnpSt rgw_pull_proto=http rgw_pull_port=8080 rgw_pullhost=192.168.101.100