diff options
author | Damien Ciabrini <dciabrin@redhat.com> | 2016-12-07 19:09:06 +0100 |
---|---|---|
committer | Tim Rozet <trozet@redhat.com> | 2017-03-03 20:52:01 +0000 |
commit | 5d9d1c606ca9c0ddc396819f2426a00f625a3273 (patch) | |
tree | 7c5817711302f05e5fde2d6f99b2ff8d55f1749d /manifests/profile/base/database | |
parent | 208f068a488a9b5b3f40c64af3bb50dbbc07730e (diff) |
mariadb: Move generation of systemd drop-in to puppet-tripleo
Systemd starts mariadb as user mysql, so in order to allow a large
number of connections (e.g. max_connections=4096) it is necessary to
raise the file descriptor limit via a system drop-in file.
When installing an undercloud, such drop-in file is currently
generated by instack-undercloud (in file puppet-stack-config.pp). But
non-HA overcloud also need such drop-in to be generated.
In order to avoid duplicating code, the drop-in creation code should
be provided by puppet-tripleo. By default, no drop-in is generated;
it has to be enabled by instack-undercloud or tripleo-heat-template
once they will use it (resp. to create undercloud or non-HA overcloud).
This patch does not aim at generating a dynamic file limit based on
the number of connections, this should land in another dedicated
patch. Instead, it just reuses the limit currently set for undercloud
and HA-overclouds.
Also, the generation of the drop-in does not force a mysql restart
like it currently does in instack-undercloud, to avoid unexpected
service disruption on a non-HA overcloud after a minor update.
Co-Authored-By: Tim Rozet <trozet@redhat.com>
Depends-On: I7ca7b5f7614971455cae2bf7c4bf8264b642b0dc
Change-Id: Ia0907b2ab6062a93fb9363e39c86535a490fbaf6
Partial-Bug: #1648181
Related-Bug: #1524809
(cherry picked from commit 09665170f6d0f4536a48dd4d1444e07aa064bed7)
Diffstat (limited to 'manifests/profile/base/database')
-rw-r--r-- | manifests/profile/base/database/mysql.pp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/manifests/profile/base/database/mysql.pp b/manifests/profile/base/database/mysql.pp index d3c3f21..862c4bd 100644 --- a/manifests/profile/base/database/mysql.pp +++ b/manifests/profile/base/database/mysql.pp @@ -42,6 +42,11 @@ # (Optional) Whether TLS in the internal network is enabled or not. # Defaults to hiera('enable_internal_tls', false) # +# [*generate_dropin_file_limit*] +# (Optional) Generate a systemd drop-in file to raise the file descriptor +# limit for the mysql service. +# Defaults to false +# # [*generate_service_certificates*] # (Optional) Whether or not certmonger will generate certificates for # MySQL. This could be as many as specified by the $certificates_specs @@ -72,6 +77,7 @@ class tripleo::profile::base::database::mysql ( $bootstrap_node = hiera('bootstrap_nodeid', undef), $certificate_specs = {}, $enable_internal_tls = hiera('enable_internal_tls', false), + $generate_dropin_file_limit = false, $generate_service_certificates = hiera('generate_service_certificates', false), $manage_resources = true, $mysql_server_options = {}, @@ -139,6 +145,15 @@ class tripleo::profile::base::database::mysql ( service_enabled => $manage_resources, remove_default_accounts => $remove_default_accounts, } + + if $generate_dropin_file_limit { + # Raise the mysql file limit + ::systemd::service_limits { 'mariadb.service': + limits => { + LimitNOFILE => 16384 + } + } + } } if $step >= 2 and $sync_db { |