centos 7 yum安装mongodb
linux yum安装mongodb1.安装
#yum -y install mongodb
#yum -y install mongodb-server
2.查看mongodb默认配置文件/etc/mongodb.conf
bind_ip = 127.0.0.1
fork = true
pidfilepath = /var/run/mongodb/mongod.pid
logpath = /var/log/mongodb/mongod.log
unixSocketPrefix = /var/run/mongodb
dbpath = /var/lib/mongodb
3.启动mongodb
这里使用后台运行mongodb,使用--logpath和--fork参数
# ./mongod --dbpath=/var/lib/mongodb
about to fork child process, waiting until server is ready for connections.
forked process: 1195
child process started successfully, parent exiting
现在mongodby已经在后台运行了,现在可以使用bin目录下的mongo登入了。
6.登入mongo
页:
[1]