Skip to content

Commit d4b6609

Browse files
github-actions[bot]discourse-gatekeeper-docs-bot
andauthored
'modified: docs/how-to/h-set-up/h-scale.md' (#541)
Co-authored-by: discourse-gatekeeper-docs-bot <[email protected]>
1 parent ca6561b commit d4b6609

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

docs/how-to/h-set-up/h-scale.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,27 @@ To deploy PostgreSQL with multiple replicas, specify the number of desired units
1717
juju deploy postgresql --channel 14/stable -n <number_of_replicas>
1818
```
1919

20-
To retrieve the primary replica, one can use the action `get-primary` on any of the units running ` postgresql`:
20+
### Primary vs. leader unit
21+
22+
The [PostgreSQL primary server](https://www.postgresql.org/docs/current/runtime-config-replication.html#RUNTIME-CONFIG-REPLICATION-PRIMARY) unit may or may not be the same as the [juju leader unit](https://juju.is/docs/juju/leader).
23+
24+
The juju leader unit is the represented in `juju status` by an asterisk (*) next to its name.
25+
26+
To retrieve the juju unit that corresponds to the PostgreSQL primary, use the action `get-primary` on any of the units running ` postgresql`:
2127
```shell
2228
juju run postgresql/leader get-primary
2329
```
24-
2530
Similarly, the primary replica is displayed as a status message in `juju status`. However, one should note that this hook gets called on regular time intervals and the primary may be outdated if the status hook has not been called recently.
2631

27-
### `update-status` hook
28-
29-
**We highly suggest configuring the status hook to run frequently.** In addition to reporting the primary, secondaries, and other statuses, the status hook performs self-healing in the case of a network cut.
32+
[note]
33+
**We highly suggest configuring the `update-status` hook to run frequently.** In addition to reporting the primary, secondaries, and other statuses, the [status hook](https://juju.is/docs/sdk/update-status-event) performs self-healing in the case of a network cut.
3034

3135
To change the frequency of the `update-status` hook, run
3236
```shell
3337
juju model-config update-status-hook-interval=<time(s/m/h)>
3438
```
35-
Note that this hook executes a read query to PostgreSQL. On a production level server, this should be configured to occur at a frequency that doesn't overload the server with read requests. Similarly, the hook should not be configured at too quick of a frequency, as this can delay other hooks from running.
36-
37-
You can read more about status hooks [here](https://juju.is/docs/sdk/update-status-event).
39+
<!--Note that this hook executes a read query to PostgreSQL. On a production level server, this should be configured to occur at a frequency that doesn't overload the server with read requests. Similarly, the hook should not be configured at too quick of a frequency, as this can delay other hooks from running. -->
40+
[/note]
3841

3942
## Scale replicas on an existing application
4043

0 commit comments

Comments
 (0)