What is MongoDB?
MongoDB is an open source no-schema and high-performance document-oriented NoSQL database (NoSQL means it doesn’t provide any tables, rows, etc.) system much like Apache CouchDB. It stores data in JSON-like documents with dynamic schema’s for better performance. for more information about features visit THIS PAGE.MongoDB Tools
Following are the MongoDB tools that included in the mongo-10gen packages.- mongo
- mongodump
- mongorestore
- mongoexport
- mongoimport
- mongostat
- mongotop
- bsondump
Install MongoDB 2.0.6 on RHEL 6.2/6.1/6/5.8, CentOS 6.2/6.1/6/5.8 and Fedora 12,13,14,15,16,17
Step 1: Adding MongoDB 10gen Repository
1. First, we need to add MongoDB 10gen Repository to install MongoDB 2.0.6 on RHEL 6.2/6.1/6/5.8, CentOS 6.2/6.1/6/5.8, Fedora 17-12 for x86 and x86_64 platforms.2. Create a file under /etc/yum.repos.d/10gen.repo and add the following lines based on your OS version and Bit.
# vi /etc/yum.repos.d/10gen.repo
## For RHEL/CentOS 5-6 32-bit OS ## [10gen] name=10gen Repository baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/i686 gpgcheck=0 ## For RHEL/CentOS 5-6 64-bit OS ## [10gen] name=10gen Repository baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64 gpgcheck=0 ## For Fedora 17-12 32-bit OS ## [10gen] name=10gen Repository baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/i686 gpgcheck=0 ## For Fedora 17-12 64-bit OS ## [10gen] name=10gen Repository baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64 gpgcheck=0
Step 2: Installing MongoDB 2.0.6
Once the repo installed, run the following command to install MongoDB 2.0.6.# yum install mongo-10gen mongo-10gen-server
Step 3: Configure MongoDB Database
Open file /etc/mongod.conf and verify below basic settings. If commented any settings, please un-comment it.# vi /etc/mongod.conf
logpath=/var/log/mongo/mongod.log port=27017 dbpath=/var/lib/mongo
Step 4: Starting MongoDB Database
## Enable MongoDB on Boot ## # chkconfig --add mongod ## Enable MongoDB on Run Level's ## # chkconfig --levels 235 mongod ## Starting MongoDB Server ## # /etc/init.d/mongod start ## Re-Starting MongoDB Server ## # /etc/init.d/mongod restart ## Stopping MongoDB Server ## # /etc/init.d/mongod stop
Step 5: Verifying MongoDB Database
Connect to your MongoDB shell by using following command.# mongo
Command Ouput :
[root@twiki ~]# mongo MongoDB shell version: 2.0.6 connecting to: testThis command will connect to your MongoDB database. Run the following basic commands.
> show dbs > show collections > show users > use <db name>For more information visit official page at http://docs.mongodb.org/manual/contents/.
0 comments:
Post a Comment