1. Download Linux version of MongoDB database
Download the MongoDB Linux version to the official download page, 32-bit or 64-bit to choose from their own situation
Http://www.mongodb.org/downloads
or download directly from the server using wget
wget http://fastdl.mongodb.org/linux/mongodb-linux-i686-1.8.2.tgz
Unzip the compressed package after the download is complete
Tar zxf mongodb-linux-i686-1.8.2.tgz
2. Installation Preparation
Move MongoDB to the/usr/local/mongdb folder
MV Mongodb-linux-i686-1.8.2/usr/local/mongodb
Create a database folder
Mkdir/usr/local/mongodb/data
Add MongoDB Startup items to rc.local guarantee MongoDB start when server is powered on
echo "/usr/local/mongodb/bin/mongod--dbpath=/usr/local/mongodb/data" >>/etc/rc.local
Start MongoDB
/usr/local/mongodb/bin/mongod--dbpath=/usr/local/mongodb/data
See the output of the following figure shows that MongoDB started
Of course, if you are not comfortable, you can run the following command
/usr/local/mongodb/bin/mongo
To enter the MongoDB shell mode, if you see the following output, it means that MongoDB has started successfully, Have fun!
Supplementary content:
Method of installing MongoDB production environment through Yum
Create and edit
/etc/yum.repos.d/10gen.repo
64-bit System please fill in the following content
[10gen]
Name=10gen Repository
Baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64
Gpgcheck=0
32-bit system please fill in the following content
[10gen]
Name=10gen Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/i686
Gpgcheck=0
Note that the MONGODB has 2GB data capacity limitations under the 32-bit system
Run the following command after saving
Yum Install Mongo-10gen-server
You can install the MongoDB.