Last active
December 11, 2016 20:24
-
-
Save tomfanning/64254beb13d457666231e913b91d86cd to your computer and use it in GitHub Desktop.
Fix mongodb startup warnings on RHEL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # run once | |
| sed -i -e '/^readahead=/s/^.*$/readahead=32/' /usr/lib/tuned/throughput-performance/tuned.conf | |
| echo "mongod soft nproc 64000" > /etc/security/limits.d/90-nproc.conf | |
| echo '#!/bin/sh -e | |
| echo never > /sys/kernel/mm/transparent_hugepage/defrag | |
| echo never > /sys/kernel/mm/transparent_hugepage/enabled' > /usr/local/sbin/mongodb-prep.sh | |
| chmod +x /usr/local/sbin/mongodb-prep.sh | |
| echo '[Unit] | |
| Description=mongodb prep | |
| Before=mongod.service | |
| [Service] | |
| Type=simple | |
| ExecStart=/usr/local/sbin/mongodb-prep.sh | |
| TimeoutStartSec=0 | |
| [Install] | |
| WantedBy=default.target' > /etc/systemd/system/mongodb-prep.service | |
| systemctl enable mongodb-prep.service |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment