centos 安装 mongodb 服务

  1. 安装
yum install mongodb-server
  1. 启动
systemctl start mongod
  1. 查看状态
systemctl status mongod  //查看状态
  1. 配置路径 默认配置文件*/etc/mongod.conf*
...
    # Directory for datafiles (defaults to /data/db/)
    dbpath = /var/lib/mongodb
    ...
  1. 容许外网访问 默认配置文件*/etc/mongod.conf*,注释掉bind_ip
...
# Comma separated list of ip addresses to listen on (all local ips by default)
#bind_ip = 127.0.0.1
...
相关文章
相关标签/搜索