Skip to content

Instantly share code, notes, and snippets.

@wbzyl
Created November 17, 2011 16:21
Show Gist options
  • Save wbzyl/1373583 to your computer and use it in GitHub Desktop.
Save wbzyl/1373583 to your computer and use it in GitHub Desktop.
Uruchamianie MongoDB
#! /bin/bash
function usageexit() {
echo "Usage: $(basename $0) [PORT] [other mongodb options]" >&2
exit 1
}
dbpath=$HOME/.data/var/lib/mongodb
config_file=$HOME/bin/mongodb.config
if [ ! -e $config_file ]
then
usageexit
fi
if [ $# -eq 1 ]; then
port=$1
shift
fi
: ${port:=27017}
echo "---- MongoDB config file:"
cat $config_file
echo "--------------------------"
mongod --config $config_file --dbpath $dbpath --port $port "$@"
journal=true # requires approx. 0.5 GB on disk
rest=true
cpu=true
directoryperdb=true
jsonp=true
nssize=2
smallfiles=true
objcheck=true
syncdelay=4
# bind_ip=0.0.0.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment