Mongodb之使用rpm包安装配置启动

  下载rpm包

1
2
3
4
5
wget https://mirrors.aliyun.com/mongodb/yum/redhat/7Server/mongodb-org/3.2/x86_64/RPMS/mongodb-org-3.2.2-1.el7.x86_64.rpm
wget https://mirrors.aliyun.com/mongodb/yum/redhat/7Server/mongodb-org/3.2/x86_64/RPMS/mongodb-org-tools-3.2.20-1.el7.x86_64.rpm
wget https://mirrors.aliyun.com/mongodb/yum/redhat/7Server/mongodb-org/3.2/x86_64/RPMS/mongodb-org-shell-3.2.20-1.el7.x86_64.rpm
wget https://mirrors.aliyun.com/mongodb/yum/redhat/7Server/mongodb-org/3.2/x86_64/RPMS/mongodb-org-server-3.2.20-1.el7.x86_64.rpm
wget https://mirrors.aliyun.com/mongodb/yum/redhat/7Server/mongodb-org/3.2/x86_64/RPMS/mongodb-org-mongos-3.2.20-1.el7.x86_64.rpm

  安装

1
2
rpm -ivh mongodb-org-3.2.20-1.el7.x86_64.rpm         mongodb-org-server-3.2.20-1.el7.x86_64.rpm  mongodb-org-tools-3.2.20-1.el7.x86_64.rpm
mongodb-org-mongos-3.2.20-1.el7.x86_64.rpm  mongodb-org-shell-3.2.20-1.el7.x86_64.rpm

  修改配置文件/etc/mongod.conf

1
2
3
4
5
6
7
8
9
10
11
12
13
14
systemLog:
  destination: file
  logAppend: true
  path: /var/log/mongodb/mongod.log
storage:
  dbPath: /data/mongo
  journal:
    enabled: true
processManagement:
  fork: true  # fork and run in background
  pidFilePath: /var/run/mongodb/mongod.pid  # location of pidfile
net:
  port: 27017
  bindIp: 127.0.0.1  # Listen to local interface only, comment to listen on all interfaces.

  启动

1
systemctl start mongod

  连接

1
mongo --host 127.0.0.1:27017

 

posted @   minseo  阅读(2514)  评论(0编辑  收藏  举报
编辑推荐:
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
点击右上角即可分享
微信分享提示