1. Make a repo file Refer to the official installation documentation of mongodb and use the following script to create a Yum repository to install mongodb4.2. However, the installation process prompts "Failed to synchronize cache for repo 'mongodb-org-4.2'" [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 The reason is that the official centos8 installation package has not yet been provided. Since the $releasever variable is 8, try to set the address to 7 to see if you can install a version based on centos7. OK, use vim to create a repo file Enter the following configuration into the repo file, save it, and exit vim [mongodb-org-4.2] name=MongoDB Repository baseurl=https://repo.mongodb.org/yum/redhat/7/mongodb-org/4.2/x86_64/ gpgcheck=1 enabled=1 gpgkey=https://www.mongodb.org/static/pgp/server-4.2.asc 2. Install using the yum command The installation process once failed to download because the network was too slow. Just execute it again. After a while, it prompts that the installation is successful and the process goes smoothly. 3. Start mongodb After installing and starting the service, you can use The start, stop, and restart commands are as follows: sudo service mongod start sudo service mongod stop sudo service mongod restart 4. Open remote connection to mongodb The configuration file of mongodb is /etc/mongod.conf If you want to open remote access, you need to modify the bindIp value of the file to: 0.0.0.0, otherwise you will not be able to connect through other computers. After the file is modified, restart is required to make the configuration take effect. If you still cannot connect remotely, open port 27017 in the firewall (this port is the default port of mongodb, and the port of mongodb can be modified through the configuration file) firewall-cmd --permanent --zone=public --add-port=27017/tcp firewall-cmd --reload Refer to the official installation instructions: https://docs.mongodb.com/manual/tutorial/install-mongodb-on-red-hat/#run-mongodb-community-edition Summarize The above is the method of installing mongodb 4.2 on centos8 using yum introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! You may also be interested in:
|
<<: WeChat Mini Program uses simultaneous interpretation to implement speech recognition
>>: Detailed tutorial on compiling and installing MySQL 5.7.24 on CentOS7
This article shares the specific code of js to im...
1. New Features MySQL 5.7 is an exciting mileston...
Environmental Description: There is a running MyS...
In fact, this is very simple. We add an a tag to ...
Table of contents 1. Demand 2. Effect 3. All code...
This article briefly introduces the relationship ...
Win10 installation (skip if already installed) Fo...
Table of contents 1. Scenario Description 2. Solu...
This article example shares the specific code of ...
1. First, double-click the vmware icon on the com...
Pull the image docker pull season/fastdfs:1.2 Sta...
Designers have their own font library, which allo...
1. Introduction The difference between row locks ...
ngx_lua_module is an nginx http module that embed...
This article example shares the specific code of ...