Home | 简体中文 | 繁体中文 | 杂文 | Github | 知乎专栏 | Facebook | Linkedin | Youtube | 打赏(Donations) | About
知乎专栏

第 35 章 Install 安装MongoDB

目录

35.1. CentOS 8 Stream
35.2. MacOS 安装 MongoDB
35.3. 二进制tar包安装
35.4. Ubuntu MongoDB
35.5. CentOS 7 MongoDB
35.6. 从官网安装最新版本的 MongoDB 3.4
35.6.1. Server
35.6.2. Client
35.6.3. 工具
35.7. MongoDB + Hadoop
35.8. OSCM 一键安装 MongoDB 4.0.2
35.9. Replication
35.9.1. Master
35.9.2. Slave
35.9.3. 测试
35.10. Drivers
35.10.1. Using MongoDB in PHP

35.1. CentOS 8 Stream

		
#!/bin/sh

cat << 'EOF' >> /etc/yum.repos.d/mongodb-org-5.0.repo
[mongodb-org-5.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/5.0/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-5.0.asc
EOF

dnf install -y mongodb-org-server
dnf install -y mongodb-org-shell
dnf install -y mongodb-org-tools

cp /etc/mongod.conf{,.original}


cat << 'EOF' >>  /etc/security/limits.d/20-nofile.conf 
mongod soft nofile 65000
mongod hard nofile 65000
EOF

systemctl is-enabled mongod
systemctl start mongod