February 2020
Intermediate to advanced
734 pages
38h 13m
English
As with etcd, we can manage Patroni via systemd if we create a file named patroni.service in the /etc/systemd/system directory with the following content:
[Unit] Description=Patroni PostgreSQL Cluster Service Documentation=https://github.com/zalando/patroni After=etcd.service [Service] User=postgres Type=simple ExecStart=/usr/local/bin/patroni /etc/patroni/stampede.yml Restart=always RestartSec=10s LimitNOFILE=40000 [Install] WantedBy=multi-user.target
Note that we want to start after etcd, and that we set the Type field to simple, which indicates the patroni process should be running for the service to be considered active.
Then, we could enable, start, and stop etcd using these systemctl commands:
sudo systemctl ...
Read now
Unlock full access