/v1/nodes

License badge Weaviate on Stackoverflow badge Weaviate issues on Github badge Weaviate v1.16.5 version badge Weaviate v1.16.5 version badge Weaviate total Docker pulls badge

The RESTful nodes endpoint gives information about each node's status in a Weaviate cluster. It can be used to learn about Weaviate instances running in the cluster, their versions and basic statistics.


Usage

The nodes endpoint accepts a GET request:

GET /v1/nodes

And it returns a nodes field containing array of nodes with following fields:

  • name: Name of the node.
  • status: Status of the node (one of: HEALTHY, UNHEALTHY, UNAVAILABLE).
  • version: Version of Weaviate running on the node.
  • gitHash: Short git hash of latest commit of Weaviate running on the node.
  • stats: Statistics of the node with following fields:
    • shardCount: Total number of shards on the node.
    • objectCount Total number of objects on the node.
  • shards: Array of shards with following fields:
    • name: Name of the shard.
    • class: Name of the objects’ class stored on the shard.
    • objectCount: Number of objects on the shard.

Example

The following command:

  import weaviate

client = weaviate.Client('http://localhost:8080')

nodes_status = client.cluster.get_nodes_status()
print(nodes_status)
  const weaviate = require("weaviate-client");

const client = weaviate.client({
  scheme: 'http',
  host: 'localhost:8080',
});

client.cluster
  .nodesStatusGetter()
  .do()
  .then(console.log)
  .catch(console.error);
  package main

import (
  "context"
  "fmt"

  "github.com/semi-technologies/weaviate-go-client/v4/weaviate"
)

func main() {
  cfg := weaviate.Config{
    Host:   "localhost:8080",
    Scheme: "http",
  }
  client := weaviate.New(cfg)

  nodesStatus, err := client.Cluster().
    NodesStatusGetter().
    Do(context.Background())

  if err != nil {
    panic(err)
  }
  fmt.Printf("%v", nodesStatus)
}
  package technology.semi.weaviate;

import technology.semi.weaviate.client.Config;
import technology.semi.weaviate.client.WeaviateClient;
import technology.semi.weaviate.client.base.Result;
import technology.semi.weaviate.client.v1.cluster.model.NodesStatusResponse;

public class App {
  public static void main(String[] args) {
    Config config = new Config("http", "localhost:8080");
    WeaviateClient client = new WeaviateClient(config);

    Result<NodesStatusResponse> result = client.cluster()
      .nodesStatusGetter()
      .run();

    if (result.hasErrors()) {
      System.out.println(result.getError());
      return;
    }
    System.out.println(result.getResult());
  }
}
  $ curl http://localhost:8080/v1/nodes

returns:

{
  "nodes": [
    {
      "name": "weaviate-7",
      "status": "HEALTHY",
      "version": "1.16-alpha.0",
      "gitHash": "8cd2efa",
      "stats": {
        "shardCount":2,
        "objectCount": 23328
      },
      "shards": [
        {
          "name":"azuawSAd9312F",
          "class": "Class_7",
          "objectCount": 13328
        }, {
          "name":"cupazAaASdfPP",
          "class": "Foo",
          "objectCount": 10000
        }
      ]
    }, {
      "name": "weaviate-6",
      "status": "HEALTHY",
      "version": "1.16-alpha.0",
      "gitHash": "8cd2efa",
      "stats": {
        "shardCount":2,
        "objectCount": 12345
      },
      "shards": [
        {
          "name":"hh8gXiaNaO2K",
          "class": "Bar",
          "objectCount": 10000
        }, {
          "name":"zmb16QK4PYZ4",
          "class": "Baz",
          "objectCount": 2345
        }
      ]
    }
   ]
}

More Resources

If you can’t find the answer to your question here, please look at the:

  1. Frequently Asked Questions. Or,
  2. Knowledge base of old issues. Or,
  3. For questions: Stackoverflow. Or,
  4. For issues: Github. Or,
  5. Ask your question in the Slack channel: Slack.