-
-
Notifications
You must be signed in to change notification settings - Fork 196
Document how to pack the ZODB when using containers #1886
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
83ecf32
7fc409d
1c79ac7
940692a
531b3d2
d568d95
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -118,3 +118,43 @@ RUN <<EOT | |
|
|
||
| After making these changes, build the project container as usual. | ||
| It will no longer output the access log, but will continue to output the event log. | ||
|
|
||
|
|
||
| ## Pack the ZODB | ||
|
|
||
| A common maintenance task of a Plone instance is to [pack the ZODB](https://zodb.org/en/stable/reference/zodb.html#ZODB.DB.pack). | ||
| Packing removes old revisions of objects. | ||
| It is similar to [routine vacuuming in PostgreSQL](https://www.postgresql.org/docs/8.3/routine-vacuuming.html). | ||
|
|
||
| The official {doc}`/install/containers/images/backend` container and project containers based on them have a `pack` command to pack the ZODB. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should have a |
||
| The command will work in standalone mode, ZEO mode, and RelStorage mode but only with PostgreSQL. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This sentence is confusing. "but only with PostgreSQL" is meant to be a qualifier only when using it with Relstorage, but it sounds like it applies to all the options, which makes no sense (it's only possible to use postgres if you're doing via Relstorage). |
||
|
|
||
erral marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Invoke the command in a running container by passing in the appropriate command for the mode. | ||
|
|
||
| In standalone mode, ZODB is in a mounted volume, so the command would be similar to the following. | ||
|
|
||
| ```shell | ||
| docker run -v /path/to/your/volume:/data plone/plone-backend pack | ||
| ``` | ||
|
|
||
| In ZEO mode, run the command next to your ZEO instance. | ||
|
|
||
| ```shell | ||
| docker run -e ZEO_ADDRESS=zeo:8100 --link zeo plone/plone-backend pack | ||
| ``` | ||
|
|
||
| In RelStorage mode, pass the connection DSN. | ||
|
|
||
| ```shell | ||
| docker run -e RELSTORAGE_DSN="dbname='plone' user='plone' host='db' password='password' port='5432'" pack | ||
| ``` | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In Docker Swarm, it's also necessary to specify the network if the database is only available on an internal network. It might be easier to use |
||
|
|
||
| In running containers that use Docker Compose, the command is less complicated. | ||
|
|
||
| ```shell | ||
| docker compose run backend pack | ||
| ``` | ||
|
|
||
| The above command assumes that the service that runs the Plone instance is named `backend`. | ||
| Otherwise replace `backend` with your container's name. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@erral @davisagli would this section be more appropriate under the existing Advanced usage in
plone/plone-backend?