Set Data Disk Use Limits

      +
      You can have the Data Service stop writing to the data storage path when it fills to a specific percentage. This option helps prevent the data path from running out of disk space and making recovery difficult.

      Description

      Allowing any filesystem on a node to become full can cause errors. If the filesystem containing the data storage path becomes full, recovery can be difficult. This endpoint allows you to set a limit on the percentage of disk space that can be used by the data storage path. When the data storage path reaches this limit, the Data Service stops writing to it. See Filesystem Free Space and Usage Limits for more information.

      If other services write to the same filesystem as the data storage path, the filesystem can still become full.

      HTTP Methods

      This API endpoint supports the following methods:

      Get Data Disk Use Limits

      Use this endpoint to get the current data disk use limit settings.

      Get Limit Settings
      GET /settings/resourceManagement

      curl Syntax

       curl -u $USER:$PASSWORD -X GET \
            'http://{HOST}:{PORT}/settings/resourceManagement'
      Path Parameters
      USER

      The name of a user who has one of the roles listed in Required Privileges.

      PASSWORD

      The password for the user.

      HOST

      Hostname or IP address of a Couchbase Server.

      PORT

      Port number for the REST API. Defaults are 8091 for unencrypted and 18901 for encrypted connections.

      Required Privileges

      You must have at least on one of the following roles:

      Responses

      200 OK

      Returns a JSON object containing the current data disk use limit settings. See Examples for the schema of the output.

      403 Forbidden

      Returned if the user does not have one of the roles listed in Required Privileges.

      Examples

      The following example gets the current settings for data disk use limits:

      curl -u Administrator:password \
           -X GET 'http://127.0.0.1:8091/settings/resourceManagement' | jq

      The JSON returned by this command shows the current settings for data disk use limits:

       {
        "diskUsage": {
          "enabled": false,
          "maximum": 85
        }
      }

      The result shows that the disk usage limit is not enabled, and the maximum disk usage is set to 85% (the default).

      Set Data Disk Use Limits

      Use this endpoint to set the data disk use limit settings.

      Set Limits
      POST /settings/resourceManagement

      curl Syntax

       curl -u $USER:$PASSWORD -X POST \
            'http://{HOST}:{PORT}/settings/resourceManagement' \
            -H 'Content-Type: application/json' \
            -d '{"diskUsage": {"enabled": [true|false], "maximum": <integer>}}'
      Path Parameters
      USER

      The name of a user who has one of the roles listed in Required Privileges.

      PASSWORD

      The password for the user.

      HOST

      Hostname or IP address of a Couchbase Server.

      PORT

      Port number for the REST API. Defaults are 8091 for unencrypted and 18901 for encrypted connections.

      Data Parameters
      enabled (Boolean)

      If true, enables the data disk use limit. If false, disables the data disk use limit.

      maximum (integer)

      The maximum percentage of disk space that can be used by the data storage path. If the data storage path reaches this limit, Couchbase Server stops writing to it. This value must be between 1 and 100.

      Required Privileges

      You must have at least 1 of the following roles:

      Responses

      200 OK

      Returns a JSON object containing the current data disk use limit settings. See Examples for the schema of the output.

      403 Forbidden

      Returned if the user does not have 1 of the roles listed in Required Privileges.

      Examples

      The following example enables data disk use limits and sets the maximum disk usage to 90%:

      curl -X POST 'http://127.0.0.1:8091/settings/resourceManagement' \
           -H "Content-Type: application/json"\
           -d '{"diskUsage": {"enabled": true, "maximum": 90}}' | jq

      The JSON returned by this command shows new current settings for data disk use limits:

      {
        "diskUsage": {
          "enabled": true,
          "maximum": 90
        }
      }