Filippo Giunchedi has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/356198 )
Change subject: swift: introduce container-reconciler
......................................................................
swift: introduce container-reconciler
The container reconciler is used to move misplaced objects into their right
storage policy. The reconciler caches container data in memcache so grant
backend -> frontend memcache communication as well.
Bug: T151648
Change-Id: Iaf466a30518aa05d93db54027438784e41e63ef5
---
M modules/role/manifests/swift/proxy.pp
M modules/role/manifests/swift/storage.pp
M modules/swift/manifests/storage.pp
A modules/swift/templates/container-reconciler.conf.erb
4 files changed, 66 insertions(+), 2 deletions(-)
Approvals:
jenkins-bot: Verified
Filippo Giunchedi: Looks good to me, approved
diff --git a/modules/role/manifests/swift/proxy.pp
b/modules/role/manifests/swift/proxy.pp
index 4c5c41a..66f57e9 100644
--- a/modules/role/manifests/swift/proxy.pp
+++ b/modules/role/manifests/swift/proxy.pp
@@ -70,14 +70,16 @@
port => '6002',
}
+ $swift_backends = hiera('swift::storagehosts')
$swift_frontends = hiera('swift::proxyhosts')
- $swift_frontends_ferm = join($swift_frontends, ' ')
+ $swift_access = concat($swift_backends, $swift_frontends)
+ $swift_access_ferm = join($swift_access, ' ')
ferm::service { 'swift-memcached':
proto => 'tcp',
port => '11211',
notrack => true,
- srange => "@resolve((${swift_frontends_ferm}))",
+ srange => "@resolve((${swift_access_ferm}))",
}
monitoring::service { 'swift-http-frontend':
diff --git a/modules/role/manifests/swift/storage.pp
b/modules/role/manifests/swift/storage.pp
index 13e4674..b385bc5 100644
--- a/modules/role/manifests/swift/storage.pp
+++ b/modules/role/manifests/swift/storage.pp
@@ -11,6 +11,7 @@
include ::swift::ring
class { '::swift::storage':
statsd_metric_prefix =>
"swift.${::swift::params::swift_cluster}.${::hostname}",
+ memcached_servers => hiera('swift::proxy::memcached_servers'),
}
include ::swift::container_sync
include ::swift::storage::monitoring
diff --git a/modules/swift/manifests/storage.pp
b/modules/swift/manifests/storage.pp
index 0df6a59..c70cecd 100644
--- a/modules/swift/manifests/storage.pp
+++ b/modules/swift/manifests/storage.pp
@@ -2,6 +2,7 @@
$statsd_host = undef,
$statsd_metric_prefix = undef,
$statsd_sample_rate_factor = '1',
+ $memcached_servers = ['127.0.0.1:11211'],
) {
package {
[ 'swift-account',
@@ -59,6 +60,10 @@
content => template('swift/object-server.conf.erb'),
}
+ file { '/etc/swift/container-reconciler.conf':
+ content => template('swift/container-reconciler.conf.erb'),
+ }
+
file { '/srv/swift-storage':
ensure => directory,
require => Package['swift'],
diff --git a/modules/swift/templates/container-reconciler.conf.erb
b/modules/swift/templates/container-reconciler.conf.erb
new file mode 100644
index 0000000..84b60d8
--- /dev/null
+++ b/modules/swift/templates/container-reconciler.conf.erb
@@ -0,0 +1,56 @@
+[DEFAULT]
+# swift_dir = /etc/swift
+# user = swift
+# You can specify default log routing here if you want:
+log_name = swift-container-reconciler
+
+<% if @statsd_host -%>
+log_statsd_host = <%= @statsd_host %>
+log_statsd_port = 8125
+log_statsd_metric_prefix = <%= @statsd_metric_prefix %>
+log_statsd_sample_rate_factor = <%= @statsd_sample_rate_factor %>
+<% end -%>
+
+[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 = 604800
+# The cycle time of the daemon
+# interval = 30
+# Server errors from requests will be retried by default
+# request_tries = 3
+#
+# You can set scheduling priority of processes. Niceness values range from -20
+# (most favorable to the process) to 19 (least favorable to the process).
+# nice_priority =
+#
+# You can set I/O scheduling class and priority of processes. I/O niceness
+# class values are IOPRIO_CLASS_RT (realtime), IOPRIO_CLASS_BE (best-effort)
and
+# IOPRIO_CLASS_IDLE (idle). I/O niceness priority is a number which goes from
+# 0 to 7. The higher the value, the lower the I/O priority of the process.
+# Work only with ionice_class.
+# ionice_class =
+# ionice_priority =
+
+[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
+memcache_servers = <%= @memcached_servers.join(",") %>
+memcache_serialization_support = 2
+# per worker!
+memcache_max_connections = 12
+
+[filter:proxy-logging]
+use = egg:swift#proxy_logging
+
+[filter:catch_errors]
+use = egg:swift#catch_errors
+# See proxy-server.conf-sample for options
--
To view, visit https://gerrit.wikimedia.org/r/356198
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Iaf466a30518aa05d93db54027438784e41e63ef5
Gerrit-PatchSet: 4
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Filippo Giunchedi <[email protected]>
Gerrit-Reviewer: Filippo Giunchedi <[email protected]>
Gerrit-Reviewer: Giuseppe Lavagetto <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits