搜索正面五个文件,由于MongoDB的redhat国外镜像访问非常慢,下载安装suse版本并安装:
mongodb-org-2.6.6-1.i686.rpm
mongodb-org-mongos-2.6.6-1.i686.rpm
mongodb-org-server-2.6.6-1.i686.rpm
mongodb-org-shell-2.6.6-1.i686.rpm
mongodb-org-tools-2.6.6-1.i686.rpm
验证环境变量是否生效:
$ mongod -version
db version v2.6.0
2014-04-14T02:53:01.082+0000 git version: 1c1c76aeca21c5983dc178920f5052c298db616c
运行MongoDB:
创建数据目录
$ mkdir -p mongodb/data/db
要确保mongod对数据目录有读写权限。
运行MongoDB(指定建立的数据目录)
$ mongod --dbpath /home/chuser/mongodb/data &
6、验证MongoDB是否正常运行
[root@admin cache]# mongo
MongoDB shell version: 2.6.6
connecting to: test
Server has startup warnings:
2014-12-25T16:46:16.374+0800 [initandlisten]
2014-12-25T16:46:16.374+0800 [initandlisten] ** NOTE: This is a 32 bit MongoDB binary.
2014-12-25T16:46:16.374+0800 [initandlisten] ** 32 bit builds are limited to less than 2GB of data (or less with --journal).
2014-12-25T16:46:16.374+0800 [initandlisten] ** Note that journaling defaults to off for 32 bit and is currently off.
2014-12-25T16:46:16.374+0800 [initandlisten] ** See http://dochub.mongodb.org/core/32bit
2014-12-25T16:46:16.374+0800 [initandlisten]
> show databases;show databases;
admin (empty)
local 0.078GB