Versions
- CentOS 6.5
- MongoDB 2.4.10
Install
- Edit /etc/yum.repos.d/10gen.repo
1234[10gen]name=10gen Repositorybaseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64gpgcheck=0
- Install
1sudo yum install mongo-10gen mongo-10gen-server
Configure
- Start service
1sudo service mongod start
- Start on boot
1sudo chkconfig mongod on
Test
1 2 3 4 5 6 7 8 9 10 11 12 13 |
$ mongo MongoDB shell version: 2.4.0 > use test switched to db test > db.foo.find() > db.foo.save({a: 1}) > db.foo.find() { "_id" : ObjectId("514cd798c59449cc1f1344d3"), "a" : 1 } > db.foo.update({a: 1}, {a: 5}) > db.foo.find() { "_id" : ObjectId("514cd798c59449cc1f1344d3"), "a" : 5 } > db.foo.remove({a: 5}) > db.foo.find() |
Optional: Open firewall port
- Open port 27017 for mongodb See CentOS 6: Open a port for iptables
Pingback: Rough Notes of Surveying a chunk of Clustering and Super Computing « Admin Junkie