MongoDB is installed using the Yum command of CentOS, the entire installation process is as follows:
1. Running
Yum Info Mongo-10gen
See if there is a MongoDB source, such as skip to step 3rd.
2. Running
Vim/etc/yum.repos.d/10gen.repo
Enter the following and save
[10gen]
Name=10gen Repository
Baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64
Gpgcheck=0
3. Running
Yum Install Mongo-10gen-server Mongo-10gen
Installing MongoDB
4. Modify the configuration:
Vim/etc/mongod.conf
Several paths were modified:
Logpath=/data/log/mongodb/mongod.log
Dbpath=/data/mongo
Pidfilepath=/data/run/mongodb/mongod.pid
5. Start MongoDB:
Service Mongod Start
Failed!!!!
Direct command line startup:
Mongod
Normal ~ ~ ~
With configuration file start:
Mongod-f/etc/mongod.conf
Normal ~ ~ ~
Open the Mongod startup file:
Vim/etc/init.d/mongod
After the startup instruction is >/dev/null 2>&1 deleted, again using service Mongod start, the following error is displayed:
Error:child process failed, exited with error number 1
Baidu, someone mentioned is the data catalog all the problems, modify the directory owner for Mongod:mongod:
Chown-r Mongod.mongod/data/mongo
Service Mongod start still fails.
Lenovo to/etc/mongod.conf modified three directories, so they are all modified to mongod.mongod all:
Chown-r Mongod.mongod/data/log/mongodb/data/run/mongodb
Reboot, finally normal.
Repair of MongoDB startup failure in CentOS