mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
Merge pull request #919 from holta/mongodb-repair
MongoDB: many improvements for reliability
This commit is contained in:
commit
c321f60117
4 changed files with 11 additions and 7 deletions
|
@ -1,2 +1,5 @@
|
|||
mongodb_install: False
|
||||
mongodb_enabled: False
|
||||
|
||||
mongodb_db_path: "{{ content_base }}/dbdata/mongodb" # == /library/dbdata/mongodb/
|
||||
mongodb_conf: /etc/mongod.conf
|
||||
|
|
|
@ -16,10 +16,10 @@
|
|||
owner: mongodb
|
||||
with_items:
|
||||
- { path: '/var/run/mongodb' }
|
||||
- { path: '/library/dbdata/mongodb' }
|
||||
- { path: "{{ mongodb_db_path }}" }
|
||||
- { path: '/var/log/mongodb' }
|
||||
|
||||
- name: Position /etc/mongod.conf and mongodb.service
|
||||
- name: Populate & position /etc/mongod.conf, /etc/systemd/system/mongodb.service
|
||||
template:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ item.dest }}"
|
||||
|
@ -27,8 +27,8 @@
|
|||
group: root
|
||||
mode: 0644
|
||||
with_items:
|
||||
- { src: 'mongodb.service' , dest: '/etc/systemd/system/' }
|
||||
- { src: 'mongod.conf' , dest: '/etc/mongod.conf'}
|
||||
- { src: 'mongodb.service.j2', dest: '/etc/systemd/system/mongodb.service' }
|
||||
- { src: 'mongod.conf.j2', dest: "{{ mongodb_conf }}" }
|
||||
|
||||
- name: Restart service if enabled
|
||||
service:
|
||||
|
|
|
@ -21,7 +21,7 @@ logpath = /var/log/mongodb/mongod.log
|
|||
# unixSocketPrefix = /var/run/mongodb
|
||||
|
||||
# Directory for datafiles (defaults to /data/db/)
|
||||
dbpath = /library/dbdata/mongodb
|
||||
dbpath = {{ mongodb_db_path }}
|
||||
|
||||
# Enable/Disable journaling (journaling is on by default for 64 bit)
|
||||
journal = true
|
||||
|
@ -234,4 +234,3 @@ smallfiles = true
|
|||
|
||||
# Activate FIPS 140-2 mode at startup
|
||||
#sslFIPSMode = true
|
||||
|
|
@ -6,7 +6,9 @@ After=syslog.target network.target
|
|||
Type=simple
|
||||
User=mongodb
|
||||
Group=mongodb
|
||||
ExecStart=/usr/bin/mongod -f /etc/mongod.conf
|
||||
ExecStartPre=/usr/bin/mongod --repair --dbpath {{ mongodb_db_path }}
|
||||
ExecStart=/usr/bin/mongod -f {{ mongodb_conf }}
|
||||
ExecStop=/usr/bin/killall mongod
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Loading…
Add table
Reference in a new issue