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

Centso install mongodb3.0

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

Install mongodb3.0

Add software source files for mongodb

Enter the command sudo touch / etc/yum.repos.d/mongodb-org-3.0.repo at the terminal

Edit mongodb software source files and add mongodb software sources

Enter the command vim / etc/yum.repos.d/mongodb-org-3.0.repo at the terminal

Then press the keyboard I key to copy the following information to the file

[mongodb-org-3.0]

Name=MongoDB Repository

Baseurl= https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.0/x86_64/

Gpgcheck=0

Enabled=1

Then press the ESC key, press the colon key, enter wq, and enter to save.

Enter the following command at the terminal to install mongodb and components

Sudo yum install-y mongodb-org-3.0.4 mongodb-org-server-3.0.4 mongodb-org-shell-3.0.4 mongodb-org-mongos-3.0.4 mongodb-org-tools-3.0.4

Configure SELinux

Enter sudo vim / etc/selinux/config at the terminal to change it to the following information

After installation, the data storage directory is / var/lib/mongo, and the log storage directory is / var/log/mongodb.

Start mongodb

Sudo service mongod start

Stop mongodb

Sudo service mongod stop

Restart mongodb

Sudo service mongod restart

Set up the boot sudo chkconfig mongod on

Verify that mongodb starts properly

Use the command vim / var/log/mongodb/mongod.log to view information

Enter mongo at the terminal

Uninstall mongodb

Sudo yum erase $(rpm-qa | grep mongodb-org)

Remove data file

Sudo rm-r / var/log/mongodb

Sudo rm-r / var/lib/mongo

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