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
As the data stored in the MySQL database graduall...
as follows: docker run -d -p 5000:23 -p 5001:22 -...
Simply put, src means "I want to load this r...
one. Overview of IE8 Compatibility View <br /&...
The establishment of MySQL index is very importan...
Table of contents Overview Using mapped types to ...
background Today, while cooperating with other pr...
Some time ago, the project needed to develop the ...
Previous This is a classic old question. Since a ...
This article shares the specific code of js to im...
today select * from table name where to_days(time...
Introduction to structural pseudo-class selectors...
Table of contents 1. Vue listener array 2. Situat...
As shown below, if it were you, how would you ach...
Table of contents 1. Background: 2. Design ideas:...