<pre name="code" class="plain">
最近在学MongoDB,在这里记下安装流程
Mongodb的安装方法在其官网有详细的介绍:http://docs.mongodb.org/manual/
首先查看自己系统的版本:
lsb_release -a
LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: CentOS
Description: CentOS release 6.3 (Final)
Release: 6.3
Codename: Final
对应官网的:
Install MongoDB > Install on Linux > Install MongoDB on Red Hat Enterprise, CentOS, Fedora, or Amazon Linux
我的系统是64位的,在/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
保存,推出,再:
确认安装成功yum install -y mongodb-org
whereis mongod
mongod: /usr/bin/mongod /etc/mongod.conf /usr/share/man/man1/mongod.1
启动(启动时直接读的配置文件):
/usr/bin/mongod -f /etc/mongod.conf