mirror of
https://github.com/status-im/ansible-role-mongodb.git
synced 2025-01-11 22:14:15 +00:00
Fix systemd unit file for mongodb and add manage limits.
This commit is contained in:
parent
b842529d7b
commit
0b50bcc867
@ -16,6 +16,8 @@ mongodb_pymongo_pip_version: 3.7.1
|
||||
mongodb_user_update_password: "on_create" # MongoDB user password update default policy
|
||||
mongodb_manage_service: true
|
||||
mongodb_manage_systemd_unit: true
|
||||
mongodb_systemd_unit_limit_nofile: 64000
|
||||
mongodb_systemd_unit_limit_nproc: 64000
|
||||
|
||||
mongodb_disable_transparent_hugepages: false
|
||||
|
||||
|
@ -59,8 +59,8 @@
|
||||
state: present
|
||||
|
||||
- name: Add systemd configuration if present
|
||||
copy:
|
||||
src: mongodb.service
|
||||
template:
|
||||
src: mongodb.service.j2
|
||||
dest: "/lib/systemd/system/{{mongodb_daemon_name}}.service"
|
||||
owner: root
|
||||
group: root
|
||||
|
@ -1,9 +1,10 @@
|
||||
# {{ ansible_managed }}
|
||||
[Unit]
|
||||
Description=An object/document-oriented database
|
||||
Documentation=man:mongod(1)
|
||||
|
||||
[Service]
|
||||
User=mongodb
|
||||
User={{ mongodb_user }}
|
||||
ExecStart=/usr/bin/numactl --interleave=all /usr/bin/mongod --config /etc/mongod.conf
|
||||
# file size
|
||||
LimitFSIZE=infinity
|
||||
@ -12,9 +13,9 @@ LimitCPU=infinity
|
||||
# virtual memory size
|
||||
LimitAS=infinity
|
||||
# open files
|
||||
LimitNOFILE=64000
|
||||
LimitNOFILE={{ mongodb_systemd_unit_limit_nofile }}
|
||||
# processes/threads
|
||||
LimitNPROC=64000
|
||||
LimitNPROC={{ mongodb_systemd_unit_limit_nproc }}
|
||||
# locked memory
|
||||
LimitMEMLOCK=infinity
|
||||
# total threads (user+kernel)
|
Loading…
x
Reference in New Issue
Block a user