MongoDB 的安装
Ubuntu 12.04 LTS环境:
第一步:下载
下载地址:http://fastdl.mongodb.org/linux/mongodb-linux-i686-2.4.6.tgz
wget http://fastdl.mongodb.org/linux/mongodb-linux-i686-2.4.6.tgz
第二步:解压
tar -zxvf ./mongodb-linux-i686-2.4.6.tgz
cd mongodb-linux-i686-2.4.6/bin
cp ./* /usr/local/bin
安装完毕
第三步:MongoDB部署
sudo mkdir /var/lib/mongodb
配置mongod.conf
fork = true
bind_ip = 127.0.0.1
port = 27017
quiet = true
dbpath = /srv/mongodb
logpath = /var/log/mongodb/mongod.log
logappend = true
journal = false
创建日志目录:
sudo mkdir /var/log/mongodb
开启进程
sudo /usr/local/bin/mongod --config /etc/mongodb.conf
如果有这个提示:
about to fork child process, waiting until server is ready for connections.
forked process: 11159
all output going to: /var/log/mongodb/mongod.log
child process started successfully, parent exiting
表示安装成功。
尝试一下登陆
davidzhang@10.211.55.5:~$ mongo
MongoDB shell version: 2.4.6
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
Server has startup warnings:
Tue Oct 15 12:42:00.747 [initandlisten]
Tue Oct 15 12:42:00.747 [initandlisten] ** NOTE: This is a 32 bit MongoDB binary.
Tue Oct 15 12:42:00.747 [initandlisten] ** 32 bit builds are limited to less than 2GB of data (or less with --journal).
Tue Oct 15 12:42:00.747 [initandlisten] ** See http://dochub.mongodb.org/core/32bit
Tue Oct 15 12:42:00.748 [initandlisten]
>
CentOS release 6.4 (Final)环境:
第一步:下载
下载地址:http://fastdl.mongodb.org/linux/mongodb-linux-i686-2.4.6.tgz
wget http://fastdl.mongodb.org/linux/mongodb-linux-i686-2.4.6.tgz
第二步:解压
tar -zxvf ./mongodb-linux-i686-2.4.6.tgz
cd mongodb-linux-i686-2.4.6/bin
cp ./* /usr/local/bin
安装完毕
第三步:MongoDB部署
sudo mkdir /var/lib/mongodb
配置mongod.conf
fork = true
bind_ip = 127.0.0.1
port = 27017
quiet = true
dbpath = /srv/mongodb
logpath = /var/log/mongodb/mongod.log
logappend = true
journal = false
创建日志目录:
sudo mkdir /var/log/mongodb
开启进程
sudo /usr/local/bin/mongod --config /etc/mongodb.conf
如果有这个提示:
about to fork child process, waiting until server is ready for connections.
forked process: 11159
all output going to: /var/log/mongodb/mongod.log
child process started successfully, parent exiting
表示安装成功。
尝试一下登陆
[davidzhang@colud mongodb]$ mongo
MongoDB shell version: 2.4.6
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
Server has startup warnings:
Tue Oct 15 12:51:13.884 [initandlisten]
Tue Oct 15 12:51:13.884 [initandlisten] ** NOTE: This is a 32 bit MongoDB binary.
Tue Oct 15 12:51:13.884 [initandlisten] ** 32 bit builds are limited to less than 2GB of data (or less with --journal).
Tue Oct 15 12:51:13.884 [initandlisten] ** Note that journaling defaults to off for 32 bit and is currently off.
Tue Oct 15 12:51:13.884 [initandlisten] ** See http://dochub.mongodb.org/core/32bit
Tue Oct 15 12:51:13.884 [initandlisten]
>
参考文章:
http://f.dataguru.cn/thread-107361-1-1.html
http://docs.mongodb.org/manual/reference/configuration-options/
http://docs.mongodb.org/manual/tutorial/install-mongodb-on-linux/
http://docs.mongodb.org/manual/administration/configuration/
http://www.cnblogs.com/TankMa/archive/2011/06/08/2074947.html
版权声明
由 davidzhang创作并维护的 Gowhich博客采用创作共用保留署名-非商业-禁止演绎4.0国际许可证。
本文首发于 博客( https://www.gowhich.com ),版权所有,侵权必究。
本文永久链接: https://www.gowhich.com/blog/419
版权声明
由 davidzhang创作并维护的 Gowhich博客采用创作共用保留署名-非商业-禁止演绎4.0国际许可证。
本文首发于 Gowhich博客( https://www.gowhich.com ),版权所有,侵权必究。
本文永久链接: https://www.gowhich.com/blog/419