CentOS 下安装MongoDB

在CentOS下安装MongoDB较为简单,直接使用rpm安装即可

  1. 去官网下载rpm安装包
    wget https://repo.mongodb.org/yum/redhat/7/mongodb-org/4.0/x86_64/RPMS/mongodb-org-server-4.0.6-1.el7.x86_64.rpm
  2. 安装MongoDB
    rpm -i mongodb-org-server-4.0.6-1.el7.x86_64.rpm
  3. 打开MongoDB
    service monogod start
  4. 打开MongoDB的配置文件查看各种数据存放位置
    vim /etc/monogod.conf
    并将bindIp改为:0.0.0.0
# mongod.conf

## 日志文件存放位置
systemLog:
  destination: file
  logAppend: true
  path: /var/log/mongodb/mongod.log

## 数据库存放位置
storage:
  dbPath: /var/lib/mongo
  journal:
    enabled: true

# how the process runs
processManagement:
  fork: true  # fork and run in background
  pidFilePath: /var/run/mongodb/mongod.pid  # location of pidfile
  timeZoneInfo: /usr/share/zoneinfo

# network interfaces
## 网络端口
net:
  port: 27017
  bindIp: 0.0.0.0 #将此次的127.0.0.1改为0.0.0.0  
  # Enter 0.0.0.0,:: to bind to all IPv4 and IPv6 addresses or, alternativel, use the net.bindIpAll setting.

  转载请注明: 生而为人 CentOS 下安装MongoDB

 上一篇
Maven项目报错:Classpath entry org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER will not be exported or published. Runtime ClassNotFoundExceptions may result. Maven项目报错:Classpath entry org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER will not be exported or published. Runtime ClassNotFoundExceptions may result.
eclipse中创建Maven项目之后出现警告:Classpath entry org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER will not be exported or published. Ru
2019-03-13
下一篇 
Linux删除命令 Linux删除命令
命令构成rm [选项] 文件 主要用到的命令参数-f|–force 忽略不存在的文件,强制删除,无任何提示-i|–interactive 进行交互式删除,即每删除一个文件就询问一句-r|-R|–recursive 递归式的删除目录下所有文
2019-02-23
  目录