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
...
相關文章
相關標籤/搜索