Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Database \ To upgrade combat MongoDB database replication sets and split versions     - Enterprise-class GitHub warehousing environment build (Server)

- Linux Beginner Guide: Installing packages on Ubuntu and Fedora (Linux)

- Linux System Getting Started Tutorial: Using the Linux common commands (Linux)

- ssh using scp: / directory: Permission denied (Server)

- Talk Packages (Linux)

- RHEL 6.4 installed MySQL 5.6.27 (Database)

- MySQL development common query summary (Database)

- Ubuntu Eclipse configuration Gtk + 2.0 libraries (Linux)

- MySQL rollback insert statement causes ibd file grows double (Database)

- 7 extremely dangerous Linux commands (Linux)

- mysqldump MySQL command-line tool (Database)

- iptables allow only specific ip address to access the specified port (Linux)

- Linux commands to access the cheat sheet (Linux)

- Android imageView in the Src and Background (Programming)

- Spring Data JPA call a stored procedure examples (Programming)

- Using Java arrays implement sequential stack (Programming)

- Spring AOP for logging (Programming)

- Python Socket Network Programming (Programming)

- MySQL backup tool to back up mydumper (Database)

- Advanced Linux security settings (Linux)

 
         
  To upgrade combat MongoDB database replication sets and split versions
     
  Add Date : 2018-11-21      
         
         
         
  Problem Description

Copy on the set rs_1 carrying all database operations, and add memory has been unable to meet the application pressure.

solution

Consider splitting the database replication set rs_1 part to rs_2, and at the same time upgrade the database to version 2.6.

ready

Assess the possibility of upgrading

1. Connect 2.6 mongo shell auxiliary member of the replication set to 2.4, the Executive db.upgradeCheckAllDBs in admin Library ().
2. Assessment upgrade to 2.6 application compatibility issues, refer to: http: //docs.mongodb.org/manual/release-notes/2.6-compatibility/

Database partition

Copy centralized database partition member 1. After the split.
2. clarify the corresponding application, you need to update the connection string ready.

Driver Update

1. C # /. NET drive versions will need to upgrade to 1.9 or more in advance.

Steps

It was added to a replication set rs_1 2.6 Secondary members

1. Add the 2.6 version of the Secondary ReplSet 1 member (or an existing version 2.4 Secondary upgrade to version 2.6), specific liters

Level approach, see "Upgrading to MongoDB 2.6."

2. According to the actual situation, to see whether the need to add Arbiter, ensure ReplSet 1 has a base member.
  rs.addArb ( "aaaaaa: 30000")

Copy the part of the database set rs_1 split into rs_2

1. Secondary members of the new 2.6 version of the configuration replica set name
  Modify the configuration file /etc/mongod.conf configuration parameters replSet = rs_2
2. Stop the Secondary member service
  service mongod stop
3. To delete the Secondary member oplog
  cd / data / var / lib / mongodb / local
  rm -rf local. *
4. Start Service
  service mongod start
5. Initializes a new replication set rs_2
  rs.initiate ()
  rs.conf ()
  rs.status ()
6. Upgrade License architecture
  db.getSiblingDB ( "admin") runCommand ({authSchemaUpgrade: 1}).;
7. Remove the replication set rs_1 of the member
  rs.conf ()
  rs.remove ( 'xxxxxx: 27017')
8. Leave the replication set rs_2 database members, delete other libraries.
  use [database name]
  db.dropDatabase ();

Application to modify

1. Modify Copy the link set of strings rs_2 members of the corresponding application.

Version 2.6 added two members to the replication set rs_2

1. Secondary stopped rs_1 two members mongod service
  service mongod stop
2. The database upgrade to version 2.6
3. Delete the data files in the database directory
4. Modify /etc/mongod.conf configuration parameters replSet = rs_2
5. Start mongod service
  service mongod start
6. Connect the new replication set rs_2 of Primary of mongo shell to add two new members
  rs.add ( 'yyyyyy: 27017')
  rs.add ( 'zzzzzz: 27017')
7. Remove the replication set rs_1 yyyyyy member and zzzzzz
  rs.conf ()
  rs.remove ( 'yyyyyy: 27017')
  rs.remove ( 'zzzzzz: 27017')
8. Check the new replication set rs_2 data synchronization status
  rs.status ()
9. In order to avoid, when the data synchronization process, the application end of the large number of queries connection requests, causing synchronization can not be completed, you can hide the

Secondary members. (Optional)
  cfg = rs.conf ()
  cfg.members [1] .priority = 0
  cfg.members [1] .hidden = true
  rs.reconfig (cfg)
  Note: members array index starts at 0.
10. After the completion of the data to be synchronized, then unhide. (Optional)
  cfg = rs.conf ()
  cfg.members [1] .hidden = false
  cfg.members [1] .priority = 1
  rs.reconfig (cfg)
11. If the Primary rs_2 better hardware configuration, you can modify the Primary priority. (Optional)
  cfg = rs.conf ()
  cfg.members [0] .priority = 23
  rs.reconfig (cfg)
12. In step Ignore 9-12 case, if the hardware configuration of a Secondary members better, you want to synchronize data is completed, automatically elected

Primary, in the process of data synchronization, change the priority of the member. After the data to be synchronized, it will automatically switch. (Optional)
  cfg = rs.conf ()
  cfg.members [2] .priority = 23
  rs.reconfig (cfg)

Source replication set rs_1 upgrade to version 2.6

1. Remove the election of members.
  rs.remove ( 'aaaaaa: 30000')
2. Remove the source replication set rs_1 split into a database of members rs_2.
     
         
         
         
  More:      
 
- Linux Shell Scripting (Programming)
- How to install GIMP 2.8.16 in Ubuntu 16.04,15.10,14.04 (Linux)
- CentOS6 installation configuration rsh (Server)
- Setting Linux desktop environment, achieve HiDPI display support (Linux)
- OpenWRT environment to build (Linux)
- Nginx version of helloworld (Server)
- Java to achieve local fileCopy (Programming)
- Applications Linux leap second problem caused (Linux)
- About Linux iptables firewall interview questions and answers (Linux)
- Netapp storage routine inspections and information gathering (Linux)
- Disable unnecessary services under Linux (Linux)
- Deepin Tutorial: Depth Description Installer expert mode (Linux)
- Effect MongoDB plan cache (Database)
- Linux System Tutorial: How to Check MariaDB server versions (Database)
- Firewall chapter of Linux server security configuration (Linux)
- Configuring Haproxy log support (syslog logging support) (Server)
- Linux boot process (Linux)
- Oracle bdump file soaring (Database)
- Change CentOS 7 NIC name eno16777736 to eth0 (Linux)
- iscsiadm command usage (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.