From bbf9bcd8d1d9ecb0cc0fa7990a18e3ac69bfcc5f Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Thu, 28 Mar 2019 08:29:20 +0000 Subject: [PATCH 1/1] Start job processes for the traces queue on primary backends --- cookbooks/web/attributes/default.rb | 1 + cookbooks/web/recipes/backend.rb | 9 +++++++++ roles/equinix.rb | 3 ++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/cookbooks/web/attributes/default.rb b/cookbooks/web/attributes/default.rb index 8ad59e544..79890cbdb 100644 --- a/cookbooks/web/attributes/default.rb +++ b/cookbooks/web/attributes/default.rb @@ -1,3 +1,4 @@ default[:web][:base_directory] = "/srv/www.openstreetmap.org" default[:web][:pid_directory] = "/var/run/web" default[:web][:log_directory] = "/var/log/web" +default[:web][:primary_cluster] = false diff --git a/cookbooks/web/recipes/backend.rb b/cookbooks/web/recipes/backend.rb index 69fb018d8..e1995500c 100644 --- a/cookbooks/web/recipes/backend.rb +++ b/cookbooks/web/recipes/backend.rb @@ -41,3 +41,12 @@ apache_site "www.openstreetmap.org" do end node.normal[:memcached][:ip_address] = node.internal_ipaddress + +if node[:web][:primary_cluster] + service "rails-jobs@traces" do + action [:enable, :start] + supports :restart => true + subscribes :restart, "rails_port[www.openstreetmap.org]" + subscribes :restart, "systemd_service[rails-jobs]" + end +end diff --git a/roles/equinix.rb b/roles/equinix.rb index 85d445dce..a35b4775c 100644 --- a/roles/equinix.rb +++ b/roles/equinix.rb @@ -27,7 +27,8 @@ default_attributes( :web => { :backends => %w[rails1 rails2 rails3], :fileserver => "ironbelly", - :readonly_database_host => "karm.ams.openstreetmap.org" + :readonly_database_host => "karm.ams.openstreetmap.org", + :primary_cluster => true } ) -- 2.43.2