MongoDB from library configuration

Source: Internet
Author: User

1. Start MongoDB in master mode first

2. Import the data files of the main library:
/data/mongodb-3.0.12/bin/mongorestore/data/tmp/mongodbbak/

3. Close the Mongdb:
Kill-2 PID

4. Modify the configuration file, set the boot from the mode, and set the main library's IP and port, note first talnet test the main library's IP and port is unblocked
5.
6. Start from the database

7. Check ps–ef| grep MONGO, NETSTAT–TLUNP and tail–f logfile
[Email protected] mongodb]# tail-f/data/logs/mongologs/mongodb.log
2018-06-08t16:43:34.705+0800 I REPL [replslave] syncing from host:112.25.75.57:27017
2018-06-08t16:43:35.713+0800 I REPL [replslave] syncing from host:112.25.75.57:27017
2018-06-08t16:43:36.721+0800 I REPL [replslave] syncing from host:112.25.75.57:27017
2018-06-08t16:43:37.730+0800 I REPL [replslave] syncing from host:112.25.75.57:27017

8. Open the MONGO client to view the database status:
./mongo into the shell
Rs.slaveok ()
Show DBS
Exit

#查看主从同步延时 #
Rs.slaveok ();
Db.printreplicationinfo ();
Quit ();

MongoDB from library configuration

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.