Created
September 25, 2018 16:02
-
-
Save zfz/3b7e754784286bf60b4bcc245fc5416c to your computer and use it in GitHub Desktop.
MongoDB service scripts and configurations
This file contains 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
#!/bin/bash | |
MONGO_CONFIG=/vagrant/Applications/mongodb-linux/scripts/mongod.conf.yaml | |
MONGO_DB_PATH=/home/vagrant/Data/mongo | |
# Mongo start and stop | |
function start_mongo() { | |
mongod --config ${MONGO_CONFIG} | |
} | |
function stop_mongo() { | |
mongod --dbpath ${MONGO_DB_PATH} --shutdown | |
} | |
opt=$1 | |
case $opt | |
in | |
start) start_mongo ;; | |
stop) stop_mongo ;; | |
*) echo "Nothing to do" | |
exit ;; | |
esac |
This file contains 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
# http://dba.stackexchange.com/questions/82591/sample-yaml-configuration-files-for-mongodb | |
storage: | |
engine: wiredTiger | |
dbPath: "/home/vagrant/Data/mongo" | |
journal: | |
enabled: true | |
systemLog: | |
destination: file | |
path: "/home/vagrant/Data/mongo/mongod.log" | |
logAppend: true | |
timeStampFormat: iso8601-utc | |
processManagement: | |
fork: true | |
net: | |
bindIp: 0.0.0.0 | |
port: 27017 | |
wireObjectCheck : false | |
unixDomainSocket: | |
enabled : true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment