Skip to content

Instantly share code, notes, and snippets.

@ifels
Created October 18, 2014 07:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ifels/25819cce7c15709177e1 to your computer and use it in GitHub Desktop.
Save ifels/25819cce7c15709177e1 to your computer and use it in GitHub Desktop.
centos6.5_mongodb
第一步,在/etc/yum.repos.d/目录下创建一个源配置文件mongodb.repo:
cd /etc/yum.repos.d/
vim mongodb.repo
填写如下内容:
[mongodb]
name=MongoDB Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/
gpgcheck=0
enabled=1
保存,则会产生一个/etc/yum.repos.d/mongodb.repo文件。
下面直接执行如下指令即可自动安装好mongodb:
sudo yum install -y mongodb-org
命令:
sudo service mongod start
sudo service mongod stop
sudo service mongod restart
配置:
/etc/mongod.conf
默认端口:27017
开机启动:
sudo chkconfig mongod on
参考:
http://docs.mongodb.org/manual/tutorial/install-mongodb-on-red-hat-centos-or-fedora-linux/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment