Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: keepalived weights and slave naming #977

Merged
merged 3 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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