Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install MongoDB for Linux Centos 7 Yum source

2025-03-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the Linux Centos 7 Yum source how to install MongoDB related knowledge, the content is detailed and easy to understand, simple and fast operation, has a certain reference value, I believe that everyone after reading this Linux Centos 7 Yum source how to install MongoDB article will have a harvest, let's take a look.

System version is Linux Centos 7, using Yum source to install MongoDB

Yum source

Use to summarize several commonly used:

/ 1 install yum install package / / install specified installation packages package / / 2 Update and upgrade yum update / / Update all yum update package / / Update specified packages packageyum check-update / / check updatable programs yum upgrade package / / upgrade specified packages package / / 3 find and display yum info / / list all packages that can be installed or updated yum info package / / display Installation package information packageyum list / / Show all installed and available packages yum list package / / Show specified package installation packageyum search package / / search for package matching specific characters details / / 4 remove program yum remove | erase package / / remove package packageyum deplist package / / View program package dependencies / / 5 clear cache yum clean packages / / clear Software package in cache directory yum clean headers / / clear headers yum clean oldheaders / / clear old headers yum clean in cache directory Yum clean all / / (= yum clean packages Yum clean oldheaders) clear the package in the cache directory and the old headers replication code to install the Mongodb configuration system yum source 1. Create a. Repo file and generate the source vi / etc/yum.repos.d/mongodb-org-4.0.repo copy code 2. 0 for mongodb. Add the following configuration information: [mongodb-org-4.0] name=MongoDB Repositorybaseurl= https://repo.mongodb.org/yum/redhat/#releasever/mongodb-org/4.0/x86_64/gpgcheck=1enabled=1gpgkey=https://www.mongodb.org/static/pgp/server-4.0.asc copy code

Detailed explanation:

The name # name baseurl # gets the download path gpkcheck=1 # to verify the rpm package downloaded from this source; enable=1 # indicates that the source is enabled. Gpgkey # gpg verifies copying code 3. Save exit wq # exit save copy code use yum to install MongoDB1. Install MongoDBsudo yum install-y mongodb-org to copy code 2. Verify the installation result rpm-qa | grep mongodb copy code rpm-ql mongodb-org-server copy code 3. Start MongoDB

Start the MongoDB service

Systemctl start mongod.service copy code

The default port of MongoDB is 27017. Check to see if it is enabled.

Netstat-natp | grep 27017 copy code

Check whether the database is installed successfully

Ps-aux | grep mongod # check whether the process of the database has replication code 4. Verification service enables mongo copy code common command list / / 1, open MongoDBsudo service mongod start or systemctl start mongod.service # open MongoDBsudo chkconfig mongod on # join boot boot sudo service mongod restart # restart MongoDB// 2, close MongoDBsudo service mongod stop # turn off firewall / / 3, Uninstall MongoDBsudo yum erase $(rpm-qa | grep mongodb-org) # Uninstall MongoDBsudo rm-r / var/log/mongodb # Delete log file sudo rm-r / var/lib/mongo # Delete data file copy code remote connection Mongodb1. Modify the configuration file mongodb.confvi / etc/mongod.conf# network interfacesnet: port: 27017 bindIp: 0.0.0.0 # Enter 0.0.0.0Die Enter: to bind to all IPv4 and IPv6 addresses or, alternatively, use the net.bindIpAll setting. Copy the code

Modify binding ip by default 127.0.0.1 only local connections are allowed, so change it to bindIp:0.0.0.0 and exit save

two。 Restart the mongodb service sudo service mongod restart replication code. This is the end of the article on "how to install MongoDB from Linux Centos 7 Yum sources". Thank you for reading! I believe you all have a certain understanding of the knowledge of "Linux Centos 7 Yum source how to install MongoDB". If you want to learn more, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report