Skip to content

Commit 538c4ec

Browse files
authored
RS: Check DB availability (#816)
* DOC-4307 Create DB availability placeholder article * DOC-4307 Add DB availability API examples * DOC-4307 Feedback update to add use cases for load balancers vs. monitoring * DOC-4307 Feedback updates to add note about data availability & DB status link * DOC-4307 Feedback update to remove shard status table
1 parent 87a541f commit 538c4ec

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
alwaysopen: false
3+
categories:
4+
- docs
5+
- operate
6+
- rs
7+
db_type: database
8+
description: Verify if a Redis Software database is available to perform read and write operations and can respond to queries from client applications.
9+
linkTitle: Database availability
10+
title: Check database availability
11+
toc: 'true'
12+
weight: 30
13+
---
14+
15+
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.
16+
17+
{{<note>}}
18+
Database availability does not guarantee data availability.
19+
{{</note>}}
20+
21+
## Check database availability for monitoring
22+
23+
To monitor database availability, use the following REST API request:
24+
25+
```sh
26+
GET /v1/bdbs/<database_id>/availability
27+
```
28+
29+
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.
30+
31+
Returns the status code 200 OK if the database is available.
32+
33+
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">}}).
34+
35+
## Check local database endpoint availability for load balancers
36+
37+
To check database availability when using a load balancer and the recommended `all-nodes` proxy policy, use the local database endpoints for each node:
38+
39+
```sh
40+
GET /v1/local/bdbs/<database_id>/endpoint/availability
41+
```
42+
43+
Returns the status code 200 OK if the local database endpoint is available.
44+
45+
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">}}).
46+
47+
## Availability by database status
48+
49+
The following table shows the relationship between a database's status and availability. For more details about the database status values, see [BDB status field]({{<relref "/operate/rs/references/rest-api/objects/bdb/status">}}).
50+
51+
| Database status | Availability |
52+
|-----------------|--------------|
53+
| active | <span title="Available">&#x2705;</span> Available |
54+
| active-change-pending | <span title="Available">&#x2705;</span> Available |
55+
| creation-failed | <span title="Not available">:x:</span> Not available |
56+
| delete-pending | <span title="Availability not guaranteed" class="font-serif">:warning:</span> Availability not guaranteed |
57+
| import-pending | <span title="Available">&#x2705;</span> Available |
58+
| pending | <span title="Available">&#x2705;</span> Available |
59+
| recovery | <span title="Not available">:x:</span> Not available |

0 commit comments

Comments
 (0)