Skip to content

Commit 8731b7f

Browse files
authored
RS: Added rladmin commands to change node roles (#2144)
* Add <img> handling to show full size image on click, similar to image shortcode * DOC-5617 RS: Added rladmin commands to change node roles * Fixed typos in 7.8 version of change node roles * DOC-5617 Replaced broken img for more actions button
1 parent 679d9d1 commit 8731b7f

File tree

4 files changed

+83
-8
lines changed

4 files changed

+83
-8
lines changed

assets/css/index.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,11 @@ html {
579579
scrollbar-gutter: stable;
580580
}
581581

582+
/* Auto-clickable for standalone images */
583+
img:not(a img):not(.image-card-img):not([src*="#no-click"]) {
584+
cursor: pointer;
585+
}
586+
582587
/* Chroma syntax highlighting */
583588

584589
/* Background */

content/operate/rs/7.8/clusters/change-node-role.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ A Redis Software cluster contains a primary node, which coordinates cluster-wide
1717

1818
To demote the primary node to a secondary node using the Cluster Manager UI:
1919

20-
1. On the **Nodes** screen, click {{< image filename="/images/rs/buttons/button-toggle-actions-vertical.png#no-click" alt="More actions button" width="22px" class="inline" >}} for the node you want to promote.
20+
1. On the **Nodes** screen, click {{< image filename="/images/rs/buttons/button-toggle-actions-vertical.png#no-click" alt="More actions button" width="22px" class="inline" >}} for the primary node you want to demote.
2121

2222
{{<image filename="images/rs/screenshots/nodes/primary-node-more-actions.png" alt="Click the more actions button for a node to access node actions.">}}
2323

@@ -37,7 +37,7 @@ To demote the primary node to a secondary node using the Cluster Manager UI:
3737

3838
To promote a secondary node to become the primary node using the Cluster Manager UI:
3939

40-
1. On the **Nodes** screen, click {{< image filename="/images/rs/buttons/button-toggle-actions-vertical.png#no-click" alt="More actions button" width="22px" class="inline" >}} for the node you want to promote.
40+
1. On the **Nodes** screen, click {{< image filename="/images/rs/buttons/button-toggle-actions-vertical.png#no-click" alt="More actions button" width="22px" class="inline" >}} for the secondary node you want to promote.
4141

4242
{{<image filename="images/rs/screenshots/nodes/secondary-nodes-more-actions.png" alt="Click the more actions button for a node to access node actions.">}}
4343

content/operate/rs/clusters/change-node-role.md

Lines changed: 62 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,15 @@ A Redis Software cluster contains a primary node, which coordinates cluster-wide
1414

1515
## Demote primary node
1616

17+
{{< multitabs id="demote-node"
18+
tab1="Cluster Manager UI"
19+
tab2="rladmin" >}}
20+
1721
To demote the primary node to a secondary node using the Cluster Manager UI:
1822

19-
1. On the **Nodes** screen, click {{< image filename="/images/rs/buttons/button-toggle-actions-vertical.png#no-click" alt="More actions button" width="22px" class="inline" >}} for the node you want to promote.
23+
1. On the **Nodes** screen, click the **More actions** button (**&vellip;**) for the primary node you want to demote.
2024

21-
{{<image filename="images/rs/screenshots/nodes/primary-node-more-actions.png" alt="Click the more actions button for a node to access node actions.">}}
25+
<img src="../../../../images/rs/screenshots/nodes/primary-node-more-actions.png" alt="Click the more actions button for a node to access node actions.">
2226

2327
1. Select **Set as a secondary node** from the list.
2428

@@ -28,20 +32,73 @@ To demote the primary node to a secondary node using the Cluster Manager UI:
2832

2933
- **Choose specific node**: You can manually select which node becomes the new primary node.
3034

31-
{{<image filename="images/rs/screenshots/nodes/primary-node-set-as-secondary-dialog.png" alt="The Set as a secondary node dialog has two options to select the new primary node, either automatically or manually.">}}
35+
<img src="../../../../images/rs/screenshots/nodes/primary-node-set-as-secondary-dialog.png" alt="The Set as a secondary node dialog has two options to select the new primary node, either automatically or manually.">
3236

3337
1. Click **Confirm**.
3438

39+
-tab-sep-
40+
41+
To demote the primary node to a secondary node using `rladmin`:
42+
43+
1. Identify the primary node's ID with [`rladmin cluster master`]({{<relref "/operate/rs/references/cli-utilities/rladmin/cluster/master">}}):
44+
45+
```sh
46+
$ rladmin cluster master
47+
Node <primary-node-id> is the cluster master node
48+
```
49+
50+
1. Run [`rladmin node enslave`]({{<relref "/operate/rs/references/cli-utilities/rladmin/node/enslave/#node-enslave">}}) with the `demote_node` option:
51+
52+
```sh
53+
rladmin node <primary-node-ID> enslave demote_node
54+
```
55+
56+
Replace `<primary-node-ID>` with the ID returned by `rladmin cluster master`.
57+
58+
{{< /multitabs >}}
59+
3560
## Promote secondary node
3661

62+
{{< multitabs id="promote-node"
63+
tab1="Cluster Manager UI"
64+
tab2="rladmin" >}}
65+
3766
To promote a secondary node to become the primary node using the Cluster Manager UI:
3867

39-
1. On the **Nodes** screen, click {{< image filename="/images/rs/buttons/button-toggle-actions-vertical.png#no-click" alt="More actions button" width="22px" class="inline" >}} for the node you want to promote.
68+
1. On the **Nodes** screen, click the **More actions** button (**&vellip;**) for the secondary node you want to promote.
4069

41-
{{<image filename="images/rs/screenshots/nodes/secondary-nodes-more-actions.png" alt="Click the more actions button for a node to access node actions.">}}
70+
<img src="../../../../images/rs/screenshots/nodes/secondary-nodes-more-actions.png" alt="Click the more actions button for a node to access node actions.">
4271

4372
1. Select **Set as the primary node** from the list.
4473

4574
1. Click **Confirm**.
4675

76+
77+
-tab-sep-
78+
79+
To promote a secondary node to become the primary node using `rladmin`:
80+
81+
1. To find the IDs of secondary nodes, run [`rladmin status nodes`]({{<relref "/operate/rs/references/cli-utilities/rladmin/status#status-nodes">}}):
82+
83+
```sh
84+
$ rladmin status nodes
85+
CLUSTER NODES:
86+
NODE:ID ROLE ADDRESS EXTERNAL_ADDRESS HOSTNAME SHARDS CORES FREE_RAM PROVISIONAL_RAM VERSION STATUS
87+
node:1 master 198.51.100.2 3d99db1fdf4b 4/100 6 14.74GB/19.54GB 10.73GB/16.02GB 7.22.0-250 OK
88+
*node:3 slave 198.51.100.4 b87cc06c830f 0/100 6 14.74GB/19.54GB 11.22GB/16.02GB 7.22.0-250 OK
89+
node:2 slave 198.51.100.3 fc7a3d332458 0/100 6 14.74GB/19.54GB 11.22GB/16.02GB 7.22.0-250 OK
90+
```
91+
92+
Nodes with the `slave` role are secondary nodes.
93+
94+
1. Run [`rladmin cluster master set`]({{<relref "/operate/rs/references/cli-utilities/rladmin/cluster/master">}}):
95+
96+
```sh
97+
rladmin cluster master set <secondary-node-ID>
98+
```
99+
100+
Replace `<secondary-node-ID>` with the ID of the secondary node you want to promote.
101+
102+
{{< /multitabs >}}
103+
47104
After this node becomes the primary node, all cluster management traffic is directed to it.

static/js/index.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,4 +184,17 @@ const mobileMenu = (() => {
184184
document.addEventListener('click', clickHandler, false)
185185
document.addEventListener('keydown', keyHandler, false)
186186

187-
})()
187+
})()
188+
189+
// Simple click-to-open for standalone images
190+
document.addEventListener('click', function(e) {
191+
// Check if clicked element is a standalone img (not inside an anchor, not image-card, not no-click)
192+
if (e.target.tagName === 'IMG' &&
193+
!e.target.closest('a') &&
194+
!e.target.classList.contains('image-card-img') &&
195+
!e.target.src.includes('#no-click')) {
196+
197+
// Open image in same tab, just like clicking a regular link
198+
window.location.href = e.target.src
199+
}
200+
})

0 commit comments

Comments
 (0)