Skip to content

Commit f7efce8

Browse files
igorribeiroduartevladzcloudius
authored andcommitted
replaced_node.yml: Update README
1 parent 8be79ec commit f7efce8

File tree

1 file changed

+37
-24
lines changed

1 file changed

+37
-24
lines changed

example-playbooks/replace_node/README.md

+37-24
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,53 @@
22

33
This playbook will run the replace dead node procedure.
44

5-
### Steps:
5+
## Prerequisites
66

7-
1. Check if the node is a seed, if it is stop, seeds need to be demoted first.
8-
2. Apply the ansible-scylla-node role to the new node, reusing all the parameters from the existing cluster. Skip starting the scylla-server service
9-
3. Start the services
10-
4. Clean out the replace_address_first_boot record from scylla.yaml
11-
5. Run `nodetool repair -pr`
7+
* A scylla cluster with scylla-manager and scylla-monitoring installed.
8+
* The inventory file must be updated as described in the Usage section below, ie.: The new node should replace the dead node in the inventory.
9+
* It's necessary to have files with the same parameters used when the cluster was created, as described in the Parameters section.
10+
* It's very important to have `start_scylla_service` set to `false`. The replace will not work otherwise.
1211

1312
## Usage:
1413

15-
1. Reuse the existing set of parameters from the ansble-scylla-node run for the existing cluster. In this case I copy a previously created file called `nodes_params.yml` to `replace_params.yml`.
16-
2. Add the new node to the inventory:
14+
1. Add the new node to the inventory:
1715

18-
```ini
16+
Old inventory:
17+
```old inventory
1918
[scylla]
2019
10.0.0.1
21-
10.0.0.2
22-
10.0.0.3 <-- dead node to be replaced
20+
10.0.0.2 <-- dead node to be replaced
21+
10.0.0.3
22+
```
2323

24-
[new_node]
25-
10.0.0.4
24+
New inventory:
25+
```new inventory
26+
[scylla]
27+
10.0.0.1
28+
10.0.0.4 <-- new node
29+
10.0.0.3
2630
```
2731

28-
3. Edit the `replace_params.yml` file, look for (or add) the `scylla_yaml_params` variable:
32+
2. Run `ansible-playbook -i inventory.ini -e "@nodes_params.yml" -e "@monitor_params.yml" -e "replaced_node=10.0.0.2" -e "replaced_node_broadcast_address=10.0.0.2" -e "new_node=10.0.0.4" replace_node.yml`
2933

30-
```yaml
31-
scylla_yaml_params:
32-
authorizer: CassandraAuthorizer
33-
authenticator: PasswordAuthenticator
34-
internode_compression: all
35-
#Add this line:
36-
replace_address_first_boot: "{{ replaced_node }}"
34+
## Steps:
3735

38-
```
36+
1. Validate that the node being replaced is down
37+
2. Block the broadcast address of the replaced node via iptables in all the other nodes to prevent it from trying to join the cluster again
38+
3. Check if all the other nodes are up
39+
4. Install Scylla in the new node
40+
5. Set `replace_node_first_boot`/`replace_address_first_boot` in the `scylla.yaml` of the new node
41+
6. Start `scylla-server`
42+
7. Remove `replace_node_first_boot`/`replace_address_first_boot` from the `scylla.yaml` of the new node
43+
8. Start `scylla-manager-agent`
44+
9. Update Scylla-Monitoring
45+
10. If RBNO is disabled, repair the new node
46+
47+
## Parameters:
48+
49+
This playbook uses the node role to install and configure Scylla in the new node, so the same parameters
50+
used when the cluster was created should also be passed to the `replace_node.yml` playbook.
51+
In the `Usage` section of this README, we use `nodes_params.yml` and `monitor_params.yml` files to represent such parameters.
3952

40-
4. Run `ansible-playbook -i inventory.ini -e @replace_params.yml replace_node.yml
41-
5. Update the inventory `[scylla]` listing with the new node's address, remove the old address.
53+
Besides the vars from the node role, this playbook has the following mandatory parameters: `replaced_node`, `replaced_node_broadcast_address` and `new_node`.
54+
These and the other available parameters are listed and described in `vars/main.yml`.

0 commit comments

Comments
 (0)