Skip to content

Commit

Permalink
📝 Fix keepalived weights and slave naming in "Implementation of a Clo…
Browse files Browse the repository at this point in the history
…ud HA infrastructure with Keepalived" (#977)

* fix: keepalived weights
* fix: renaming slave to backup
* Small fix

---------

Co-authored-by: svenja.michal <[email protected]>
  • Loading branch information
gseidel and svenja11 authored Nov 7, 2024
1 parent e318202 commit ab32ec6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
18 changes: 9 additions & 9 deletions tutorials/configure-cloud-ha-keepalived/01.de.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ Die hier gezeigte Konfiguration entspricht einem Beispiel anhand eines HA Webser
vrrp_script chk_nginx {
script "/usr/bin/pgrep nginx"
interval 2
weight 101
weight -101
}
vrrp_instance VI_1 {
Expand All @@ -188,7 +188,7 @@ vrrp_instance VI_1 {
virtual_router_id 30
unicast_src_ip [master_private_IP]
unicast_peer {
[slave_private_IP]
[backup_private_IP]
}
authentication {
Expand All @@ -204,9 +204,9 @@ vrrp_instance VI_1 {
}
```

> **Hinweis:** Die umrandeten Werte `[]` sind durch eigene Angaben auszutauschen. Für `auth_pass` kann ein beliebiges Passwort gewählt werden. Für den Master und den Slave sollte aber dasselbe Passwort angegeben werden.
> **Hinweis:** Die umrandeten Werte `[]` sind durch eigene Angaben auszutauschen. Für `auth_pass` kann ein beliebiges Passwort gewählt werden. Für den Master und den Backup sollte aber dasselbe Passwort angegeben werden.

**Konfiguration auf dem Slave Server**
**Konfiguration auf dem Backup Server**

`/etc/keepalived/keepalived.conf`

Expand All @@ -218,11 +218,11 @@ vrrp_script chk_nginx {
vrrp_instance VI_1 {
interface [cloud_private_network_adapter]
state SLAVE
state BACKUP
priority 100
virtual_router_id 30
unicast_src_ip [slave_private_IP]
unicast_src_ip [backup_private_IP]
unicast_peer {
[master_private_IP]
}
Expand All @@ -240,7 +240,7 @@ vrrp_instance VI_1 {
}
```

> **Hinweis:** Die umrandeten Werte `[]` sind durch eigene Angaben auszutauschen. Für `auth_pass` kann ein beliebiges Passwort gewählt werden. Für den Master und den Slave sollte aber dasselbe Passwort angegeben werden.
> **Hinweis:** Die umrandeten Werte `[]` sind durch eigene Angaben auszutauschen. Für `auth_pass` kann ein beliebiges Passwort gewählt werden. Für den Master und den Backup sollte aber dasselbe Passwort angegeben werden.

**Inhalt der `failover.sh` auf beiden Servern**

Expand Down Expand Up @@ -284,9 +284,9 @@ Im Normalbetrieb übernimmt der Master Webserver alle Anfragen.

![](images/master.png)

Sobald dieser ausfällt gibt es ein Failover auf den Slave Webserver.
Sobald dieser ausfällt gibt es ein Failover auf den Backup Webserver.

![](images/slave.png)
![](images/backup.png)

Sobald der Master Webserver wieder erreichbar ist wird wieder auf diesen gewechselt.

Expand Down
18 changes: 9 additions & 9 deletions tutorials/configure-cloud-ha-keepalived/01.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ The configuration shown here corresponds to an example using an HA web server (n
vrrp_script chk_nginx {
script "/usr/bin/pgrep nginx"
interval 2
weight 101
weight -101
}
vrrp_instance VI_1 {
Expand All @@ -187,7 +187,7 @@ vrrp_instance VI_1 {
virtual_router_id 30
unicast_src_ip [master_private_IP]
unicast_peer {
[slave_private_IP]
[backup_private_IP]
}
authentication {
Expand All @@ -203,9 +203,9 @@ vrrp_instance VI_1 {
}
```

> **Note:** The outlined values `[]` are to be replaced by your own specifications. For `auth_pass`, you can pick any random password. However, make sure to use the same password for the master and the slave.
> **Note:** The outlined values `[]` are to be replaced by your own specifications. For `auth_pass`, you can pick any random password. However, make sure to use the same password for the master and the backup.

**Configuration file on the slave server**
**Configuration file on the backup server**

`/etc/keepalived/keepalived.conf`

Expand All @@ -217,11 +217,11 @@ vrrp_script chk_nginx {
vrrp_instance VI_1 {
interface [cloud_private_network_adapter]
state SLAVE
state BACKUP
priority 100
virtual_router_id 30
unicast_src_ip [slave_private_IP]
unicast_src_ip [backup_private_IP]
unicast_peer {
[master_private_IP]
}
Expand All @@ -239,7 +239,7 @@ vrrp_instance VI_1 {
}
```

> **Note:** The outlined values `[]` are to be replaced by your own specifications. For `auth_pass`, you can pick any random password. However, make sure to use the same password for the master and the slave.
> **Note:** The outlined values `[]` are to be replaced by your own specifications. For `auth_pass`, you can pick any random password. However, make sure to use the same password for the master and the backup.

**Contents of `failover.sh` on both servers**

Expand Down Expand Up @@ -283,9 +283,9 @@ In normal operation, the master web server handles all requests.

![](images/master.png)

As soon as this fails, there is a failover to the slave web server.
As soon as this fails, there is a failover to the backup web server.

![](images/slave.png)
![](images/backup.png)

As soon as the master web server is reachable again, it is switched back to.

Expand Down

0 comments on commit ab32ec6

Please sign in to comment.