From fa16c75dc7aeccce152ac6012a716c74d4e5e02a Mon Sep 17 00:00:00 2001 From: Colleen Murphy Date: Tue, 13 Jun 2017 10:35:53 +0200 Subject: [PATCH 1/2] rabbitmq: Fix HA service management Without this patch, the rabbitmq OCF resource agent cannot be restarted by crowbar. When running in HA mode, if the service is notified to restart, both controller nodes will claim that the service is not running. Since it is managed as a special OCF resource agent instead of as a systemd resource, it is necessary to use crm to check whether it is running and to restart it. Moreover, the rabbitmq OCF is named 'rabbitmq' even though the systemd service is named 'rabbitmq-server'. This patch adds the necessary fields to the 'supports' parameter for the rabbitmq service so that it can be properly restarted if necessary. This was not noticed previously because the configuration options for rabbitmq are rarely changed and so rabbitmq rarely requires a restart. However, the resource limits management feature added in pr#974 requires potentially multiple service restarts after initial deployment as parameters are tuned over time, so we need to make sure crowbar is capable of it. (cherry picked from commit b08aaa1e90f7247d8111ec4203b68c59327eba71) --- chef/cookbooks/rabbitmq/recipes/default.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chef/cookbooks/rabbitmq/recipes/default.rb b/chef/cookbooks/rabbitmq/recipes/default.rb index d306df2d6b..7293b07bbe 100644 --- a/chef/cookbooks/rabbitmq/recipes/default.rb +++ b/chef/cookbooks/rabbitmq/recipes/default.rb @@ -61,7 +61,8 @@ end service "rabbitmq-server" do - supports restart: true, start: true, stop: true, status: true + supports restart: true, start: true, stop: true, status: true, \ + restart_crm_resource: true, pacemaker_resource_name: "rabbitmq" action [:enable, :start] provider Chef::Provider::CrowbarPacemakerService if node[:rabbitmq][:ha][:enabled] end From 9322aecab30c590caa0420611541b09140d8a952 Mon Sep 17 00:00:00 2001 From: Colleen Murphy Date: Wed, 28 Jun 2017 18:02:21 +0200 Subject: [PATCH 2/2] database: Fix HA service management Without this patch, the postgresql OCF resource agent cannot be restarted by crowbar. When running in HA mode, if the service is notified to restart, both controller nodes will claim that the service is not running. Since it is managed as a special OCF resource agent instead of as a systemd resource, it is necessary to use crm to check whether it is running and to restart it. This patch sets the restart_crm_resource field in the 'supports' parameter for the postgresql service so that it can be properly restarted if necessary. This was not noticed previously because the configuration options for postgresql are rarely changed and so postgresql rarely requires a restart. However, the resource limits management feature added in pr#974 requires potentially multiple service restarts after initial deployment as parameters are tuned over time, so we need to make sure crowbar is capable of it. (cherry picked from commit b492d7dbcac413778f29a9d6e27e3c54c03240c0) --- chef/cookbooks/postgresql/recipes/server_redhat.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chef/cookbooks/postgresql/recipes/server_redhat.rb b/chef/cookbooks/postgresql/recipes/server_redhat.rb index 71658b8191..f3b07049e2 100644 --- a/chef/cookbooks/postgresql/recipes/server_redhat.rb +++ b/chef/cookbooks/postgresql/recipes/server_redhat.rb @@ -111,7 +111,7 @@ service "postgresql" do service_name node["postgresql"]["server"]["service_name"] - supports restart: true, status: true, reload: true + supports restart: true, status: true, reload: true, restart_crm_resource: true action [:enable, :start] provider Chef::Provider::CrowbarPacemakerService if node[:database][:ha][:enabled] end