The rebalance process is managed through a specific process called orchestrator .
The orchestrator examines the current vBucket map and then combines that information with the node additions and removals in order to create a new vBucket map.
The orchestrator starts the process of moving the individual vBuckets from the current vBucket map to the new vBucket structure. It only starts the process while the nodes themselves are responsible for actually performing the movement of data between the nodes. The aim is to make the newly calculated vBucket map match the current situation.
Each vBucket is moved independently, and a number of vBuckets can be migrated simultaneously in parallel between the different nodes in the cluster. On each destination node, a process called ebucketmigrator is started. It uses the TAP system to request that all the data be transferred for a single vBucket, and that the new vBucket data becomes the active vBucket once the migration has been completed.
While the vBucket migration process is taking place, clients are still sending data to the existing vBucket. This information is migrated along with the original data that existed before the migration was requested. Once the migration of all the data has completed, the original vBucket is marked as disabled, and the new vBucket is enabled. This updates the vBucket map and is communicated back to the connected clients that will now use the new location.
Changing vBucket moves with REST
The number of vBucket moves that occur during the rebalance operation can be modified. The default is one (1) and indicates that only one vBucket is moved at a time during the rebalance operation.
To change the number of vBucket moves, execute a curl POST command using the following syntax with the /internalSettings endpoint and the option rebalanceMovesPerNode .
curl -X POST -u admin:password -d rebalanceMovesPerNode=1 http://HOST:PORT/internalSettings
curl -X POST -u Administrator:password -d rebalanceMovesPerNode=14 http://soursop-s11201.sc.couchbase.com:8091/internalSettings