]> git.openstreetmap.org Git - chef.git/commitdiff
Send upload traffic to Bytemark and keep other backend traffic local
authorTom Hughes <tom@compton.nu>
Sun, 15 Jul 2018 10:53:15 +0000 (11:53 +0100)
committerTom Hughes <tom@compton.nu>
Sun, 15 Jul 2018 10:57:49 +0000 (11:57 +0100)
cookbooks/web/templates/default/apache.frontend.erb
roles/ic.rb

index d2e850fffbb1accb5304f0e7e4212c896a4f3372..eb3c66ab444214dd93d2730c15fe5b016e32422b 100644 (file)
   ProxyPass /api/0.6/amf/read balancer://backend/api/0.6/amf/read
   ProxyPass /api/0.6/swf/trackpoints balancer://backend/api/0.6/swf/trackpoints
   ProxyPassMatch ^(/api/0\.6/changeset/[0-9]+)$ balancer://backend$1
   ProxyPass /api/0.6/amf/read balancer://backend/api/0.6/amf/read
   ProxyPass /api/0.6/swf/trackpoints balancer://backend/api/0.6/swf/trackpoints
   ProxyPassMatch ^(/api/0\.6/changeset/[0-9]+)$ balancer://backend$1
-  ProxyPassMatch ^(/api/0\.6/changeset/[0-9]+/upload)$ balancer://ic$1
+  ProxyPassMatch ^(/api/0\.6/changeset/[0-9]+/upload)$ balancer://bytemark$1
   ProxyPassMatch ^(/api/0\.6/changeset/[0-9]+/download)$ balancer://backend$1
   ProxyPassMatch ^(/api/0\.6/(node|way|relation)/[0-9]+)$ balancer://backend$1
   ProxyPassMatch ^(/api/0\.6/(node|way|relation)/[0-9]+/(full|history|search|ways))$ balancer://backend$1
   ProxyPassMatch ^(/api/0\.6/changeset/[0-9]+/download)$ balancer://backend$1
   ProxyPassMatch ^(/api/0\.6/(node|way|relation)/[0-9]+)$ balancer://backend$1
   ProxyPassMatch ^(/api/0\.6/(node|way|relation)/[0-9]+/(full|history|search|ways))$ balancer://backend$1
 <% end -%>
   </Proxy>
 
 <% end -%>
   </Proxy>
 
+  #
+  # Define a load balancer for the Bytemark backends
+  #
+  <Proxy balancer://bytemark>
+    ProxySet lbmethod=bybusyness
+<% ["rails4.bm", "rails5.bm"].each do |backend| -%>
+    BalancerMember https://<%= backend %> disablereuse=on
+<% end -%>
+  </Proxy>
+
   #
   # Redirect api requests made to www.osm.org to api.osm.org
   #
   #
   # Redirect api requests made to www.osm.org to api.osm.org
   #
index 159f4ca4d714cf4f3237e84349cf48aa9aaf67d4..33e99624b2f17f23fd99fd2538aa0ef19f885ec5 100644 (file)
@@ -30,7 +30,7 @@ default_attributes(
     }
   },
   :web => {
     }
   },
   :web => {
-    :backends => %w[rails4 rails5],
+    :backends => %w[rails1 rails2 rails3],
     :fileserver => "ironbelly",
     :readonly_database_host => "karm.ic.openstreetmap.org"
   }
     :fileserver => "ironbelly",
     :readonly_database_host => "karm.ic.openstreetmap.org"
   }