openstack-ansible/doc/source/draft-operations-guide/maintenance-tasks/managing-swift.rst
Alexandra Settle df1bd3b6e0 [ops-guide] Adding new content to guide
This patch is to simply create the ToC in the draft folder and to
add pre-existing content. Edits will come later. Please review
based on structure only.

Change-Id: I9fa7754f3f6cdf1c861a146a93acf675c74f8a8b
Implements: blueprint create-ops-guide
2016-12-21 16:16:29 +00:00

2.6 KiB

Managing Object Storage for multiple regions

This is a draft Object Storage page for the proposed OpenStack-Ansible operations guide.

Failovers for multi-region Object Storage

In multi-region Object Storage, objects are retrievable from an alternate location if the default location becomes unavailable.

Important

It is recommended to perform the following steps before a failure occurs to avoid having to dump and restore the database.

If a failure does occur, follow these steps to restore the database from the Primary (failed) Region:

  1. Record the Primary Region output of the default_project_id for the specified user from the user table in the keystone database:

    Note

    The user is admin in this example.

    # mysql -e "SELECT default_project_id from keystone.user WHERE \
      name='admin';"
    
    +----------------------------------+
    | default_project_id               |
    +----------------------------------+
    | 76ef6df109744a03b64ffaad2a7cf504 |
    +-----------------—————————————————+
  2. Record the Secondary Region output of the default_project_id for the specified user from the user table in the keystone database:

    # mysql -e "SELECT default_project_id from keystone.user WHERE \
      name='admin';"
    
    +----------------------------------+
    | default_project_id               |
    +----------------------------------+
    | 69c46f8ad1cf4a058aa76640985c     |
    +----------------------------------+
  3. In the Secondary Region, update the references to the project_id to match the ID from the Primary Region:

    # export PRIMARY_REGION_TENANT_ID="76ef6df109744a03b64ffaad2a7cf504"
    # export SECONDARY_REGION_TENANT_ID="69c46f8ad1cf4a058aa76640985c"
    
    # mysql -e "UPDATE keystone.assignment set \
    target_id='${PRIMARY_REGION_TENANT_ID}' \
    WHERE target_id='${SECONDARY_REGION_TENANT_ID}';"
    
    # mysql -e "UPDATE keystone.user set \
    default_project_id='${PRIMARY_REGION_TENANT_ID}' WHERE \
    default_project_id='${SECONDARY_REGION_TENANT_ID}';"
    
    # mysql -e "UPDATE keystone.project set \
    id='${PRIMARY_REGION_TENANT_ID}' WHERE \
    id='${SECONDARY_REGION_TENANT_ID}';"

The user in the Secondary Region now has access to objects PUT in the Primary Region. The Secondary Region can PUT objects accessible by the user in the Primary Region.