@@ -21,7 +21,7 @@ Learn more about Patroni in the [Architecture](/explanation/architecture) page.
21
21
22
22
The main Patroni tool is ` patronictl ` .
23
23
24
- ** It should only be used under the snap context** , via the user ` _daemon_ ` .
24
+ ** It should only be used under the snap context** , via the root user .
25
25
26
26
#### Cluster status
27
27
@@ -34,7 +34,7 @@ The main Patroni tool is `patronictl`.
34
34
> juju ssh postgresql/2
35
35
...
36
36
37
- ubuntu@juju-b87344-2:~$ sudo -u _daemon_ patronictl -c /var/snap/charmed-postgresql/current/etc/patroni/patroni.yaml topology
37
+ ubuntu@juju-b87344-2:~$ sudo patronictl -c /var/snap/charmed-postgresql/current/etc/patroni/patroni.yaml topology
38
38
+ Cluster: postgresql (7496847632512033809) ------+-----------+----+-----------+
39
39
| Member | Host | Role | State | TL | Lag in MB |
40
40
+-----------------+----------------+--------------+-----------+----+-----------+
@@ -53,7 +53,7 @@ Use `--help` to find all the available Patroni actions.
53
53
<details ><summary >Example: Patroni actions</summary >
54
54
55
55
``` text
56
- > sudo -u _daemon_ patronictl -c /var/snap/charmed-postgresql/current/etc/patroni/patroni.yaml --help
56
+ > sudo patronictl -c /var/snap/charmed-postgresql/current/etc/patroni/patroni.yaml --help
57
57
...
58
58
failover Failover to a replica
59
59
history Show the history of failovers/switchovers
@@ -78,7 +78,7 @@ Patroni can perform a low-level [switchover/failover](https://patroni.readthedoc
78
78
<details ><summary >Example: switchover (healthy cluster only)</summary >
79
79
80
80
``` text
81
- ubuntu@juju-b87344-2:~$ sudo -u _daemon_ patronictl -c /var/snap/charmed-postgresql/current/etc/patroni/patroni.yaml switchover postgresql --candidate postgresql-2 --force
81
+ ubuntu@juju-b87344-2:~$ sudo patronictl -c /var/snap/charmed-postgresql/current/etc/patroni/patroni.yaml switchover postgresql --candidate postgresql-2 --force
82
82
Current cluster topology
83
83
+ Cluster: postgresql (7496847632512033809) ----+-----------+----+-----------+
84
84
| Member | Host | Role | State | TL | Lag in MB |
@@ -96,7 +96,7 @@ Current cluster topology
96
96
| postgresql-3 | 10.189.210.26 | Replica | stopped | | unknown |
97
97
+---------------+----------------+---------+-----------+----+-----------+
98
98
99
- ubuntu@juju-b87344-2:~$ sudo -u _daemon_ patronictl -c /var/snap/charmed-postgresql/current/etc/patroni/patroni.yaml list
99
+ ubuntu@juju-b87344-2:~$ sudo patronictl -c /var/snap/charmed-postgresql/current/etc/patroni/patroni.yaml list
100
100
+ Cluster: postgresql (7496847632512033809) ----+-----------+----+-----------+
101
101
| Member | Host | Role | State | TL | Lag in MB |
102
102
+---------------+----------------+--------------+-----------+----+-----------+
@@ -110,7 +110,7 @@ ubuntu@juju-b87344-2:~$ sudo -u _daemon_ patronictl -c /var/snap/charmed-postgre
110
110
<details ><summary >Example: failover</summary >
111
111
112
112
``` text
113
- ubuntu@juju-b87344-2:~$ sudo -u _daemon_ patronictl -c /var/snap/charmed-postgresql/current/etc/patroni/patroni.yaml failover postgresql --candidate postgresql-3
113
+ ubuntu@juju-b87344-2:~$ sudo patronictl -c /var/snap/charmed-postgresql/current/etc/patroni/patroni.yaml failover postgresql --candidate postgresql-3
114
114
Current cluster list
115
115
+ Cluster: postgresql (7496847632512033809) ----+-----------+----+-----------+
116
116
| Member | Host | Role | State | TL | Lag in MB |
@@ -129,14 +129,14 @@ Are you sure you want to failover cluster postgresql, demoting current leader po
129
129
| postgresql-3 | 10.189.210.26 | Leader | running | 1 | |
130
130
+---------------+----------------+---------+---------+----+-----------+
131
131
132
- ubuntu@juju-b87344-2:~$ sudo -u _daemon_ patronictl -c /var/snap/charmed-postgresql/current/etc/patroni/patroni.yaml history
132
+ ubuntu@juju-b87344-2:~$ sudo patronictl -c /var/snap/charmed-postgresql/current/etc/patroni/patroni.yaml history
133
133
+----+-----------+------------------------------+----------------------------------+--------------+
134
134
| TL | LSN | Reason | Timestamp | New Leader |
135
135
+----+-----------+------------------------------+----------------------------------+--------------+
136
136
| 1 | 335544480 | no recovery target specified | 2025-04-25T04:44:53.137152+00:00 | postgresql-3 |
137
137
+----+-----------+------------------------------+----------------------------------+--------------+
138
138
139
- ubuntu@juju-b87344-2:~$ sudo -u _daemon_ patronictl -c /var/snap/charmed-postgresql/current/etc/patroni/patroni.yaml list
139
+ ubuntu@juju-b87344-2:~$ sudo patronictl -c /var/snap/charmed-postgresql/current/etc/patroni/patroni.yaml list
140
140
+ Cluster: postgresql (7496847632512033809) ----+-----------+----+-----------+
141
141
| Member | Host | Role | State | TL | Lag in MB |
142
142
+---------------+----------------+--------------+-----------+----+-----------+
@@ -154,7 +154,7 @@ Sometimes the cluster member might stuck in the middle of nowhere, the easiest w
154
154
<details ><summary >Example: cluster member re-initialization</summary >
155
155
156
156
``` text
157
- ubuntu@juju-b87344-2:~$ sudo -u _daemon_ patronictl -c /var/snap/charmed-postgresql/current/etc/patroni/patroni.yaml reinit postgresql postgresql-1
157
+ ubuntu@juju-b87344-2:~$ sudo patronictl -c /var/snap/charmed-postgresql/current/etc/patroni/patroni.yaml reinit postgresql postgresql-1
158
158
+ Cluster: postgresql (7496847632512033809) ----+-----------+----+-----------+
159
159
| Member | Host | Role | State | TL | Lag in MB |
160
160
+---------------+----------------+--------------+-----------+----+-----------+
0 commit comments