Skip to content

Commit 2eb96a4

Browse files
authored
Add procedure for Corosync-qnet (#366)
Hacky but working solution...
1 parent 398e6e7 commit 2eb96a4

3 files changed

Lines changed: 95 additions & 0 deletions

File tree

Services/Corosync-qnetd.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Corosyn-qnet
2+
3+
I'm running this inside a Debian container on my Alpine's Raspberry PI server to act as a third / external node for my Proxmox cluster.
4+
See <https://pve.proxmox.com/wiki/Cluster_Manager#_corosync_external_vote_support>.
5+
6+
**Warning:** This solution works but is kinda hacky...
7+
8+
## Install Docker on my Server (if not done already)
9+
10+
<https://github.com/Antiz96/Linux-Server/blob/main/Services/Docker.md>
11+
12+
## Set up ssh connection with the proxmox nodes
13+
14+
```bash
15+
sudo -e /etc/ssh/sshd_config
16+
```
17+
18+
> [...]
19+
> PermitRootLogin prohibit-password
20+
> [...]
21+
22+
```bash
23+
sudo rc-service sshd restart
24+
```
25+
26+
Proceed to SSH key exchange with every nodes (for the `root` user).
27+
Set `~/.ssh/config` if needed.
28+
29+
## Setup the Debian container
30+
31+
```bash
32+
sudo docker run -dit --restart=unless-stopped --network host --hostname debian --name debian debian:bookworm-slim bash # Pull and run a Debian container
33+
sudo docker exec -it debian bash # Enter the container
34+
apt update && apt install corosync-qnetd # Install the corosync-qnetd package
35+
exit # Exit the container
36+
sudo docker commit debian qnetd:latest # Commit the container as a custom image
37+
sudo docker rm -f debian # Delete the Debian container
38+
sudo docker run -dit --restart=unless-stopped --network host --hostname qnetd --name qnetd qnetd corosync-qnetd -f # Run the custom container once to retrieve the corosync files from the host
39+
sudo docker cp qnetd:/etc/corosync /etc/ # Copy the needed corosync files to host
40+
sudo docker rm -f qnetd # Delete the container
41+
sudo docker run -dit --restart=unless-stopped --network host -v /etc/corosync:/etc/corosync -v /tmp:/tmp --hostname qnetd --name qnetd qnetd corosync-qnetd -f # Run the custom container with the proper volume mapping
42+
sudo docker image prune -a # Remove dangling image
43+
```
44+
45+
## Setup cluster node
46+
47+
On the QDEVICE node:
48+
49+
```bash
50+
sudo vim /usr/local/bin/corosync-qnetd-certutil
51+
```
52+
53+
> #!/bin/bash
54+
> docker exec -i qnetd corosync-qnetd-certutil "$@"
55+
56+
```bash
57+
sudo chmod +x /usr/local/bin/corosync-qnetd-certutil
58+
```
59+
60+
On **every** Proxmox (PVE) nodes:
61+
62+
```bash
63+
sudo apt install corosync-qdevice
64+
```
65+
66+
From **one** of the Proxmox (PVE) nodes:
67+
68+
```bash
69+
sudo pvecm qdevice setup <QDEVICE-IP> # **Warning:** This command expects **all** nodes to use the default 22 SSH port
70+
```
71+
72+
You can check that all the steps have successfully completed with:
73+
74+
```bash
75+
sudo pvecm status
76+
```
77+
78+
## Update
79+
80+
```bash
81+
sudo docker exec -it qnetd bash # Enter the container
82+
apt update && apt full-upgrade && apt autoremove # Update the system
83+
exit # Exit the container
84+
```

Services/Docker.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,16 @@ sudo pacman -S docker
99
sudo systemctl enable --now docker containerd
1010
```
1111

12+
## Install Docker on Alpine
13+
14+
```bash
15+
sudo apk add docker
16+
sudo rc-update add docker
17+
sudo rc-update add containerd
18+
sudo rc-service docker start
19+
sudo rc-service containerd start
20+
```
21+
1222
## Install Docker on Debian
1323

1424
<https://www.linode.com/docs/guides/installing-and-using-docker-on-ubuntu-and-debian/>

Services/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,4 @@ This is a (non-exhaustive) list of installation and configuration procedures of
3838
- [Uptime Kuma - Uptime monitoring](https://github.com/Antiz96/Linux-Server/blob/main/Services/Uptime-Kuma.md)
3939
- [Homepage - Dashboard](https://github.com/Antiz96/Linux-Server/blob/main/Services/Homepage.md)
4040
- [Shlink - URL Shortener](https://github.com/Antiz96/Linux-Server/blob/main/Services/Shlink.md)
41+
- [Corosync-qnetd - Corosync qdevice external voter for Proxmox cluster](https://github.com/Antiz96/Linux-Server/blob/main/Services/Corosync-qnetd.md)

0 commit comments

Comments
 (0)