Giuseppe Lavagetto has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/270969

Change subject: nutcracker: re-organize redis servers list
......................................................................

nutcracker: re-organize redis servers list

Also add two more instances in codfw to match the number of shards we
have in eqiad.

Change-Id: I65dc207e54822bf911744ff8832349a052789bcc
---
M hieradata/common/mediawiki/redis_servers.yaml
M modules/mediawiki/manifests/nutcracker.pp
M modules/nutcracker/templates/nutcracker.yml.erb
3 files changed, 118 insertions(+), 40 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/69/270969/1

diff --git a/hieradata/common/mediawiki/redis_servers.yaml 
b/hieradata/common/mediawiki/redis_servers.yaml
index f6e33f6..86fdbe6 100644
--- a/hieradata/common/mediawiki/redis_servers.yaml
+++ b/hieradata/common/mediawiki/redis_servers.yaml
@@ -1,39 +1,111 @@
 eqiad:
-  - '10.64.0.180:6379:1 "shard01"'
-  - '10.64.0.181:6379:1 "shard02"'
-  - '10.64.0.182:6379:1 "shard03"'
-  - '10.64.0.183:6379:1 "shard04"'
-  - '10.64.0.184:6379:1 "shard05"'
-  - '10.64.0.185:6379:1 "shard06"'
-  - '10.64.32.161:6379:1 "shard07"'
-  - '10.64.32.162:6379:1 "shard08"'
-  - '10.64.32.163:6379:1 "shard09"'
-  - '10.64.32.164:6379:1 "shard10"'
-  - '10.64.32.165:6379:1 "shard11"'
-  - '10.64.32.166:6379:1 "shard12"'
-  - '10.64.48.101:6379:1 "shard13"'
-  - '10.64.48.102:6379:1 "shard14"'
-  - '10.64.48.103:6379:1 "shard15"'
-  - '10.64.48.104:6379:1 "shard16"'
-  - '10.64.48.95:6379:1 "shard17"'
-  - '10.64.48.96:6379:1 "shard18"'
-
-# Hosts temporarily removed from the pool for maintenance
+  shard01:
+    host: 10.64.0.180
+    port: 6379
+  shard02:
+    host: 10.64.0.181
+    port: 6379
+  shard03:
+    host: 10.64.0.182
+    port: 6379
+  shard04:
+    host: 10.64.0.183
+    port: 6379
+  shard05:
+    host: 10.64.0.184
+    port: 6379
+  shard06:
+    host: 10.64.0.185
+    port: 6379
+  shard07:
+    host: 10.64.32.161
+    port: 6379
+  shard08:
+    host: 10.64.32.162
+    port: 6379
+  shard09:
+    host: 10.64.32.163
+    port: 6379
+  shard10:
+    host: 10.64.32.164
+    port: 6379
+  shard11:
+    host: 10.64.32.165
+    port: 6379
+  shard12:
+    host: 10.64.32.166
+    port: 6379
+  shard13:
+    host: 10.64.48.101
+    port: 6379
+  shard14:
+    host: 10.64.48.102
+    port: 6379
+  shard15:
+    host: 10.64.48.103
+    port: 6379
+  shard16:
+    host: 10.64.48.104
+    port: 6379
+  shard17:
+    host: 10.64.48.95
+    port: 6379    
+  shard18:
+    host: 10.64.48.96
+    port: 6379
 
 codfw:
