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

MongoDB distributed cluster fragmentation

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

Share

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

MongoDB High availability Cluster Building 1. Environment preparation # non-root users are required to start up, so create a mongo user: useradd mongo# add password for mongo user: echo 123456 | passwd-- stdin mongo# add mongo to sudoersecho "mongo ALL = (root) NOPASSWD:ALL" | tee / etc/sudoers.d/mongochmod 0440 / etc/sudoers.d/mongo# solve sudo: sorry, you must have a tty to run sudo problem Comment out the Default requiretty line sudo sed-I 's/Defaults requiretty/Defaults:chiansun! requiretty/' / etc/sudoers# in / etc/sudoer create a mongo directory mkdir / mongo# add permissions to the corresponding directory chown-R mongo:mongo / mongo# configure mongo's yum source cat > > / etc/yum.repos.d/mongodb-org-4.0.repo / mongo/config/mongod.conf / mongo/shard1/mongod.conf / mongo/shard2/mongod .conf / mongo/shard3/mongod.conf / mongo/mongos/mongod.conf

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