- CentOS6.4の64bitがインストールされていること
- 以下の操作はrootで実行することを想定していること
touch /etc/yum.repos.d/10gen.repo
vi /etc/yum.repos.d/10gen.repo
下記を10gen.repoファイルへ記載
[10gen]
name=10gen Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64
gpgcheck=0
enabled=0
yum --enablerepo=10gen install mongo-10gen mongo-10gen-server -y
yum --enablerepo=10gen install mongo-10gen-2.2.3 mongo-10gen-server-2.2.3 -y
vi /etc/yum.conf
exclude=mongo-10gen,mongo-10gen-server
※上記で作成した10gen.repoファイルで、enable=0としているためyum update時にmongoDBまでも自動でアップデートされることはないように思われるが、万全を期するなら設定する。
service mongod start
chkconfig mongod on
mongo
MongoDB shell version: 2.4.1
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
>
/etc/mongod.conf
mongoDBのプロセスを実行する権限によって、以下のディレクトリのパーミッションには注意が必要
データのストアディレクトリ
/var/lib/mongo
ログディレクトリ
/var/log/mongo
/var/log/mongo/mongod.log ----- mongo-serverプロセスの実行ログを参照可能