Skip to content

Instantly share code, notes, and snippets.

@wbzyl
Last active October 1, 2015 09:48
Show Gist options
  • Save wbzyl/1967489 to your computer and use it in GitHub Desktop.
Save wbzyl/1967489 to your computer and use it in GitHub Desktop.
MongoDB
#! /bin/bash
function usageexit() {
echo "Usage: $(basename $0) [other mongodb options]" >&2
echo ""
echo "---- MongoDB CONFIG FILE:"
cat $config
echo "---- MongoDB PATHS:"
echo dbpath: $dbpath
echo logpath: $logpath
echo pidfilepath: $pidfilepath
echo ""
exit 1
}
config=$HOME/.data/etc/mongod.conf
dbpath=$HOME/.data/var/lib/mongod
logpath=$HOME/.data/var/log/mongodb/mongo.log
pidfilepath=$HOME/.data/var/run/mongodb.pid
if [[ ! ( -e $config && -d $dbpath ) ]]
then
usageexit
fi
$HOME/.mongo/bin/mongod --config $config --dbpath $dbpath --logpath $logpath --pidfilepath $pidfilepath "$@"
journal=true
rest=true
nssize=2
smallfiles=true
# bind_ip=127.0.0.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment