Getting Rebalance Reason Codes

    When a service in the cluster needs to be rebalanced, you can retrieve the reason for the rebalance using the 'GET /pools/default' method.

    HTTP method and URI

    GET /pools/default

    Description

    At any point that the service needs rebalancing, you can use this method to obtain a detailed description of the reasons that the rebalance is required.

    The reasons are returned in the servicesNeedRebalance array. Each entry gives a reason code, such as service_not_balanced (the service isn’t balanced), and lists the services to which it applies.

    The service returns the reason code only if a rebalance is required.

    Curl Syntax

    curl -v -X GET -u [admin]:[password]
      http://[localhost]:8091/pools/default

    Response

    On success, the response code 200 OK is given, and one or more reason codes are given in the returned message.

    Returned JSON object (truncated)
    {
      "name": "default",
    
      "rebalanceStatus": "none",
      "rebalanceProgressUri": "/pools/default/rebalanceProgress",
      "stopRebalanceUri": "/controller/stopRebalance?uuid=8a05ca2847bc28ac92a484c9248fb261",
      "nodeStatusesUri": "/nodeStatuses",
      "nodeServicesUri": "/pools/default/nodeServices?v=89141026",
      "tasks": {
        "uri": "/pools/default/tasks?v=86199101"
      },
    
      "servicesNeedRebalance": [
        {
          "code": "service_not_balanced",
          "description": "Service needs rebalance.",
          "services": [
            "kv",
            "cbas"
          ]
        }
      ],
      "serverGroupsUri": "/pools/default/serverGroups?v=20914152"
    }

    See Also

    For information about rebalancing, see the following: