Adjust file descriptor limit when systemd is used
Change-Id: I083c60d28904e6a6eeebd36ed114df06d83072a6 Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
This commit is contained in:
parent
81d23ffe59
commit
21aaa7cc4f
|
@ -53,3 +53,8 @@
|
||||||
until: galera_restart_fall_back | success
|
until: galera_restart_fall_back | success
|
||||||
retries: 3
|
retries: 3
|
||||||
delay: 5
|
delay: 5
|
||||||
|
|
||||||
|
- name: Reload the systemd daemon
|
||||||
|
command: "systemctl daemon-reload"
|
||||||
|
when:
|
||||||
|
- pid1_name == "systemd"
|
||||||
|
|
|
@ -68,14 +68,54 @@
|
||||||
tags:
|
tags:
|
||||||
- galera-config
|
- galera-config
|
||||||
|
|
||||||
# NOTE: (mancdaz) The target will need to change to /etc/default/mariadb
|
- name: Drop limits config (upstart)
|
||||||
# for mariadb-10.1
|
template:
|
||||||
- name: Drop mariadb config(s)
|
src: "upstart.limits.conf.j2"
|
||||||
|
dest: "/etc/security/limits.conf"
|
||||||
|
when:
|
||||||
|
- pid1_name != "systemd"
|
||||||
|
notify:
|
||||||
|
- Restart mysql
|
||||||
|
tags:
|
||||||
|
- galera-config
|
||||||
|
|
||||||
|
# NOTE: (mancdaz) REMOVE "/etc/default/mysql" when running MariaDB 10.1
|
||||||
|
- name: Apply resource limits (upstart)
|
||||||
template:
|
template:
|
||||||
src: "mysql_defaults.j2"
|
src: "mysql_defaults.j2"
|
||||||
dest: "/etc/default/mysql"
|
dest: "{{ item }}"
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
notify: Restart mysql
|
with_items:
|
||||||
|
- /etc/default/mysql
|
||||||
|
- /etc/default/mariadb
|
||||||
|
when:
|
||||||
|
- ansible_pkg_mgr == 'apt'
|
||||||
|
- pid1_name != "systemd"
|
||||||
|
notify:
|
||||||
|
- Restart mysql
|
||||||
|
tags:
|
||||||
|
- galera-config
|
||||||
|
|
||||||
|
- name: Create mariadb systemd service config dir
|
||||||
|
file:
|
||||||
|
path: "/etc/systemd/system/mariadb.service.d"
|
||||||
|
state: "directory"
|
||||||
|
group: "root"
|
||||||
|
owner: "root"
|
||||||
|
mode: "0755"
|
||||||
|
when:
|
||||||
|
- pid1_name == "systemd"
|
||||||
|
|
||||||
|
- name: Apply resource limits (systemd)
|
||||||
|
template:
|
||||||
|
src: "systemd.limits.conf.j2"
|
||||||
|
dest: "/etc/systemd/system/mariadb.service.d/limits.conf"
|
||||||
|
mode: "0644"
|
||||||
|
when:
|
||||||
|
- pid1_name == "systemd"
|
||||||
|
notify:
|
||||||
|
- Reload the systemd daemon
|
||||||
|
- Restart mysql
|
||||||
tags:
|
tags:
|
||||||
- galera-config
|
- galera-config
|
||||||
|
|
||||||
|
|
|
@ -41,11 +41,3 @@
|
||||||
when: not use_percona_upstream | bool
|
when: not use_percona_upstream | bool
|
||||||
tags:
|
tags:
|
||||||
- percona-apt-packages
|
- percona-apt-packages
|
||||||
|
|
||||||
- name: Drop limits config
|
|
||||||
template:
|
|
||||||
src: "limits.conf.j2"
|
|
||||||
dest: "/etc/security/limits.conf"
|
|
||||||
notify: Restart mysql
|
|
||||||
tags:
|
|
||||||
- galera-config
|
|
||||||
|
|
|
@ -35,6 +35,18 @@
|
||||||
tags:
|
tags:
|
||||||
- always
|
- always
|
||||||
|
|
||||||
|
- name: Check init system
|
||||||
|
command: cat /proc/1/comm
|
||||||
|
register: _pid1_name
|
||||||
|
tags:
|
||||||
|
- always
|
||||||
|
|
||||||
|
- name: Set the name of pid1
|
||||||
|
set_fact:
|
||||||
|
pid1_name: "{{ _pid1_name.stdout }}"
|
||||||
|
tags:
|
||||||
|
- always
|
||||||
|
|
||||||
- include: galera_upgrade_check.yml
|
- include: galera_upgrade_check.yml
|
||||||
- include: galera_cluster_state.yml
|
- include: galera_cluster_state.yml
|
||||||
- include: galera_pre_install.yml
|
- include: galera_pre_install.yml
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
# {{ ansible_managed }}
|
||||||
|
|
||||||
|
{%- set all_calculated_max_connections = [] %}
|
||||||
|
{%- for galera_node in galera_cluster_members %}
|
||||||
|
{%- set _ = all_calculated_max_connections.append((hostvars[galera_node]['ansible_processor_vcpus'] | int > 0) | ternary (ansible_processor_vcpus, 2) * 100) %}
|
||||||
|
{%- endfor %}
|
||||||
|
{%- set calculated_min_connections = all_calculated_max_connections | min %}
|
||||||
|
{%- set calculated_max_connections = galera_max_connections | default(calculated_min_connections) %}
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
LimitNOFILE={{ calculated_max_connections }}
|
||||||
|
|
Loading…
Reference in New Issue