Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita2908fa

Browse files
Lev Kokotovgitbook-bot
Lev Kokotov
authored andcommitted
GITBOOK-56: change request with no subject merged in GitBook
1 parentb259b3e commita2908fa

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

‎pgml-docs/docs/guides/deployment/self-hosting/replication.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,9 @@ Finally, copy the data directory from the primary onto the replica:
158158

159159
```
160160
PGPASSWORD=<secure password> pg_basebackup \
161-
-h <the host or IP address of the primary>
162-
-p 5432
163-
-U replication_user
161+
-h <the host or IP address of the primary> \
162+
-p 5432 \
163+
-U replication_user \
164164
-D /var/lib/postgresql/14/main
165165
```
166166

@@ -179,21 +179,21 @@ restore_command = 'pgbackrest --stanza=demo archive-get %f "%p"'
179179

180180
By default, if Postgres is started as a replica, it will download all the WAL it can find from the archive, apply the data changes and promote itself to the primary role. To avoid this and keep the Postgres replica running as a read replica, we need to configure it to run in standby mode. To do so, place a file called`standby.signal` into the data directory, like so:
181181

182-
```
182+
```bash
183183
sudo -u postgres touch /var/lib/postgresql/14/main/standby.signal
184184
```
185185

186186
####Start the replica
187187

188188
Finally, the replica is ready to start:
189189

190-
```
190+
```bash
191191
sudo service postgresql start
192192
```
193193

194194
If you connect to it with`psql`, you can validate it's running in read-only mode:
195195

196-
```
196+
```sql
197197
SELECT pg_is_in_recovery();
198198
```
199199

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp