Skip to content

Commit 47aaeea

Browse files
stevepiercyerral
andauthored
Addendum to pack the ZODB in containers (#1899)
* Addendum to pack the ZODB in containers - Refs #1886 (review) * Apply suggestions from @erral * Apply suggestions from @erral * Update docs/install/containers/recipes/index.md Co-authored-by: Mikel Larreategi <mlarreategi@codesyntax.com> * Update docs/install/containers/recipes/index.md * Update index.md --------- Co-authored-by: Mikel Larreategi <mlarreategi@codesyntax.com>
1 parent aee2cf6 commit 47aaeea

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

docs/install/containers/recipes/index.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,15 @@ It will no longer output the access log, but will continue to output the event l
122122

123123
## Pack the ZODB
124124

125+
```{versionadded} Plone 6.0.15 and Plone 6.1.1
126+
```
127+
125128
A common maintenance task of a Plone instance is to [pack the ZODB](https://zodb.org/en/stable/reference/zodb.html#ZODB.DB.pack).
126129
Packing removes old revisions of objects.
127130
It is similar to [routine vacuuming in PostgreSQL](https://www.postgresql.org/docs/8.3/routine-vacuuming.html).
128131

129132
The official {doc}`/install/containers/images/backend` container and project containers based on them have a `pack` command to pack the ZODB.
130-
The command will work in standalone mode, ZEO mode, and RelStorage mode but only with PostgreSQL.
133+
The command will work in standalone mode, ZEO mode, and with PostgreSQL only in RelStorage mode.
131134

132135
Invoke the command in a running container by passing in the appropriate command for the mode.
133136

@@ -146,7 +149,16 @@ docker run -e ZEO_ADDRESS=zeo:8100 --link zeo plone/plone-backend pack
146149
In RelStorage mode, pass the connection DSN.
147150

148151
```shell
149-
docker run -e RELSTORAGE_DSN="dbname='plone' user='plone' host='db' password='password' port='5432'" pack
152+
docker run -e RELSTORAGE_DSN="dbname='plone' user='plone' host='db' password='password' port='5432'" plone/plone-backend pack
153+
```
154+
155+
In Docker Swarm, if the database is only available on an internal network, it's required to specify the network.
156+
For this situation, it might be easier to use `docker exec` to run the pack command in an existing `plone-backend` container.
157+
The following command assumes that the service that runs the Plone instance is named `backend`.
158+
Replace `backend` with your container's name.
159+
160+
```shell
161+
docker exec RELSTORAGE_DSN="dbname='plone' user='plone' host='db' password='password' port='5432' network='internal" backend pack
150162
```
151163

152164
In running containers that use Docker Compose, the command is less complicated.

0 commit comments

Comments
 (0)