Ottomata has submitted this change and it was merged.

Change subject: Set the cassandra localDc parameter
......................................................................


Set the cassandra localDc parameter

This tells the client which datacenter it should consider local for
localQuorum and preferred connection purposes. We also use this currently as a
proxy for which DC we should create tables in, but plan to move to adjusting
the replication dynamically based on the cluster info exposed by cassandra
itself in the future.

Change-Id: I003c4c27d412fe94118c30ecad30aae3d188e4fb
---
M hieradata/role/common/restbase.yaml
M modules/restbase/manifests/init.pp
M modules/restbase/templates/config.yaml.erb
3 files changed, 5 insertions(+), 0 deletions(-)

Approvals:
  Ori.livneh: Looks good to me, but someone else must approve
  Ottomata: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/hieradata/role/common/restbase.yaml 
b/hieradata/role/common/restbase.yaml
index 0e46975..408dff1 100644
--- a/hieradata/role/common/restbase.yaml
+++ b/hieradata/role/common/restbase.yaml
@@ -23,6 +23,7 @@
     - restbase1006.eqiad.wmnet
 restbase::logstash_host: logstash1002.eqiad.wmnet
 restbase::cassandra_defaultConsistency: localQuorum
+restbase::cassandra_localDc: "%{::site}"
 restbase::statsd_host: statsd.eqiad.wmnet
 
 lvs::realserver::realserver_ips:
diff --git a/modules/restbase/manifests/init.pp 
b/modules/restbase/manifests/init.pp
index 7be52d0..456b430 100644
--- a/modules/restbase/manifests/init.pp
+++ b/modules/restbase/manifests/init.pp
@@ -15,6 +15,8 @@
 # [*cassandra_defaultConsistency*]
 #   Default cassandra query consistency level. Typically 'one' or
 #   'localQuorum'. Default: 'localQuorum'.
+# [*cassandra_localDc*]
+#   Which DC should be considered local. Default: 'datacenter1'.
 # [*port*]
 #   Port where to run the restbase service. Default: 7231
 # [*logstash_host*]
@@ -34,6 +36,7 @@
     $cassandra_password = 'cassandra',
     $seeds          = [$::ipaddress],
     $cassandra_defaultConsistency = 'localQuorum',
+    $cassandra_localDc = 'datacenter1',
     $port           = 7231,
     $logstash_host  = 'localhost',
     $logstash_port  = 12201,
diff --git a/modules/restbase/templates/config.yaml.erb 
b/modules/restbase/templates/config.yaml.erb
index 80164f9..bd6a3db 100644
--- a/modules/restbase/templates/config.yaml.erb
+++ b/modules/restbase/templates/config.yaml.erb
@@ -62,6 +62,7 @@
               conf:
                 hosts: [<%= Array(@seeds).join(',') %>]
                 keyspace: system
+                localDc: <%= @cassandra_localDc %>
                 username: <%= @cassandra_user %>
                 password: <%= @cassandra_password %>
                 defaultConsistency: <%= @cassandra_defaultConsistency %>

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I003c4c27d412fe94118c30ecad30aae3d188e4fb
Gerrit-PatchSet: 4
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: GWicke <[email protected]>
Gerrit-Reviewer: Alexandros Kosiaris <[email protected]>
Gerrit-Reviewer: Faidon Liambotis <[email protected]>
Gerrit-Reviewer: Filippo Giunchedi <[email protected]>
Gerrit-Reviewer: Giuseppe Lavagetto <[email protected]>
Gerrit-Reviewer: Mobrovac <[email protected]>
Gerrit-Reviewer: Ori.livneh <[email protected]>
Gerrit-Reviewer: Ottomata <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to