原因:因为工作需要,集中管理log4j日志到MongoDB!
1 |
wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.2.3.tgz |
1 |
tar zxvf mongodb-linux-x86_64-2.2.3.tgz |
1 |
mv mongodb-linux-x86_64-2.2.3 /usr/ local /mongodb |
1 |
cd /usr/ local /mongodb |
1 |
mkdir -p ./data/db/ |
1 |
mkdir logs |
1 |
/usr/ local /mongodb/bin/mongod --dbpath=/usr/ local /mongodb/data/db --logpath=/usr/ local /mongodb/logs/mongodb.log --fork |
1 |
forked process: 18261 |
2 |
all output going to: /usr/ local /mongodb/logs/mongodb.log |
3 |
log file [/usr/ local /mongodb/logs/mongodb.log] exists; copied to temporary file [/usr/ local /mongodb/logs/mongodb.log.2013-03-01T04-04-28] |
4 |
child process started successfully, parent exiting |
1 |
echo "/usr/local/mongodb/bin/mongod --dbpath=/usr/local/mongodb/data/db --logpath=/usr/local/mongodb/logs/mongodb.log --fork" >> /etc/rc. local |
1 |
tail -f /usr/ local /mongodb/logs/mongodb.log |
1 |
ps aux | grep mongodb |
1 |
root 18261 0.0 1.4 150392 29948 ? Sl 12:04 0:00 /usr/ local /mongodb/bin/mongod --dbpath=/usr/ local /mongodb/data/db --logpath=/usr/ local /mongodb/logs/mongodb.log --fork |
CentOS系统环境下安装MongoDB,布布扣,bubuko.com
原文地址:http://www.cnblogs.com/jthb/p/3708891.html