Configure the package management system (yum
)
[root@jenkins ~]# vim /etc/yum.repos.d/mongodb-org-4.2.repo [mongodb-org-4.2] name=MongoDB Repository baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.2/x86_64/ gpgcheck=1 enabled=1 gpgkey=https://www.mongodb.org/static/pgp/server-4.2.asc
Install the MongoDB packages.
To install the latest stable version of MongoDB, issue the following command:
[root@jenkins ~]# yum install -y mongodb-org
Alternatively, to install a specific release of MongoDB, specify each component package individually and append the version number to the package name, as in the following example:
sudo yum install -y mongodb-org-4.2.5 mongodb-org-server-4.2.5 mongodb-org-shell-4.2.5 mongodb-org-mongos-4.2.5 mongodb-org-tools-4.2.5
Start MongoDB
[root@jenkins ~]# systemctl enable mongod [root@jenkins ~]# systemctl start mongod
开启远程访问
[root@jenkins ~]# vim /etc/mongod.conf net: port: 27017 bindIp: 0.0.0.0 [root@jenkins ~]# systemctl restart mongod
继续阅读
- 我的QQ
- QQ扫一扫
-
- 我的头条
- 头条扫一扫
-
评论