$vi /etc/yum.repos.d/mongodb-org-3.0.repo
[mongodb-org-3.0]
name=MongoDB Repository
baseurl=http://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.0/x86_64/
gpgcheck=0
enabled=1
$安装mongodb
yum install -y mongodb-org
配置文件在:/etc/mongod.conf 数据文件在:/var/lib/mongo 日志文件在:/var/log/mongodb
mongodb服务使用
#启动
service mongod start
#停止
service mongod stop
#重启
service mongod restart
#增加开机启动
chkconfig mongod on
[root@localhost ysy]# service mongod start
Starting mongod (via systemctl): Job for mongod.service failed. See 'systemctl status mongod.service' and 'journalctl -xn' for details.
[失败]
[root@localhost ysy]#
[root@localhost ysy]# systemctl status mongod.service
mongod.service - SYSV: Mongo is a scalable, document-oriented database.
Loaded: loaded (/etc/rc.d/init.d/mongod)
Active: failed (Result: exit-code) since 二 2015-12-08 14:15:39 CST; 39s ago
Process: 26948 ExecStart=/etc/rc.d/init.d/mongod start (code=exited, status=1/FAILURE)
12月 08 14:15:39 localhost.localdomain systemd[1]: Starting SYSV: Mongo is a scalable, document-orien......
12月 08 14:15:39 localhost.localdomain runuser[26954]: pam_unix(runuser:session): session opened for ...=0)
12月 08 14:15:39 localhost.localdomain mongod[26948]: Starting mongod: [失败]
12月 08 14:15:39 localhost.localdomain systemd[1]: mongod.service: control process exited, code=exite...s=1
12月 08 14:15:39 localhost.localdomain systemd[1]: Failed to start SYSV: Mongo is a scalable, documen...e..
12月 08 14:15:39 localhost.localdomain systemd[1]: Unit mongod.service entered failed state.
Hint: Some lines were ellipsized, use -l to show in full.
[root@localhost ysy]#