Add container-reconciler and object-expirer to os-swift

The container-reconciler and object-expirer were missing from the os-swift
role. The reconciler  makes sure incorrectly placed objets live in the
correct storage policy. The expirer is the service that deletes expired objects.

This change also adds the abilty to optionally specify a reclaim_age in the swift
section of the configuration, which is now set in all the locations required,
still with the default of 604800 seconds (7 days).

Change-Id: Ic56a714c3fb3c84b9bb5ed8e2ae3c86dad474161
Closes-Bug: #1516877
This commit is contained in:
Matthew Oliver 2015-11-19 15:01:52 +11:00
parent 4831ce876f
commit b8fa505969
12 changed files with 121 additions and 0 deletions

View File

@ -81,6 +81,10 @@
# Weight of a disk. Applies to all disks in all storage hosts unless # Weight of a disk. Applies to all disks in all storage hosts unless
# overridden deeper in the structure. Defaults to 100. # overridden deeper in the structure. Defaults to 100.
# #
# Option: reclaim_age (optional, integer, default 604800)
# The amount of time in seconds before items, such as tombstones are
# reclaimed, default is 604800 (7 Days).
#
# Example: # Example:
# #
# Define a typical deployment: # Define a typical deployment:

View File

@ -118,9 +118,11 @@ swift_account_replicator_program_config_options: /etc/swift/account-server/accou
swift_container_server_program_config_options: /etc/swift/container-server/container-server.conf swift_container_server_program_config_options: /etc/swift/container-server/container-server.conf
swift_container_replicator_program_config_options: /etc/swift/container-server/container-server-replicator.conf swift_container_replicator_program_config_options: /etc/swift/container-server/container-server-replicator.conf
swift_container_reconciler_program_config_options: /etc/swift/container-server/container-reconciler.conf
swift_object_server_program_config_options: /etc/swift/object-server/object-server.conf swift_object_server_program_config_options: /etc/swift/object-server/object-server.conf
swift_object_replicator_program_config_options: /etc/swift/object-server/object-server-replicator.conf swift_object_replicator_program_config_options: /etc/swift/object-server/object-server-replicator.conf
swift_object_expirer_program_config_options: /etc/swift/object-server/object-expirer.conf
swift_proxy_server_program_config_options: /etc/swift/proxy-server/proxy-server.conf swift_proxy_server_program_config_options: /etc/swift/proxy-server/proxy-server.conf
@ -221,6 +223,7 @@ swift_container_program_names:
- swift-container-sync - swift-container-sync
- swift-container-updater - swift-container-updater
- swift-container-replicator-server - swift-container-replicator-server
- swift-container-reconciler
swift_object_program_names: swift_object_program_names:
- swift-object-server - swift-object-server
@ -228,6 +231,7 @@ swift_object_program_names:
- swift-object-replicator - swift-object-replicator
- swift-object-updater - swift-object-updater
- swift-object-replicator-server - swift-object-replicator-server
- swift-object-expirer
swift_proxy_program_names: swift_proxy_program_names:
- swift-proxy-server - swift-proxy-server
@ -239,6 +243,8 @@ swift_proxy_server_conf_overrides: {}
swift_account_server_conf_overrides: {} swift_account_server_conf_overrides: {}
swift_account_server_replicator_conf_overrides: {} swift_account_server_replicator_conf_overrides: {}
swift_container_server_conf_overrides: {} swift_container_server_conf_overrides: {}
swift_container_reconciler_conf_overrides: {}
swift_container_server_replicator_conf_overrides: {} swift_container_server_replicator_conf_overrides: {}
swift_object_server_conf_overrides: {} swift_object_server_conf_overrides: {}
swift_object_expirer_conf_overrides: {}
swift_object_server_replicator_conf_overrides: {} swift_object_server_replicator_conf_overrides: {}

View File

@ -88,6 +88,15 @@
system_group: "{{ swift_system_group_name }}" system_group: "{{ swift_system_group_name }}"
service_home: "{{ swift_system_home_folder }}" service_home: "{{ swift_system_home_folder }}"
- include: swift_upstart_common_init.yml
vars:
program_name: "swift-container-reconciler"
program_config_options: "{{ swift_container_reconciler_program_config_options }}"
service_name: "{{ swift_service_name }}"
system_user: "{{ swift_system_user_name }}"
system_group: "{{ swift_system_group_name }}"
service_home: "{{ swift_system_home_folder }}"
- name: "Swift container server configuration" - name: "Swift container server configuration"
config_template: config_template:
src: "{{ item.src }}" src: "{{ item.src }}"
@ -102,6 +111,10 @@
dest: "/etc/swift/container-server/container-server.conf" dest: "/etc/swift/container-server/container-server.conf"
config_overrides: "{{ swift_container_server_conf_overrides }}" config_overrides: "{{ swift_container_server_conf_overrides }}"
config_type: "ini" config_type: "ini"
- src: "container-reconciler.conf.j2"
dest: "/etc/swift/container-server/container-reconciler.conf"
config_overrides: "{{ swift_container_reconciler_conf_overrides }}"
config_type: "ini"
notify: Restart swift container services notify: Restart swift container services
# We only create the dedicated replicator configuration when using a dedicated replication_network # We only create the dedicated replicator configuration when using a dedicated replication_network

View File

@ -79,6 +79,15 @@
system_group: "{{ swift_system_group_name }}" system_group: "{{ swift_system_group_name }}"
service_home: "{{ swift_system_home_folder }}" service_home: "{{ swift_system_home_folder }}"
- include: swift_upstart_common_init.yml
vars:
program_name: "swift-object-expirer"
program_config_options: "{{ swift_object_expirer_program_config_options }}"
service_name: "{{ swift_service_name }}"
system_user: "{{ swift_system_user_name }}"
system_group: "{{ swift_system_group_name }}"
service_home: "{{ swift_system_home_folder }}"
- name: "Swift object server configuration" - name: "Swift object server configuration"
config_template: config_template:
src: "{{ item.src }}" src: "{{ item.src }}"
@ -93,6 +102,10 @@
dest: "/etc/swift/object-server/object-server.conf" dest: "/etc/swift/object-server/object-server.conf"
config_overrides: "{{ swift_object_server_conf_overrides }}" config_overrides: "{{ swift_object_server_conf_overrides }}"
config_type: "ini" config_type: "ini"
- src: "object-expirer.conf.j2"
dest: "/etc/swift/object-server/object-expirer.conf"
config_overrides: "{{ swift_object_expirer_conf_overrides }}"
config_type: "ini"
notify: Restart swift object services notify: Restart swift object services
# We only create the dedicated replicator configuration when using a dedicated replication_network # We only create the dedicated replicator configuration when using a dedicated replication_network

View File

@ -21,3 +21,4 @@ replication_server = True
[account-replicator] [account-replicator]
log_facility = LOG_LOCAL2 log_facility = LOG_LOCAL2
per_diff = 10000 per_diff = 10000
reclaim_age = {{ reclaim_age | default(604800) }}

View File

@ -32,6 +32,7 @@ recon_lock_path = /var/lock
[account-replicator] [account-replicator]
log_facility = LOG_LOCAL2 log_facility = LOG_LOCAL2
per_diff = 10000 per_diff = 10000
reclaim_age = {{ reclaim_age | default(604800) }}
{% endif %} {% endif %}
[account-auditor] [account-auditor]

View File

@ -0,0 +1,29 @@
[DEFAULT]
swift_dir = /etc/swift
user = {{ swift_system_user_name }}
log_facility = LOG_LOCAL3
[container-reconciler]
# The reconciler will re-attempt reconciliation if the source object is not
# available up to reclaim_age seconds before it gives up and deletes the entry
# in the queue.
reclaim_age = {{ reclaim_age | default(604800) }}
# The cycle time of the daemon
interval = 30
# Server errors from requests will be retried by default
request_tries = 3
[pipeline:main]
pipeline = catch_errors proxy-logging cache proxy-server
[app:proxy-server]
use = egg:swift#proxy
[filter:cache]
use = egg:swift#memcache
[filter:proxy-logging]
use = egg:swift#proxy_logging
[filter:catch_errors]
use = egg:swift#catch_errors

View File

@ -20,3 +20,4 @@ replication_server = True
[container-replicator] [container-replicator]
log_facility = LOG_LOCAL3 log_facility = LOG_LOCAL3
reclaim_age = {{ reclaim_age | default(604800) }}

View File

@ -32,6 +32,7 @@ recon_lock_path = /var/lock
{% if swift.replication_network is not defined or swift.replication_network == swift.storage_network %} {% if swift.replication_network is not defined or swift.replication_network == swift.storage_network %}
[container-replicator] [container-replicator]
log_facility = LOG_LOCAL3 log_facility = LOG_LOCAL3
reclaim_age = {{ reclaim_age | default(604800) }}
{% endif %} {% endif %}
[container-updater] [container-updater]

View File

@ -0,0 +1,50 @@
# {{ ansible_managed }}
[DEFAULT]
swift_dir = /etc/swift
user = {{ swift_system_user_name }}
log_facility = LOG_LOCAL4
[object-expirer]
interval = 300
auto_create_account_prefix = .
expiring_objects_account_name = expiring_objects
report_interval = 300
# concurrency is the level of concurrency to use to do the work, this value
# must be set to at least 1
concurrency = 3
# processes is how many parts to divide the work into, one part per process
# that will be doing the work
# processes set 0 means that a single process will be doing all the work
# processes can also be specified on the command line and will override the
# config value
processes = {{ groups['swift_hosts'] | length }}
# process is which of the parts a particular process will work on
# process can also be specified on the command line and will override the config
# value
# process is "zero based", if you want to use 3 processes, you should run
# processes with process set to 0, 1, and 2
process = {{ groups['swift_hosts'].index(inventory_hostname) }}
# The expirer will re-attempt expiring if the source object is not available
# up to reclaim_age seconds before it gives up and deletes the entry in the
# queue.
reclaim_age = {{ reclaim_age | default(604800) }}
recon_cache_path = /var/cache/swift
[pipeline:main]
pipeline = catch_errors proxy-logging cache proxy-server
[app:proxy-server]
use = egg:swift#proxy
# See proxy-server.conf-sample for options
[filter:cache]
use = egg:swift#memcache
# See proxy-server.conf-sample for options
[filter:catch_errors]
use = egg:swift#catch_errors
# See proxy-server.conf-sample for options
[filter:proxy-logging]
use = egg:swift#proxy_logging

View File

@ -21,3 +21,4 @@ replication_server = True
[object-replicator] [object-replicator]
log_facility = LOG_LOCAL4 log_facility = LOG_LOCAL4
concurrency = 6 concurrency = 6
reclaim_age = {{ reclaim_age | default(604800) }}

View File

@ -34,6 +34,7 @@ recon_lock_path = /var/lock
[object-replicator] [object-replicator]
log_facility = LOG_LOCAL4 log_facility = LOG_LOCAL4
concurrency = 6 concurrency = 6
reclaim_age = {{ reclaim_age | default(604800) }}
{% endif %} {% endif %}
[object-updater] [object-updater]