Logan V dde19945c6 Allow configuration of startup timeout
SST transfers of large databases can easily take longer than 30 minutes,
causing the mysql process to restart over and over and never complete
its sync to rejoin the cluster.

Change-Id: I7654820f91fbb036ab4d4a6234c0ccec148a503a
2018-09-19 11:53:51 -05:00

17 lines
775 B
Django/Jinja

# {{ ansible_managed }}
{%- set all_calculated_max_connections = [] %}
{%- for galera_node in galera_cluster_members %}
{%- set vcpus = hostvars[galera_node]['ansible_processor_vcpus'] %}
{%- set _ = all_calculated_max_connections.append([[vcpus|default(2), 2] | max, galera_wsrep_slave_threads_max] | min * 100) %}
{%- endfor %}
{%- set calculated_min_connections = all_calculated_max_connections | min %}
{%- set calculated_max_connections = galera_max_connections | default(calculated_min_connections) %}
# How long to wait for successful mysql startup
# Startup can take a while if it requires a galera state transfer.
MYSQLD_STARTUP_TIMEOUT={{ galera_startup_timeout }}
ulimit -n {{ calculated_max_connections }}
ulimit -Hn {{ calculated_max_connections }}