Enable Swift Recon

This commit adds the necessary configuration to the Swift account,
container and object configuration files to enable the Swift recon
cli.

In order to give the object server on each Swift host access to the
recon files, a Docker volume is mounted into each container which
generates them. The volume is then mounted read only into the object
server container. Note that multiple containers append to the same
file. This should not be a problem since Swift uses a lock when
appending.

Change-Id: I343d8f45a78ebc3c11ed0c68fe8bec24f9ea7929
Co-authored-by: Doug Szumski <doug@stackhpc.com>
This commit is contained in:
Scott Solkhon 2019-08-13 12:35:46 +00:00 committed by Scott Solkhon
parent 17029c7e71
commit d463d3f7bf
7 changed files with 79 additions and 6 deletions

View File

@ -627,6 +627,7 @@ enable_solum: "no"
enable_storm: "{{ enable_monasca | bool }}" enable_storm: "{{ enable_monasca | bool }}"
enable_swift: "no" enable_swift: "no"
enable_swift_s3api: "no" enable_swift_s3api: "no"
enable_swift_recon: "no"
enable_tacker: "no" enable_tacker: "no"
enable_telegraf: "no" enable_telegraf: "no"
enable_tempest: "no" enable_tempest: "no"

View File

@ -74,6 +74,7 @@
- "{{ node_config_directory }}/swift-account-auditor/:{{ container_config_directory }}/:ro" - "{{ node_config_directory }}/swift-account-auditor/:{{ container_config_directory }}/:ro"
- "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}:shared" - "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}:shared"
- "/etc/localtime:/etc/localtime:ro" - "/etc/localtime:/etc/localtime:ro"
- "swift_recon_cache:/var/cache/swift"
when: inventory_hostname in groups['swift-account-server'] when: inventory_hostname in groups['swift-account-server']
- name: Starting swift-account-replication-server container - name: Starting swift-account-replication-server container
@ -108,6 +109,7 @@
- "{{ node_config_directory }}/swift-account-replicator/:{{ container_config_directory }}/:ro" - "{{ node_config_directory }}/swift-account-replicator/:{{ container_config_directory }}/:ro"
- "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}:shared" - "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}:shared"
- "/etc/localtime:/etc/localtime:ro" - "/etc/localtime:/etc/localtime:ro"
- "swift_recon_cache:/var/cache/swift"
when: inventory_hostname in groups['swift-account-server'] when: inventory_hostname in groups['swift-account-server']
- name: Starting swift-account-reaper container - name: Starting swift-account-reaper container
@ -150,6 +152,7 @@
- "{{ node_config_directory }}/swift-container-auditor/:{{ container_config_directory }}/:ro" - "{{ node_config_directory }}/swift-container-auditor/:{{ container_config_directory }}/:ro"
- "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}:shared" - "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}:shared"
- "/etc/localtime:/etc/localtime:ro" - "/etc/localtime:/etc/localtime:ro"
- "swift_recon_cache:/var/cache/swift"
when: inventory_hostname in groups['swift-container-server'] when: inventory_hostname in groups['swift-container-server']
- name: Starting swift-container-replication-server container - name: Starting swift-container-replication-server container
@ -184,6 +187,7 @@
- "{{ node_config_directory }}/swift-container-replicator/:{{ container_config_directory }}/:ro" - "{{ node_config_directory }}/swift-container-replicator/:{{ container_config_directory }}/:ro"
- "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}:shared" - "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}:shared"
- "/etc/localtime:/etc/localtime:ro" - "/etc/localtime:/etc/localtime:ro"
- "swift_recon_cache:/var/cache/swift"
when: inventory_hostname in groups['swift-container-server'] when: inventory_hostname in groups['swift-container-server']
- name: Starting swift-container-updater container - name: Starting swift-container-updater container
@ -198,6 +202,7 @@
- "{{ node_config_directory }}/swift-container-updater/:{{ container_config_directory }}/:ro" - "{{ node_config_directory }}/swift-container-updater/:{{ container_config_directory }}/:ro"
- "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}:shared" - "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}:shared"
- "/etc/localtime:/etc/localtime:ro" - "/etc/localtime:/etc/localtime:ro"
- "swift_recon_cache:/var/cache/swift"
when: inventory_hostname in groups['swift-container-server'] when: inventory_hostname in groups['swift-container-server']
- name: Starting swift-object-server container - name: Starting swift-object-server container
@ -212,6 +217,7 @@
- "{{ node_config_directory }}/swift-object-server/:{{ container_config_directory }}/:ro" - "{{ node_config_directory }}/swift-object-server/:{{ container_config_directory }}/:ro"
- "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}:shared" - "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}:shared"
- "/etc/localtime:/etc/localtime:ro" - "/etc/localtime:/etc/localtime:ro"
- "swift_recon_cache:/var/cache/swift:ro"
when: inventory_hostname in groups['swift-object-server'] when: inventory_hostname in groups['swift-object-server']
- name: Starting swift-object-auditor container - name: Starting swift-object-auditor container
@ -226,6 +232,7 @@
- "{{ node_config_directory }}/swift-object-auditor/:{{ container_config_directory }}/:ro" - "{{ node_config_directory }}/swift-object-auditor/:{{ container_config_directory }}/:ro"
- "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}:shared" - "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}:shared"
- "/etc/localtime:/etc/localtime:ro" - "/etc/localtime:/etc/localtime:ro"
- "swift_recon_cache:/var/cache/swift"
when: inventory_hostname in groups['swift-object-server'] when: inventory_hostname in groups['swift-object-server']
- name: Starting swift-object-replication-server container - name: Starting swift-object-replication-server container
@ -260,6 +267,7 @@
- "{{ node_config_directory }}/swift-object-replicator/:{{ container_config_directory }}/:ro" - "{{ node_config_directory }}/swift-object-replicator/:{{ container_config_directory }}/:ro"
- "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}:shared" - "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}:shared"
- "/etc/localtime:/etc/localtime:ro" - "/etc/localtime:/etc/localtime:ro"
- "swift_recon_cache:/var/cache/swift"
when: inventory_hostname in groups['swift-object-server'] when: inventory_hostname in groups['swift-object-server']
- name: Starting swift-object-updater container - name: Starting swift-object-updater container
@ -274,6 +282,7 @@
- "{{ node_config_directory }}/swift-object-updater/:{{ container_config_directory }}/:ro" - "{{ node_config_directory }}/swift-object-updater/:{{ container_config_directory }}/:ro"
- "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}:shared" - "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}:shared"
- "/etc/localtime:/etc/localtime:ro" - "/etc/localtime:/etc/localtime:ro"
- "swift_recon_cache:/var/cache/swift"
when: inventory_hostname in groups['swift-object-server'] when: inventory_hostname in groups['swift-object-server']
- name: Starting swift-object-expirer container - name: Starting swift-object-expirer container
@ -288,6 +297,7 @@
- "{{ node_config_directory }}/swift-object-expirer/:{{ container_config_directory }}/:ro" - "{{ node_config_directory }}/swift-object-expirer/:{{ container_config_directory }}/:ro"
- "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}:shared" - "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}:shared"
- "/etc/localtime:/etc/localtime:ro" - "/etc/localtime:/etc/localtime:ro"
- "swift_recon_cache:/var/cache/swift"
when: inventory_hostname in groups['swift-object-server'] when: inventory_hostname in groups['swift-object-server']
- name: Starting swift-proxy-server container - name: Starting swift-proxy-server container

View File

@ -12,7 +12,13 @@ log_level = {{ swift_log_level }}
workers = {{ openstack_service_workers }} workers = {{ openstack_service_workers }}
[pipeline:main] [pipeline:main]
pipeline = account-server pipeline = {% if enable_swift_recon %}recon {% endif %}account-server
{% if enable_swift_recon %}
[filter:recon]
use = egg:swift#recon
recon_cache_path = /var/cache/swift
{% endif %}
[app:account-server] [app:account-server]
use = egg:swift#account use = egg:swift#account

View File

@ -12,7 +12,13 @@ log_level = {{ swift_log_level }}
workers = {{ openstack_service_workers }} workers = {{ openstack_service_workers }}
[pipeline:main] [pipeline:main]
pipeline = container-server pipeline = {% if enable_swift_recon %}recon {% endif %}container-server
{% if enable_swift_recon %}
[filter:recon]
use = egg:swift#recon
recon_cache_path = /var/cache/swift
{% endif %}
[app:container-server] [app:container-server]
use = egg:swift#container use = egg:swift#container

View File

@ -16,7 +16,13 @@ workers = {{ openstack_service_workers }}
{% if service_name == 'swift-object-expirer' %} {% if service_name == 'swift-object-expirer' %}
pipeline = proxy-server pipeline = proxy-server
{% else %} {% else %}
pipeline = object-server pipeline = {% if enable_swift_recon %}recon {% endif %}object-server
{% endif %}
{% if enable_swift_recon %}
[filter:recon]
use = egg:swift#recon
recon_cache_path = /var/cache/swift
{% endif %} {% endif %}
[app:object-server] [app:object-server]

View File

@ -272,6 +272,34 @@ S3 API
The Swift S3 API can be enabled by setting ``enable_swift_s3api`` to ``true`` The Swift S3 API can be enabled by setting ``enable_swift_s3api`` to ``true``
in ``globals.yml``. It is disabled by default. In order to use this API it is in ``globals.yml``. It is disabled by default. In order to use this API it is
necessary to obtain EC2 credentials from Keystone. See the `Swift documentation necessary to obtain EC2 credentials from Keystone. See the :swift-doc:`the
<https://docs.openstack.org/swift/latest/middleware.html#module-swift.common.middleware.s3api.s3api>`__ Swift documentation
for details. <admin/middleware.html#module-swift.common.middleware.s3api.s3api>` for
details.
Swift Recon
~~~~~~~~~~~
Enable Swift Recon in ``/etc/kolla/globals.yml``:
.. code-block:: yaml
enable_swift_recon : "yes"
The Swift role in Kolla-Ansible is still using the old role format. Unlike many
other Kolla Ansible roles, it won't automatically add the new volume to the
containers in existing deployments when running `kolla-ansible reconfigure`.
Instead we must use the `kolla-ansible upgrade` command, which will remove the
existing containers and then put them back again.
Example usage:
.. code-block:: console
$ sudo docker exec swift_object_server swift-recon --all`
For more information, see :swift-doc:`the Swift documentation
<admin/objectstorage-monitoring.html>`.

View File

@ -0,0 +1,16 @@
---
features:
- |
Enable Swift Recon
Adds the necessary configuration to the Swift account, container
and object configuration files to enable the Swift recon cli.
In order to give the object server on each Swift host access to the
recon files, a Docker volume is mounted into each container which
generates them. The volume is then mounted read only into the object
server container. Note that multiple containers append to the same
file. This should not be a problem since Swift uses a lock when
appending.
Example usage: `sudo docker exec swift_object_server swift-recon --all`