Created
June 12, 2023 07:44
-
-
Save gnh1201/a1543a06b37fbbd30df5640db2966aa4 to your computer and use it in GitHub Desktop.
rqlite with systemd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INTERFACE=venet0 | |
NODE_ID=1 | |
HTTP_PORT=2001 | |
RAFT_PORT=2002 | |
JOIN= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=rqlite cluster | |
After=network-online.target | |
Wants=network-online.target | |
[Service] | |
Type=simple | |
EnvironmentFile=/etc/rqlite.env | |
ExecStartPre=/bin/bash -c "/bin/systemctl set-environment ip=$(/sbin/ip -o -4 addr list $INTERFACE | grep -v 127.0.0.1 | awk '{print $4}' | cut -d/ -f1)" | |
ExecStart=/usr/bin/rqlited -node-id ${NODE_ID} -http-addr ${ip}:${HTTP_PORT} -raft-addr ${ip}:${RAFT_PORT} -join ${JOIN} ${HOME}/node.${NODE_ID} | |
User=root | |
ExecReload=/bin/kill -HUP $MAINPID | |
KillSignal=SIGTERM | |
Restart=always | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment