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--
1. Check whether there is a yum source.
Yum info mongo-10gen
2. Add yum source
Vi / etc/yum.repos.d/mongodb.repo
Enter the following:
[mongodb]
Name=MongoDBRepository
Baseurl= http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/
Gpgcheck=0
Enabled=1
3. View the information of mongoDB server package and client package.
Yum infomongo-10gen-server
Yum info mongo-10gen
4. Install the server and client tools of MongoDB
[root@localhostxxx] # yum install mongo-10gen-server
[root@localhostxxx] # yum install mongo-10gen
Or (according to the latest stable version)
Yum install-y mongodb-org
The solution of slow downloading source
Download the rmp package manually and upload it to the corresponding mongodb directory in the server / var/cache/yum
5. Install the php extension
Yum installphp-pecl-mongo
(note: the php-common module cannot be installed before installing php-mongo, otherwise it cannot be installed)
Master-slave synchronization of 6.mongodb
Note: future versions of mongodb2.6 do not support the establishment of local library users, and synchronization of + auth can be done with keyFile.
Generate keyFile:
Openssl rand-base64 753
Save the generated content to the new key file, specify all groups, modify permission to 600, and make a copy to the specified location of the slave.
Master profile:
Vi / etc/mongod.conf
KeyFile=/mnt/mongod/key
# bind_ip
Start:
Mongod-dbpath / mnt/mongod/db-logpath/mnt/mongod/log/mongod.log-master-f / etc/mongod.conf
From the profile:
Vi / etc/mongod.conf
KeyFile=/ mongod/key
# bind_ip
Start:
Mongod-dbpath / mongod/db/-logpath/mongod/log/mongod.log-slave-source 115.28.245.30-f / etc/mongod.conf
You can see it on the host:
From the plane, you can see:
That means the synchronization is successful.
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.