From: Tom Hughes Date: Thu, 28 Mar 2019 08:29:20 +0000 (+0000) Subject: Start job processes for the traces queue on primary backends X-Git-Url: https://git.openstreetmap.org/chef.git/commitdiff_plain/bbf9bcd8d1d9ecb0cc0fa7990a18e3ac69bfcc5f?hp=f641d2cbbfa4ec59daf819b72c2ca71acb85ee5d Start job processes for the traces queue on primary backends --- 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 } )