Skip to content

Commit 23bd05e

Browse files
committed
DOC-4978 RS: Document two-dimensional rack awareness setup
1 parent f43fe6a commit 23bd05e

File tree

1 file changed

+89
-0
lines changed

1 file changed

+89
-0
lines changed

content/operate/rs/clusters/configure/rack-zone-awareness.md

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,95 @@ If you did not configure rack-zone awareness during cluster creation, you can co
8484
{ "rack_aware": true }
8585
```
8686
87+
## Set up two-dimensional rack-zone awareness
88+
89+
### New clusters
90+
91+
To set up two-dimensional rack-zone awareness during cluster creation, assign a `second_rack_id` to each node in the cluster in addition to the `rack_id` using the [REST API]({{<relref "/operate/rs/references/rest-api">}}) or [rladmin]({{<relref "/operate/rs/references/cli-utilities/rladmin">}}).
92+
93+
#### REST API method
94+
95+
To create a new cluster with two-dimensional rack-zone awareness using the [REST API]({{<relref "/operate/rs/references/rest-api">}}):
96+
97+
1. Create the new cluster on a node:
98+
99+
```sh
100+
POST /v1/bootstrap/create_cluster
101+
{
102+
"action": "create_cluster",
103+
"cluster": {
104+
"nodes": [],
105+
"name": "<cluster.name>"
106+
},
107+
"node": {
108+
"rack_id": "<AZ1>",
109+
"second_rack_id": "<RackID1>"
110+
},
111+
"license": "----- LICENSE START -----\n...\n----- LICENSE END -----\n",
112+
"credentials": {
113+
"username": "<admin-email>",
114+
"password": "<admin-password>"
115+
}
116+
}
117+
```
118+
119+
1. Join each new node you want to add to the cluster:
120+
121+
```sh
122+
POST /v1/bootstrap/join_cluster
123+
{
124+
"action": "join_cluster",
125+
"cluster": {
126+
"nodes": [],
127+
"name": "<cluster.name>"
128+
},
129+
"node": {
130+
"rack_id": "<AZ1>",
131+
"second_rack_id": "<RackID2>"
132+
}
133+
"credentials": {
134+
"username": "<admin-email>",
135+
"password": "<admin-password>"
136+
}
137+
}
138+
```
139+
140+
#### Command-line method
141+
142+
To create a new cluster with two-dimensional rack-zone awareness using the command line:
143+
144+
1. Run [`rladmin cluster create`]({{<relref "/operate/rs/references/cli-utilities/rladmin/cluster/create">}}) to create the initial cluster on one node, enable rack-zone awareness, and assign a `rack_id` and `second_rack_id`:
145+
146+
```sh
147+
$ rladmin cluster create name <cluster-name> \
148+
username <admin-email> \
149+
password <admin-password> \
150+
rack_aware \
151+
rack_id <node-rack-ID> \
152+
second_rack_id <second-node rack-ID>
153+
```
154+
155+
1. Run [`rladmin cluster join`]({{<relref "/operate/rs/references/cli-utilities/rladmin/cluster/join">}}) for each new node you want to add to the cluster and assign a different `rack_id` and `second_rack_id`:
156+
157+
```sh
158+
$ rladmin cluster join nodes <node-IP-address> \
159+
username <admin-email> \
160+
password <admin-password> \
161+
rack_id <node-rack ID> \
162+
second_rack_id <second-node-rack-ID>
163+
```
164+
165+
### Existing clusters
166+
167+
You can configure two-dimensional rack-zone awareness for existing clusters using the [REST API]({{< relref "/operate/rs/references/rest-api" >}}).
168+
169+
For each node in the cluster, assign a different `second_rack_id` using the REST API to [update the node]({{< relref "/operate/rs/references/rest-api/requests/nodes#put-node" >}}):
170+
171+
```sh
172+
PUT /v1/nodes/<node-ID>
173+
{ "second_rack_id": "rack-zone-ID2" }
174+
```
175+
87176
## Enable database rack-zone awareness
88177
89178
Before you can enable rack-zone awareness for a database, you must configure rack-zone awareness for the cluster and its nodes. For more information, see [set up rack-zone awareness](#set-up-rack-zone-awareness).

0 commit comments

Comments
 (0)