Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/install/authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ You need to create users in both source and target clusters. You will use these

{{plm.full_name}} authenticates in source and target clusters using the MongoDB Connection string URI. It has the following format:

```
```text
mongodb://user:pwd@host1:port1,host2:port2,host3:port3/[authdb]?[options]
```

Expand Down
215 changes: 215 additions & 0 deletions docs/install/docker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
# Run {{pcsm.full_name}} in Docker

You can run {{pcsm.full_name}} as a Docker container. This is useful for such use cases:

* you want to try out {{pcsm.full_name}} quickly without complex setup
* your MongoDB clusters also run in Docker
* you want to isolate {{pcsm.full_name}} in a containerized environment.

Docker images of {{pcsm.full_name}} are hosted publicly on [Docker Hub :octicons-link-external-16:](https://hub.docker.com/r/percona/percona-clustersync-mongodb).

Check notice on line 9 in docs/install/docker.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/install/docker.md#L9

[Google.Passive] In general, use active voice instead of passive voice ('are hosted').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('are hosted').", "location": {"path": "docs/install/docker.md", "range": {"start": {"line": 9, "column": 37}}}, "severity": "INFO"}

For more information about using Docker, see the [Docker Docs :octicons-link-external-16:](https://docs.docker.com/).

Make sure that you are using the latest version of Docker. The ones provided via apt and yum may be outdated and cause errors.

Check notice on line 13 in docs/install/docker.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/install/docker.md#L13

[Google.Passive] In general, use active voice instead of passive voice ('be outdated').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('be outdated').", "location": {"path": "docs/install/docker.md", "range": {"start": {"line": 13, "column": 98}}}, "severity": "INFO"}

By default, Docker will pull the image from Docker Hub if it is not available locally.

Check warning on line 15 in docs/install/docker.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/install/docker.md#L15

[Google.Will] Avoid using 'will'.
Raw output
{"message": "[Google.Will] Avoid using 'will'.", "location": {"path": "docs/install/docker.md", "range": {"start": {"line": 15, "column": 20}}}, "severity": "WARNING"}

Check notice on line 15 in docs/install/docker.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/install/docker.md#L15

[Google.Contractions] Use 'it's' instead of 'it is'.
Raw output
{"message": "[Google.Contractions] Use 'it's' instead of 'it is'.", "location": {"path": "docs/install/docker.md", "range": {"start": {"line": 15, "column": 59}}}, "severity": "INFO"}

## Prerequisites

1. You need to either deploy MongoDB or Percona Server for MongoDB as your source and target clusters or use existing deployments. Both clusters can run in Docker containers, on virtual machines, or in cloud environments.

2. The {{pcsm.short}} container must be able to reach all nodes in both source and target MongoDB clusters over the network. This includes:

* All replica set members that can become primary
* The `mongos` nodes in source and target clusters

3. Create users in both source and target clusters with appropriate permissions for authentication.

For example, to create a user for {{pcsm.short}} in Percona Server for MongoDB running in Docker, use the following command, replacing `psmdb` with your container name, `source` with the username and `mys3cretpAss` with the password:

```bash
docker exec -it psmdb mongosh --eval '
db.getSiblingDB("admin").createUser({
user: "source",
pwd: "mys3cretpAss",
roles: ["backup", "clusterMonitor", "readAnyDatabase"]
});'
```

See [Configure authentication](authentication.md) for details.

4. Your source cluster has some data to verify the replication.

## Deploy source and target clusters

In this example configuration we spin up single-node replica sets in Docker containers named `psmdb-source` and `psmdb-target`, respectively.

Check warning on line 45 in docs/install/docker.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/install/docker.md#L45

[Google.We] Try to avoid using first-person plural like 'we'.
Raw output
{"message": "[Google.We] Try to avoid using first-person plural like 'we'.", "location": {"path": "docs/install/docker.md", "range": {"start": {"line": 45, "column": 31}}}, "severity": "WARNING"}

In production, use the minimum recommended [three member replica sets](https://www.mongodb.com/docs/manual/core/replica-set-architecture-three-members/).

If you already have source and target clusters deployed, skip this step.

1. Create a Docker network:

```{.bash data-prompt="$"}
$ docker network create mymongo
```

2. Start Percona Server for MongoDB containers

* Start the container for the source replica set:

```bash
docker run -d \
--name psmdb-source \
--net mymongo \
-p 27017:27017 \
percona/percona-server-mongodb:8.0 \
mongod --replSet rs1 --bind_ip_all
Comment on lines +62 to +67
Copy link

Copilot AI Dec 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The --bind_ip_all flag exposes MongoDB to all network interfaces without authentication initially configured. This creates a security window where the database is accessible without credentials. Consider adding --auth flag or documenting that users should be created immediately after initialization.

Copilot uses AI. Check for mistakes.
```

* Start the container for the target replica set and map a different port:

```bash
docker run -d \
--name psmdb-target \
--net mymongo \
-p 27018:27017 \
percona/percona-server-mongodb:8.0 \
mongod --replSet rs2 --bind_ip_all
Comment on lines +73 to +78
Copy link

Copilot AI Dec 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The --bind_ip_all flag exposes MongoDB to all network interfaces without authentication initially configured. This creates a security window where the database is accessible without credentials. Consider adding --auth flag or documenting that users should be created immediately after initialization.

Copilot uses AI. Check for mistakes.
```

2. Initialize replica sets:

For the source:

```bash
docker exec -it psmdb-source mongosh --eval 'rs.initiate({
_id: "rs1",
members: [{ _id: 0, host: "psmdb-source:27017" }]
})'
```

For the target:

```bash
docker exec -it psmdb-target mongosh --eval 'rs.initiate({
_id: "rs2",
members: [{ _id: 0, host: "psmdb-target:27017" }]
})'
```

3. Verify that your replica sets are initialized and running:

Check notice on line 101 in docs/install/docker.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/install/docker.md#L101

[Google.Passive] In general, use active voice instead of passive voice ('are initialized').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('are initialized').", "location": {"path": "docs/install/docker.md", "range": {"start": {"line": 101, "column": 34}}}, "severity": "INFO"}

```{.bash data-prompt="$"}
docker exec -it psmdb-source mongosh --eval 'rs.status()'
docker exec -it psmdb-target mongosh --eval 'rs.status()'
```

4. Create a user for {{pcsm.full_name}} on the source:

```bash
docker exec -it psmdb-source mongosh --eval '
db.getSiblingDB("admin").createUser({
user: "source",
pwd: "mys3cretpAss",
roles: ["backup", "clusterMonitor", "readAnyDatabase"]
});'
```

5. Create a user for {{pcsm.full_name}} on the target:

```bash
docker exec -it psmdb-target mongosh --eval '
db.getSiblingDB("admin").createUser({
user: "target",
pwd: "t0ps3cret",
roles: ["backup", "clusterMonitor", "readAnyDatabase"]
});'
```

## Start {{pcsm.full_name}}

Start the {{pcsm.short}} container. You can specify connection strings using environment variables or command-line flags:

=== "Environment variables"

Use the `PCSM_SOURCE_URI` and `PCSM_TARGET_URI` environment variables:

```{.bash data-prompt="$"}
$ docker run --name pcsm1 --network mymongo -d \
-e PCSM_SOURCE_URI="mongodb://<source-user>:<source-password>@psmdb-source:27017" \
-e PCSM_TARGET_URI="mongodb://<target-user>:<target-password>@psmdb-target:27017" \
percona/percona-clustersync-mongodb:latest
```

Replace `<source-user>:<source-password>` and `<target-user>:<target-password>` with the credentials of the users you created for `pcsm` process in the source and target clusters.

=== "Command-line flags"

Pass the `--source` and `--target` flags directly:

```{.bash data-prompt="$"}
$ docker run --name pcsm1 --network mymongo -d \
percona/percona-clustersync-mongodb:latest \
--source "mongodb://<source-user>:<source-password>@psmdb-source:27017" \
--target "mongodb://<target-user>:<target-password>@psmdb-target:27017"
```

Replace `<source-user>:<source-password>` and `<target-user>:<target-password>` with the credentials of the users you created for `pcsm` process in the source and target clusters.

??? tip "Additional options"

You can combine environment variables with command-line flags or add other options:

```{.bash data-prompt="$"}
$ docker run --name pcsm1 --network mymongo -d \
-e PCSM_SOURCE_URI="mongodb://source:password@psmdb-source:27017" \
-e PCSM_TARGET_URI="mongodb://target:password@psmdb-target:27017" \
-p 2242:2242 \
percona/percona-clustersync-mongodb:latest \
--port 2242 \
--log-level debug
```

See [startup configuration](parameters.md) for all available options.

2. Check the initial status of {{pcsm.short}}:

```{.bash data-prompt="$"}
$ docker exec -it pcsm1 pcsm status
```

The status should be `idle`, indicating {{pcsm.short}} is ready to accept requests.


## Run {{pcsm.short}}

1. Start the replication process:

```bash
docker exec -it pcsm1 pcsm start
```

2. Monitor replication by checking the status:

```bash
docker exec -it pcsm1 pcsm status
```

3. View logs to monitor activity:

```{.bash data-prompt="$"}
$ docker logs -f pcsm1
```

4. Finalize the replication when you no longer need it:

```bash
docker exec -it pcsm1 pcsm finalize
```

Note that this is one-time operation. You cannot restart the replication after you finalized it. If you run the `start` command, {{pcsm.short}} will start the replication anew, with the initial sync.

Check notice on line 211 in docs/install/docker.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/install/docker.md#L211

[Google.Contractions] Use 'can't' instead of 'cannot'.
Raw output
{"message": "[Google.Contractions] Use 'can't' instead of 'cannot'.", "location": {"path": "docs/install/docker.md", "range": {"start": {"line": 211, "column": 47}}}, "severity": "INFO"}

Check warning on line 211 in docs/install/docker.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/install/docker.md#L211

[Google.Will] Avoid using 'will'.
Raw output
{"message": "[Google.Will] Avoid using 'will'.", "location": {"path": "docs/install/docker.md", "range": {"start": {"line": 211, "column": 149}}}, "severity": "WARNING"}

## Next steps

[Use {{pcsm.full_name}} :material-arrow-right:](usage.md){.md-button}
4 changes: 2 additions & 2 deletions docs/install/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@
$ curl http://localhost:2242/status
```

# Finalize the replication
## Finalize the replication

When you no longer need / want to replicate data, finalize the replication. PLM stops replication, creates the required indexes on the target, and stops. This is a one-time operation. You cannot restart the replicaton after you finalized it. If you run the `start` command, PLM will start the replication anew, with the initial sync.
When you no longer need / want to replicate data, finalize the replication. PLM stops replication, creates the required indexes on the target, and stops. This is a one-time operation. You cannot restart the replication after you finalized it. If you run the `start` command, PLM will start the replication anew, with the initial sync.

Check notice on line 148 in docs/install/usage.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/install/usage.md#L148

[Google.Acronyms] Spell out 'PLM', if it's unfamiliar to the audience.
Raw output
{"message": "[Google.Acronyms] Spell out 'PLM', if it's unfamiliar to the audience.", "location": {"path": "docs/install/usage.md", "range": {"start": {"line": 148, "column": 77}}}, "severity": "INFO"}

Check notice on line 148 in docs/install/usage.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/install/usage.md#L148

[Google.Contractions] Use 'can't' instead of 'cannot'.
Raw output
{"message": "[Google.Contractions] Use 'can't' instead of 'cannot'.", "location": {"path": "docs/install/usage.md", "range": {"start": {"line": 148, "column": 189}}}, "severity": "INFO"}

Check notice on line 148 in docs/install/usage.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/install/usage.md#L148

[Google.Acronyms] Spell out 'PLM', if it's unfamiliar to the audience.
Raw output
{"message": "[Google.Acronyms] Spell out 'PLM', if it's unfamiliar to the audience.", "location": {"path": "docs/install/usage.md", "range": {"start": {"line": 148, "column": 276}}}, "severity": "INFO"}

Check warning on line 148 in docs/install/usage.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/install/usage.md#L148

[Google.Will] Avoid using 'will'.
Raw output
{"message": "[Google.Will] Avoid using 'will'.", "location": {"path": "docs/install/usage.md", "range": {"start": {"line": 148, "column": 280}}}, "severity": "WARNING"}

=== "Command line"

Expand Down
5 changes: 5 additions & 0 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ We recommend installing PLM via the package manager of your operating system for

[Install from repositories :material-arrow-right:](install/repos.md){.md-button}

=== ":material-docker: Docker"

Run {{plm.full_name}} in a Docker container. This is useful when your MongoDB clusters run in Docker or when you want to isolate {{plm.short}} in a containerized environment.

[Run in Docker :material-arrow-right:](install/docker.md){.md-button}

=== ":octicons-file-code-16: Build from source"

Expand Down
19 changes: 14 additions & 5 deletions docs/system-requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,18 @@
* At least 2 logical CPU cores are recommended to reduce the 100% CPU saturation risk during the synchronization period
* {{plm.short}} process must be able to connect to all replica set nodes that could become a new primary. In non-sharded replica set deployments, this means connecting to all the nodes that could become a new primary node. To become a primary, a node must meet the following criteria:

* have `priority` greater than `0` and must be able to vote (`votes`: 1)
* is not an arbiter (`arbiterOnly: false`)
* is not hidden (`hidden: false`)
* is not delayed
* have `priority` greater than `0` and must be able to vote (`votes`: 1)

Check notice on line 7 in docs/system-requirements.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/system-requirements.md#L7

