Can i add new member with low-priority / zero votes / something else to
avoid initial sync (with dropping datafiles)?
Unfortunately no. The first step in initial sync is always dropping all
databases. A Secondary is supposed to mirror the data content of the
Primary, and there is no setting in MongoDB that can avoid this drop
databases step when a server is attached to an existing replica set.
In some point of time we need to use sharding due to big data. All data was
more than one server storage(11TB). We added a new shard. After that we get
more spave for new data. Some time after we deleted much documents and all
data fits to one shard. We have decided to use “desharding” procedure(just
remove second shard). Some time later chunk migration was stopped due to
data corruption errors.
Could you elaborate on the steps you performed in your desharding procedure?
Also, I’m a little unclear about the current state of your deployment. My
understanding is that currently it is a sharded cluster, where each shard
is a replica set with Primary-Secondary-Arbiter configuration. Could you
- how many shards are there currently
- how many config servers
- how many mongos
Additional information that may be helpful:
- the output of db.serverCmdLineOpts() in the mongo shell from each
mongod in your deployment
- the output of rs.status() from your replica set (you can connect
directly to the replica set’s Primary using the mongo shell to execute
- the output of sh.status() from any mongos process
Regarding data corruption issues: Unfortunately there is little anyone can
do if you are having data corruption issues due to hardware failures, power
outages, etc. There are a couple of things you could try, but both of them
involve some downtime: