Configure TCP keepalive setting to all nodes

In some cases, it has been observed that services keep their
connection to RabbitMQ when they should not (e.g. during a
controller server hard reboot), creating instability. This patch
aims at fixing this by setting TCP keepalive parameters for
RabbitMQ connections, and setting kernel parameters to send
keepalive packets more often.

Change-Id: I7688a86e4ff617f20d6767f156c5d880e0d4d619
Fixes: bz#1167414
This commit is contained in:
Javier Pena
2014-11-25 16:20:02 +01:00
parent d49931d69e
commit 86a166a471
2 changed files with 17 additions and 0 deletions

View File

@@ -29,6 +29,9 @@ define enable_rabbitmq {
default_pass => hiera('CONFIG_AMQP_AUTH_PASSWORD'),
package_provider => 'yum',
admin_enable => false,
config_variables => {
'tcp_listen_options' => "[binary,{packet, raw},{reuseaddr, true},{backlog, 128},{nodelay, true},{exit_on_close, false},{keepalive, true}]"
}
}
Package['erlang'] -> Class['rabbitmq']

View File

@@ -32,3 +32,17 @@ service { 'auditd':
enable => true,
}
# The following kernel parameters help alleviate some RabbitMQ
# connection issues
sysctl::value { 'net.ipv4.tcp_keepalive_intvl':
value => '1',
}
sysctl::value { 'net.ipv4.tcp_keepalive_probes':
value => '5',
}
sysctl::value { 'net.ipv4.tcp_keepalive_time':
value => '5',
}