The platform of the trend who can block? Take your net and dash it! Http://www.cnblogs.com/dunitian/p/4822808.html
First say recommended installation: Online installation, follow the official walk can avoid some problems
No Linux-based comrades:
First go to the official Download offline installation package: https://www.mongodb.com/
FTP Connect the server, upload the offline package up
Xshell Connect:
Unzip the file (you can press the TAB key if you lose a bit, it will complete automatically):tar-xzf mongo*
Decompression command is not clear can go to the document library to see the basic command http://dnt.dkill.net/dnt
Switch to root user, copy folder to/usr/local directory (general software is installed here), rename folder
Cp-r MongoDB-...../usr/local/
MV Mongodb..../MongoDB
The command does not understand, see:
Switch to the/usr/local/mongodb directory, create a database directory and a journal file, run Mongod in the background (./represents the current directory )
mkdir DBS
Touch logs
./mongod--dbpath=/usr/local/mongodb/dbs/--logpath/usr/local/mongodb/logs--fork
View process, End process
Pstree-p | grep Mongod
Pkill Mongod
If the prompt does not have the Pstree command, you are also the smallest installation, do not panic, install can
Yum install-y Psmisc (For the ease of application, you can-y, fully automated installation, do not rest assured that they looked at each)
Is it too much trouble to start? can be simplified by = = "
If it is the first time to use VI, first click I, enter the editing mode, after the input is complete, press ESC, enter : Wq Enter. If you find that no matter how do not return, do not fear, strong back : q!
Enter ./mongod-f mongod.conf to start
In general, add the startup item so dry, the inverse of the day playing Kali is also so dry, the last time the SSH can not be started is so dry ~ ~ ~ but ... Do not know why, CentOS so do not, so, skip this step
Switch to this directory first:Cd/lib/systemd/system
Create a service for MongoDB:VI mongodb.service
Enter the following:
[Unit]
Description=mongodb
After=network.target Remote-fs.target Nss-lookup.target
[Service]
Type=forking
execstart=/usr/local/mongodb/bin/mongod --config /usr/local/mongodb/bin/mongod.conf
Execreload=/bin/kill-s HUP $MAINPID
execstop=/usr/local/mongodb/bin/mongod --shutdown--config /usr/local/mongodb/bin/mongod.conf
Privatetmp=true
[Install]
Wantedby=multi-user.target
Start Service:systemctl start Mongodb.service
Stop service:systemctl stop Mongodb.service
Boot start:systemctl enable Mongodb.service
Not clear can see common Linux documents: http://dnt.dkill.net/dnt/linux/cmd.html
Restart after the discovery ~mongodb has been powered on since the boot!
Now you can delete the beginning of the file ~
2. Online Installation:
Common errors encountered during novice installation: http://www.cnblogs.com/dunitian/p/6274437.html
Another day. Hey, here are some diagrams to prove that the database is fine.