-  - '10.192.0.34:6379:1 "shard01"'
-  - '10.192.0.35:6379:1 "shard02"'
-  - '10.192.0.36:6379:1 "shard03"'
-  - '10.192.0.37:6379:1 "shard04"'
-  - '10.192.0.38:6379:1 "shard05"'
-  - '10.192.0.39:6379:1 "shard06"'
-  - '10.192.16.37:6379:1 "shard07"'
-  - '10.192.16.38:6379:1 "shard08"'
-  - '10.192.16.39:6379:1 "shard09"'
-  - '10.192.16.40:6379:1 "shard10"'
-  - '10.192.16.41:6379:1 "shard11"'
-  - '10.192.16.42:6379:1 "shard12"'
-  - '10.192.32.20:6379:1 "shard13"'
-  - '10.192.32.21:6379:1 "shard14"'
-  - '10.192.32.22:6379:1 "shard15"'
-  - '10.192.32.23:6379:1 "shard16"'
+  shard01:
+    host: 10.192.0.34
+    port: 6379
+  shard02:
+    host: 10.192.0.35
+    port: 6379
+  shard03:
+    host: 10.192.0.36
+    port: 6379
+  shard04:
+    host: 10.192.0.37
+    port: 6379
+  shard05:
+    host: 10.192.0.38
+    port: 6379
+  shard06:
+    host: 10.192.0.39
+    port: 6379
+  shard07:
+    host: 10.192.16.37
+    port: 6379
+  shard08:
+    host: 10.192.16.38
+    port: 6379
+  shard09:
+    host: 10.192.16.39
+    port: 6379
+  shard10:
+    host: 10.192.16.40
+    port: 6379
+  shard11:
+    host: 10.192.16.41
+    port: 6379
+  shard12:
+    host: 10.192.16.42
+    port: 6379
+  shard13:
+    host: 10.192.32.20
+    port: 6379
+  shard14:
+    host: 10.192.32.21
+    port: 6379
+  shard15:
+    host: 10.192.32.22
+    port: 6379
+  shard16:
+    host: 10.192.32.23
+    port: 6379
+  shard17:
+    host: 10.192.0.34
+    port: 6380
+  shard18:
+    host: 10.192.32.23
+    port: 6380
diff --git a/modules/mediawiki/manifests/nutcracker.pp 
b/modules/mediawiki/manifests/nutcracker.pp
index 3aeb34b..edca5ad 100644
--- a/modules/mediawiki/manifests/nutcracker.pp
+++ b/modules/mediawiki/manifests/nutcracker.pp
@@ -43,7 +43,7 @@
             server_failure_limit => 3,
             server_retry_timeout => to_milliseconds('30s'),
             timeout              => 1000,
-            servers              => hiera('mediawiki::redis_servers::eqiad'),
+            server_list          => hiera('mediawiki::redis_servers::eqiad'),
         },
 
         'redis_codfw'           =>  {
@@ -57,7 +57,7 @@
             server_failure_limit => 3,
             server_retry_timeout => to_milliseconds('30s'),
             timeout              => 1000,
-            servers              => hiera('mediawiki::redis_servers::codfw'),
+            server_list          => hiera('mediawiki::redis_servers::codfw'),
         },
     }
 
diff --git a/modules/nutcracker/templates/nutcracker.yml.erb 
b/modules/nutcracker/templates/nutcracker.yml.erb
index 1796d2b..a3c2933 100644
--- a/modules/nutcracker/templates/nutcracker.yml.erb
+++ b/modules/nutcracker/templates/nutcracker.yml.erb
@@ -1,8 +1,14 @@
 <% @pools.keys.sort_by(&:to_s).each do |key| -%>
 <%= key %>:
-<% pool = @pools[key] -%>
+<% pool = @pools[key] -%>                                                    
 <% pool.keys.sort_by(&:to_s).each do |k| -%>
-<% if pool[k].is_a?Array -%>
+<% if k == "server_list" -%>
+  servers:
+<% pool[k].keys.sort_by(&:to_s).each do |shard| -%>
+<% server = pool[k][shard] -%>
+   - <%= server["host"] %>:<%= server["port"] %>:1 "<%= shard %>"
+<% end -%>
+<% elsif pool[k].is_a?Array -%>
   <%= k %>:
 <% pool[k].sort_by(&:to_s).each do |v| -%>
     - <%= v %>

-- 
To view, visit https://gerrit.wikimedia.org/r/270969
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I65dc207e54822bf911744ff8832349a052789bcc
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Giuseppe Lavagetto <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to