Status
Various cluster statuses are available in Weaviate.
Liveness
The live
endpoint checks if the application is alive. You can use it for a Kubernetes liveness probe.
Usage
The endpoint accepts a GET
request:
GET /v1/.well-known/live
The endpoint returns HTTP status code 200
if the application is able to respond to HTTP requests.
Example
- Python Client v4
- Python Client v3
- JS/TS Client (v3)
- JS/TS Client (v2)
- Go
- Java
- Curl
import weaviate
client = weaviate.connect_to_local()
print(client.is_live())
finally:
client.close()
import weaviate
client = weaviate.Client("http://localhost:8080")
is_live = client.is_live()
print(is_live)
import weaviate from 'weaviate-client';
const client = await weaviate.connectToLocal()
const response = await client.isLive()
console.log(response)
import weaviate from 'weaviate-ts-client';
const client = weaviate.client({
scheme: 'http',
host: 'localhost:8080',
});
const response = await client.misc
.liveChecker()
.do();
console.log(response);
package main
import (
"context"
"fmt"
"github.com/weaviate/weaviate-go-client/v4/weaviate"
)
func main() {
cfg := weaviate.Config{
Host: "localhost:8080",
Scheme: "http",
}
client, err := weaviate.NewClient(cfg)
if err != nil {
panic(err)
}
isLive, err := client.Misc().LiveChecker().Do(context.Background())
if err != nil {
panic(err)
}
fmt.Printf("%v", isLive)
}
package io.weaviate;
import io.weaviate.client.Config;
import io.weaviate.client.WeaviateClient;
import io.weaviate.client.base.Result;
public class App {
public static void main(String[] args) {
Config config = new Config("http", "localhost:8080");
WeaviateClient client = new WeaviateClient(config);
Result<Boolean> result = client.misc().liveChecker().run();
if (result.hasErrors()) {
System.out.println(result.getError());
return;
}
System.out.println(result.getResult());
}
}
curl http://localhost:8080/v1/.well-known/live
The endpoint returns HTTP status code 200
if the application is able to respond to HTTP requests.
Readiness
The ready
endpoint checks if the application is ready to receive traffic. You can use it for Kubernetes readiness probe.
Usage
The discovery endpoint accepts a GET
request:
GET /v1/.well-known/ready
The endpoint returns HTTP status code 200
if the application is able to respond to HTTP requests. If the application is currently unable to serve traffic, the endpoint returns HTTP status code 503
.
If the application is unavailable and you have horizontal replicas of Weaviate that can receive traffic, redirect traffic to one of the replicas.
Example
- Python Client v4
- Python Client v3
- JS/TS Client (v3)
- JS/TS Client (v2)
- Go
- Java
- Curl
import weaviate
client = weaviate.connect_to_local()
print(client.is_ready())
finally:
client.close()
import weaviate
client = weaviate.Client("http://localhost:8080")
is_ready = client.is_ready()
print(is_ready) # returns True if Weaviate is ready
import weaviate from 'weaviate-client';
const client = await weaviate.connectToLocal()
const response = await client.isReady()
console.log(response)
import weaviate from 'weaviate-ts-client';
const client = weaviate.client({
scheme: 'http',
host: 'localhost:8080',
});
const response = await client.misc
.readyChecker()
.do();
console.log(response);
package main
import (
"context"
"fmt"
"github.com/weaviate/weaviate-go-client/v4/weaviate"
)
func main() {
cfg := weaviate.Config{
Host: "localhost:8080",
Scheme: "http",
}
client, err := weaviate.NewClient(cfg)
if err != nil {
panic(err)
}
isReady, err := client.Misc().ReadyChecker().Do(context.Background())
if err != nil {
panic(err)
}
fmt.Printf("%v", isReady)
}
package io.weaviate;
import io.weaviate.client.Config;
import io.weaviate.client.WeaviateClient;
import io.weaviate.client.base.Result;
public class App {
public static void main(String[] args) {
Config config = new Config("http", "localhost:8080");
WeaviateClient client = new WeaviateClient(config);
Result<Boolean> result = client.misc().readyChecker().run();
if (result.hasErrors()) {
System.out.println(result.getError());
return;
}
System.out.println(result.getResult());
}
}
curl http://localhost:8080/v1/.well-known/ready
Schema synchronization
The v1//schema/cluster-status
endpoint displays the status of the schema synchronization. The endpoint returns the following fields:
healthy
: The status of the schema synchronization.hostname
: The hostname of the Weaviate instance.ignoreSchemaSync
: Whether to ignore the cluster check at startup (for recovery from an out-of-sync situation).nodeCount
: The number of nodes in the cluster.
Example response:
{
"healthy": true,
"hostname": "node1",
"ignoreSchemaSync": false,
"nodeCount": 3
}
Questions and feedback
If you have any questions or feedback, let us know in the user forum.