mongodbのインストール

https://docs.mongodb.org/manual/tutorial/install-mongodb-on-red-hat/

repo追加

$ vim /etc/yum.repos.d/mongodb.repo

[mongodb]
name=MongoDB Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/
gpgcheck=0
enabled=1

インストール

$ sudo yum install -y mongodb-org
//パッケージを指定してinstallする
//$ sudo yum install mongodb-org-2.6.1 mongodb-org-server-2.6.1 mongodb-org-shell-2.6.1 mongodb-org-mongos-2.6.1 mongodb-org-tools-2.6.1

サービス起動

$ sudo service mongod start
Starting mongod:  [  OK  ]

mongo起動

$ mongo
MongoDB shell version: 2.6.4
connecting to: test
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
    http://docs.mongodb.org/
Questions? Try the support group
    http://groups.google.com/group/mongodb-user
> use test
switched to db test
> db.hoge.insert({name: "hogehoge"})
WriteResult({ "nInserted" : 1 })
> db.hoge.find()
{ "_id" : ObjectId("540bd2d7a3754bda459c21ad"), "name" : "マグロ" }
> db.dropDatabase()
{ "dropped" : "test", "ok" : 1 }
> show dbs
admin  (empty)
local  0.078GB
> exit
bye