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 and uninstall MongoDB database in Centos 7.2.How to install and uninstall MongoDB database

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly shows you "Centos 7.2 how to install and uninstall MongoDB database", the content is easy to understand, well-organized, hope to help you solve your doubts, the following let Xiaobian lead you to study and learn how to install and uninstall MongoDB database in Centos 7.2 "this article.

I. Preface

As we all know, MongoDB is written in C++ language and is an open source database system based on distributed file storage.

MongoDB aims to provide scalable, high-performance data storage solutions for WEB applications.

MongoDB stores data as a document, the data structure consists of key-value pairs, the document is similar to JSON objects, field values can contain other documents, arrays and document arrays. In the case of high load, adding more nodes can ensure server performance.

This article will give you a detailed introduction to the installation and uninstallation of MongoDB in Centos 7.2. Let's take a look at the detailed introduction.

II. Installation

2.1 add Source

Vim / etc/yum.repos.d/mongodb-org-3.4.repo [mongodb-org-3.4] name=MongoDB Repositorybaseurl= https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.4/x86_64/gpgcheck=1enabled=1gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc

2.2 installation

Yum install-y mongodb-org

2.3 start the service

Service mongod start

Results:

[root@localhost ~] # service mongod startRedirecting to / bin/systemctl start mongod.service [root@localhost ~] # ps-ef | grep mongodmongod 24960 1 1 23:43? 00:00:00 / usr/bin/mongod-f / etc/mongod.confroot 24989 24056 0 23:43 pts/0 00:00:00 grep-- color=auto mongod

2.4 self-booting

Chkconfig mongod on

III. Catalogue introduction

Configuration file:

/ etc/mongod.conf

Data catalog:

/ var/lib/mongo

Log directory:

/ var/log/mongodb

If you need to modify the data directory and log directory, just modify the storage.dbPath and systemLog.path in / etc/mongod.conf.

IV. Unloading

4.1 shut down the service

Service mongod stop

4.2 Delete related packages

Yum erase $(rpm-qa | grep mongodb-org)

4.3 Delete directories and files

Rm-r / var/log/mongodbrm-r / var/lib/mongo

V. encounter problems by chance

1) Failed to unlink socket file / tmp/mongodb-27017.sock Operation not permitted

Solution: delete the file

2) Unable to lock file: / var/lib/mongo/mongod.lock

Solution: clear the contents of the file

The above is all the contents of the article "how to install and uninstall MongoDB database in Centos 7.2.Thank you for reading!" I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, 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

Database

Wechat

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

12
Report