A newer version of this documentation is available.

View Latest

Rebalance Based on File Transfer

      +
      The Search-Service REST API configures rebalance based on file transfer.

      HTTP Method and URI

      PUT /api/managerOptions

      Description

      The Search Service automatically partitions its indexes across all Search nodes in the cluster, ensuring optimal distribution, following rebalance. To achieve this, in all versions prior to 7.0.2, partitions needing to be newly created are entirely built, on their newly assigned nodes.

      In 7.0.2, and in later versions of Couchbase Server prior to 7.1, this remains the default way of creating new partitions during rebalance. However, partition-creation by file transfer is also provided, as a significant performance enhancement. This option allows files to be transferred from old nodes to new; so that overheads associated with partition build are avoided.

      File transfer is enabled and disabled by the PUT /api/managerOptions method and URI. Note that this API is provided only for Couchbase Server 7.0.2 and later.

      This feature is Enterprise-only, and requires all Search-Service nodes to be running 7.0.2+.

      During file transfer, should an unresolvable error occur, file transfer is automatically abandoned, and partition build is used instead.

      Curl Syntax

      curl -X PUT http://<ip-address-or-domain-name>:8094/api/managerOptions
        -u <username>:<password>
        -H "Content-type:application/json"
        -d '{"disableFileTransferRebalance": [ "true" | "false" ]}'

      If, in 7.0.2+, the value specified for the key disableFileTransferRebalance is false (the default being true), new Search-Service partitions are created during rebalance by means of partition-file transfer. When the value is true, partitions are created by means of partition build, from scratch; over DCP connections from the Data Service.

      Responses

      Success returns 200 OK, and the message {"status":"ok"}. If the URI is incorrectly specified, 404 Object Not Found is returned. If the method is incorrectly specified, 405 Method Not Allowed is returned, with the message {"error":"Method not allowed for endpoint","status":"fail"}.

      Failure to authenticate returns 401 Unauthorized.

      Examples

      The following example enables the creation of new partitions by means of file-transfer:

      curl -X PUT http://localhost:8094/api/managerOptions \
      -u Administrator:password \
      -H "Content-type:application/json" \
      -d '{"disableFileTransferRebalance": "false" }'

      From this point, Search-Service index-partitions are created by file transfer, on the new nodes assigned to them during rebalance.

      The following example disables the creation of new partitions by means of file-transfer:

      curl -X PUT http://localhost:8094/api/managerOptions \
      -u Administrator:password \
      -H "Content-type:application/json" \
      -d '{"disableFileTransferRebalance": "true" }'

      From this point, Search-Service index-partitions are again built on the new nodes assigned to them during rebalance.

      In each case, successful execution returns the following:

      {"status":"ok"}

      See Also

      An overview of rebalance for all services is provided at Rebalance. An overview of the REST API for the Search Service is provided at Search API. An architectural summary of the Search Service is provided at Search Service Architecture.