In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
MongoDB 2.4.10 installation and configuration
Prepare for
1. Download the installation file.
Cd / tmp wget https://www.mongodb.org/dr//fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.4.10.tgz/downloadtar-zxvf download cd / tmp/mongodb-linux-x86_64-2.4.10/bin cp * / usr/bin/
Installation
1. Create startup user mongod.
Groupadd mongod useradd-g mongod mongod
Or
Useradd-M-s / sbin/nologin mongod
two。 Create a database directory.
# log file directory mkdir-p / data/var/log/mongodb/ # data file directory mkdir-p / data/var/lib/mongodb/ # PID file directory mkdir-p / data/var/run/mongodb/
3. Modify the directory owner.
Cd / data/var chown-R mongod.mongod log lib run
Configuration
1. Create a profile / etc/mongod.conf.
Logpath=/data/var/log/mongodb/mongod.log logappend=true fork=true dbpath=/data/var/lib/mongodb journal=true directoryperdb = true auth = true # replSet = rs_test # keyFile = / etc/mongo_main.key
two。 If you are configured as a member of a replica set, copy the file from another member.
Scp-P 22 / etc/mongod.conf root@192.168.0.3:/tmp scp-P 22 / etc/mongo_main.key root@192.168.0.3:/tmp cp / tmp/mongo_main.key / etc/ cp / tmp/mongod.conf / etc/ chown mongod.mongod / etc/mongo_main.key
3. Create the startup script mongod.
Scp-P 22 / etc/init.d/mongod root@192.168.0.3:/tmp cp / tmp/mongod / etc/init.d/mongod chkconfig-level 35 mongod on
4. Modify the maximum number of open files in the system.
Ulimit-n 64000 vi / etc/security/limits.conf
At the end, add:
* soft nofile 64000
* hard nofile 64000
* soft nproc 32000
* hard nproc 32000
Vi / etc/profile
At the end, add:
Ulimit-n 64000
Add ulimit-n 64000 to the startup script mongod
5. Start the service.
Service mongod start
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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.