Make all web servers use the IC memcached servers
authorTom Hughes <tom@compton.nu>
Wed, 18 May 2016 11:35:44 +0000 (12:35 +0100)
committerTom Hughes <tom@compton.nu>
Wed, 18 May 2016 11:35:44 +0000 (12:35 +0100)
cookbooks/web/recipes/cgimap.rb
cookbooks/web/recipes/rails.rb
roles/web.rb

index 26fb2c41ddc935269810c23517807d521029f810..9dd97a49e9296eca51a4892e97361491985d94aa 100644 (file)
@@ -86,7 +86,7 @@ else
   database_readonly = node[:web][:status] == "database_readonly"
 end
 
-backends = node[:web][:backends]
+memcached_servers = node[:web][:memcached_servers]
 
 cgimap_init = edit_file "#{cgimap_directory}/scripts/cgimap.init" do |line|
   line.gsub!(/^CGIMAP_HOST=.*;/, "CGIMAP_HOST=#{database_host};")
@@ -95,7 +95,7 @@ cgimap_init = edit_file "#{cgimap_directory}/scripts/cgimap.init" do |line|
   line.gsub!(/^CGIMAP_PASSWORD=.*;/, "CGIMAP_PASSWORD=#{db_passwords['rails']};")
   line.gsub!(/^CGIMAP_PIDFILE=.*;/, "CGIMAP_PIDFILE=#{pid_directory}/cgimap.pid;")
   line.gsub!(/^CGIMAP_LOGFILE=.*;/, "CGIMAP_LOGFILE=#{log_directory}/cgimap.log;")
-  line.gsub!(/^CGIMAP_MEMCACHE=.*;/, "CGIMAP_MEMCACHE=#{backends.join(',')};")
+  line.gsub!(/^CGIMAP_MEMCACHE=.*;/, "CGIMAP_MEMCACHE=#{memcached_servers.join(',')};")
   line.gsub!(/^CGIMAP_RATELIMIT=.*;/, "CGIMAP_RATELIMIT=204800;")
 
   line.gsub!(%r{--pidfile \$CGIMAP_PIDFILE --exec /home/rails/bin/map}, "--pidfile $CGIMAP_PIDFILE")
index 2542edea3f84e6fb39bccdeb2170b0259d9a4530..5b42c978c515bac7d41970654f3f0904a83bf3f6 100644 (file)
@@ -64,7 +64,7 @@ rails_port "www.openstreetmap.org" do
   attachments_dir "/store/rails/attachments"
   log_path "#{node[:web][:log_directory]}/rails.log"
   logstash_path "#{node[:web][:log_directory]}/rails-logstash.log"
-  memcache_servers node[:web][:backends]
+  memcache_servers node[:web][:memcached_servers]
   potlatch2_key web_passwords["potlatch2_key"]
   id_key web_passwords["id_key"]
   oauth_key web_passwords["oauth_key"]
index 85124e485f89e22b0337048d595bb6f60a294c5c..dce003b3da9acf40909b1fce6c902aad16a1f05d 100644 (file)
@@ -14,7 +14,8 @@ default_attributes(
     :pool_idle_time => 0
   },
   :web => {
-    :status => "online"
+    :status => "online",
+    :memcached_servers => %w(rails1.ic rails2.ic rails3.ic)
   }
 )