[Google.Parens] Use parentheses judiciously.
Raw output
{"message": "[Google.Parens] Use parentheses judiciously.", "location": {"path": "docs/system-requirements.md", "range": {"start": {"line": 7, "column": 1}}}, "severity": "INFO"}
* is not an arbiter (`arbiterOnly: false`)

Check notice on line 8 in docs/system-requirements.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/system-requirements.md#L8

[Google.Parens] Use parentheses judiciously.
Raw output
{"message": "[Google.Parens] Use parentheses judiciously.", "location": {"path": "docs/system-requirements.md", "range": {"start": {"line": 8, "column": 1}}}, "severity": "INFO"}

Check notice on line 8 in docs/system-requirements.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/system-requirements.md#L8

[Google.Contractions] Use 'isn't' instead of 'is not'.
Raw output
{"message": "[Google.Contractions] Use 'isn't' instead of 'is not'.", "location": {"path": "docs/system-requirements.md", "range": {"start": {"line": 8, "column": 5}}}, "severity": "INFO"}
* is not hidden (`hidden: false`)

Check notice on line 9 in docs/system-requirements.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/system-requirements.md#L9

[Google.Parens] Use parentheses judiciously.
Raw output
{"message": "[Google.Parens] Use parentheses judiciously.", "location": {"path": "docs/system-requirements.md", "range": {"start": {"line": 9, "column": 1}}}, "severity": "INFO"}

Check notice on line 9 in docs/system-requirements.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/system-requirements.md#L9

[Google.Contractions] Use 'isn't' instead of 'is not'.
Raw output
{"message": "[Google.Contractions] Use 'isn't' instead of 'is not'.", "location": {"path": "docs/system-requirements.md", "range": {"start": {"line": 9, "column": 5}}}, "severity": "INFO"}
* is not delayed

Check notice on line 10 in docs/system-requirements.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/system-requirements.md#L10

[Google.Contractions] Use 'isn't' instead of 'is not'.
Raw output
{"message": "[Google.Contractions] Use 'isn't' instead of 'is not'.", "location": {"path": "docs/system-requirements.md", "range": {"start": {"line": 10, "column": 5}}}, "severity": "INFO"}

Note that networking issues like connection to the remote backup storage can also affect {{plm.short}} performance.
Note that networking issues like connection to the remote backup storage can also affect {{plm.short}} performance.

## Docker requirements

When running {{plm.short}} in Docker:

* Ensure the Docker container has sufficient resources allocated (at least 1GB RAM and 2 CPU cores)

Check notice on line 18 in docs/system-requirements.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/system-requirements.md#L18

[Google.Parens] Use parentheses judiciously.
Raw output
{"message": "[Google.Parens] Use parentheses judiciously.", "location": {"path": "docs/system-requirements.md", "range": {"start": {"line": 18, "column": 66}}}, "severity": "INFO"}

Check failure on line 18 in docs/system-requirements.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/system-requirements.md#L18

[Google.Units] Put a nonbreaking space between the number and the unit in '1GB'.
Raw output
{"message": "[Google.Units] Put a nonbreaking space between the number and the unit in '1GB'.", "location": {"path": "docs/system-requirements.md", "range": {"start": {"line": 18, "column": 76}}}, "severity": "ERROR"}
* The container must have network connectivity to all MongoDB cluster nodes (source and target)

Check notice on line 19 in docs/system-requirements.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/system-requirements.md#L19

[Google.Parens] Use parentheses judiciously.
Raw output
{"message": "[Google.Parens] Use parentheses judiciously.", "location": {"path": "docs/system-requirements.md", "range": {"start": {"line": 19, "column": 77}}}, "severity": "INFO"}
* If MongoDB clusters also run in Docker, use Docker networks or host networking to ensure connectivity
* See the [Run {{pcsm.short}} in Docker](install/docker.md) guide for steps
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent use of product name abbreviations. The link text uses {{pcsm.short}} while other references in the same section use {{plm.short}}. Verify which abbreviation should be used consistently throughout this section.

Suggested change
* See the [Run {{pcsm.short}} in Docker](install/docker.md) guide for steps
* See the [Run {{plm.short}} in Docker](install/docker.md) guide for steps

Copilot uses AI. Check for mistakes.
1 change: 1 addition & 0 deletions mkdocs-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ nav:
- System requirements: system-requirements.md
- 1. Install:
- From repositories: install/repos.md
- Run in Docker: install/docker.md
- Build from source: install/source.md
- 2. Configure authentication: install/authentication.md
- 3. Start PLM: install/start-plm.md
Expand Down