influxdata / docs-v2

InfluxData Documentation that covers InfluxDB Cloud, InfluxDB OSS 2.x, InfluxDB OSS 1.x, InfluxDB Enterprise, Telegraf, Chronograf, Kapacitor, and Flux.
https://docs.influxdata.com
MIT License
73 stars 275 forks source link

shard-status API call for 1.9 Enterprise #2815

Closed lesam closed 3 years ago

lesam commented 3 years ago

This was actually added in 2017, but I don't think it is necessary to update the historical documentation.

Describe the new feature here.

GET /shard-status is a valid Enterprise API call. It gets all the shards for the current data node, like so:

➜  basicscaff curl 'http://localhost:8086/shard-status' | jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   389  100   389    0     0   126k      0 --:--:-- --:--:-- --:--:--  126k
{
  "databases": [
    {
      "name": "_internal",
      "retention_policies": [
        {
          "name": "monitor",
          "replication_factor": 1,
          "shards": [
            {
              "id": 2,
              "size": 594491,
              "is_hot": true
            }
          ]
        }
      ]
    },
    {
      "name": "stress",
      "retention_policies": [
        {
          "name": "autogen",
          "replication_factor": 1,
          "shards": [
            {
              "id": 3,
              "is_hot": false
            },
            {
              "id": 6,
              "size": 1921,
              "is_hot": false
            },
            {
              "id": 7,
              "is_hot": false
            },
            {
              "id": 10,
              "size": 1920,
              "is_hot": false
            },
            {
              "id": 11,
              "is_hot": true
            }
          ]
        }
      ]
    }
  ]
}

Only details about shards owned by the data node that is hit are provided.

id: the shard id size: the size on disk of the shard (bytes) is_hot: whether the time range from the shard includes 'now'. Note that this is different from is_idle (not captured here) which is whether the shard is fully compacted and not receiving new (potentially historical) writes. state: the AE status of the shard (healthy/restore pending/restoring/repairing/error processing)

pierwill commented 3 years ago

@lesam: this part is a bit confusing:

state: the AE status of the shard (healthy/restore pending/restoring/repairing/error processing)

Can you clarify the set of possible states?

lesam commented 3 years ago

The possible states are here: https://github.com/influxdata/plutonium/blob/352e7e3b0f24810f717eeed4acfca56ad3c719ec/services/ae/service.go#L762