Skip to content
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions content/operate/rs/databases/durability-ha/db-availability.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
alwaysopen: false
categories:
- docs
- operate
- rs
db_type: database
description: Verify if a Redis Software database is available to perform read and write operations and can respond to queries from client applications.
linkTitle: Database availability
title: Check database availability
toc: 'true'
weight: 30
---

You can use the [database availability API]({{<relref "/operate/rs/references/rest-api/requests/bdbs/availability">}}) to verify whether a Redis Software database is available to perform read and write operations and can respond to queries from client applications. Load balancers and automated monitoring tools can use this API to monitor database availability.

## Check database availability for monitoring

To monitor database availability, use the following REST API request:

```sh
GET /v1/bdbs/<database_id>/availability
```

If the OSS Cluster API is enabled, this request verifies all endpoints for this database are available. Otherwise, it verifies the database has at least one available endpoint.

Returns the status code 200 OK if the database is available.

If the database is unavailable, returns an error status code and a JSON object that contains [`error_code` and `description` fields]({{<relref "/operate/rs/references/rest-api/requests/bdbs/availability#get-db-error-codes">}}).

## Check local database endpoint availability for load balancers

To check database availability when using a load balancer and the recommended `all-nodes` proxy policy, use the local database endpoints for each node:

```sh
GET /v1/local/bdbs/<database_id>/endpoint/availability
```

Returns the status code 200 OK if the local database endpoint is available.

If the local database endpoint is unavailable, returns an error status code and a JSON object that contains [`error_code` and `description` fields]({{<relref "/operate/rs/references/rest-api/requests/bdbs/availability#get-endpoint-error-codes">}}).

## Availability by database status

| Database status | Availability |
|-----------------|--------------|
| active | <span title="Available">&#x2705;</span> Available |
| active-change-pending | <span title="Available">&#x2705;</span> Available |
| creation-failed | <span title="Not available">:x:</span> Not available |
| delete-pending | <span title="Availability not guaranteed" class="font-serif">:warning:</span> Availability not guaranteed |
| import-pending | <span title="Available">&#x2705;</span> Available |
| pending | <span title="Available">&#x2705;</span> Available |
| recovery | <span title="Not available">:x:</span> Not available |

## Availability by shard status

| Shard status | Availability |
|--------------|--------------|
| busy | <span title="Available">&#x2705;</span> Available |
| down | <span title="Not available">:x:</span> Not available |
| importing | <span title="Available">&#x2705;</span> Available |
| loading | <span title="Available">&#x2705;</span> Available |
| ok | <span title="Available">&#x2705;</span> Available |
| timeout | ? |
| trimming | <span title="Available">&#x2705;</span> Available |
| unknown | ? |
Loading