1. Download the Linux version of the MongoDB database
Download MongoDB Linux version to the official download page, 32-bit or 64-bit choose according to your 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 package after 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
Adding a MongoDB boot project to rc.local ensures that MongoDB starts when the 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
The output you see shows that MongoDB is up.
Of course, if you are not sure, you can run the following command
/usr/local/mongodb/bin/mongo
To enter MongoDB Shell mode, if you see the following output, then the MongoDB has started successfully, and has fun!
Supplemental content:
How to install MongoDB production environment with 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 contents
[10gen]
Name=10gen Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/i686
Gpgcheck=0
Note MongoDB has a limit of 2GB data capacity under 32-bit systems
Run the following command after saving
Yum Install Mongo-10gen-server
You can install MongoDB.
How does CentOS 5.6 Install the MongoDB database?