[SERVER-38103] sync from special position Created: 13/Nov/18 Updated: 16/Nov/21 Resolved: 20/Nov/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Replication |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Question | Priority: | Trivial - P5 |
| Reporter: | lee mingyu | Assignee: | Danny Hatcher (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Participants: |
| Description |
|
current status primary-secondary-arbiter (1:1:1) 1) secondary server fails
I want to do below 2) in primary in case of Mysql change master |
| Comments |
| Comment by Danny Hatcher (Inactive) [ 20/Nov/18 ] |
|
Hello, Unfortunately, your proposed plan has not been tested by us so we cannot prove that it will work. I recommend that you follow one of our documented methods on resyncing a member of a replica set. Please note that the SERVER project is for reporting bugs or feature suggestions for the MongoDB server. For MongoDB-related support discussion in the future please post on the mongodb-user group or Stack Overflow with the mongodb tag. A question like this involving more discussion would be best posted on the mongodb-users group. Thank you, Danny |
| Comment by lee mingyu [ 20/Nov/18 ] |
|
I think that replication is based on oplog query the secondary will request primary bigger oplog entry than already has if secondary has a special optime in local db i think that a inital sync is not started |
| Comment by Danny Hatcher (Inactive) [ 19/Nov/18 ] |
|
Hello, Unfortunately, it is not possible to use mongorestore to replace an initial sync when adding a node back into a replica set. Thus, if you attempt your plan an initial sync will still be performed when you add the node back into the replica set. Thank you, Danny |
| Comment by lee mingyu [ 19/Nov/18 ] |
|
thank you for your explanation I am not sure whether I can use rsync and restart in some productions though I don't test yet I try imagination step 3) delete all oplog contents in recovery DB step 4) insert oplog contents(step 2) in recovery db
|
| Comment by Danny Hatcher (Inactive) [ 15/Nov/18 ] |
|
Hello, Unfortunately, per our documentation on resyncing a member of a replicaset by copying data files, a mongodump backup can not replace the process of an initial sync. While we are working on some methods to improve our initial sync process, the current alternative is to copy the data files from a healthy node. If you do not have the ability to take a filesystem snapshot or to halt the Primary node for a significant period of time, many customers use an iterative rsync approach to copy the data from a running process. An iterative rsync is done by running the command multiple times. Each time the length of the run should get shorter as rsync will update the data files that have been changed but leave the ones that weren't. When the length of the run is short, then you would stop the Primary process, run one last rsync, then start the Primary and Secondary processes up. Thank you, Danny |