Skip to content
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

PMM-12644 Remove the use of data container #3414

Open
wants to merge 7 commits into
base: v3
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 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
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,20 +139,20 @@ jobs:
git status


typos_check:
spell-check:
name: Spell check
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0

- name: Check spelling of md files
uses: crate-ci/typos@9d890159570d5018df91fedfa40b4730cd4a81b1 # v1.28.4
with:
files: "**/*.md ./documentation/**/*.md"

merge-gatekeeper:
needs: [ check, typos_check ]
needs: [ check, spell-check ]
name: Merge Gatekeeper
if: ${{ always() }}
runs-on: ubuntu-22.04
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

!!! summary alert alert-info ""
- Stop and rename the `pmm-server` container.
- Take a local copy of the `pmm-data` container's `/srv` directory.
- Take a local copy of the `pmm-server` container's `/srv` directory.

---

Expand All @@ -15,8 +15,9 @@
To check used Grafana plugins:

```sh
docker exec -it pmm-server ls /var/lib/grafana/plugins
docker exec -t pmm-server ls -l /var/lib/grafana/plugins
```

To backup container:
{.power-number}

Expand All @@ -26,13 +27,13 @@ To backup container:
docker stop pmm-server
```

2. Move the image:
2. Rename the image:

```sh
docker rename pmm-server pmm-server-backup
```

3. Create a subdirectory (e.g., `pmm-data-backup`) and move to it:
3. Create a subdirectory (e.g., `pmm-data-backup`) and change directory to it:

```sh
mkdir pmm-data-backup && cd pmm-data-backup
Expand All @@ -41,5 +42,5 @@ To backup container:
4. Back up the data:

```sh
docker cp pmm-data:/srv .
docker cp pmm-server-backup:/srv .
```
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ You can also install PMM 3 manually, following the instructions below.

Before starting the installation, review the installation prerequisites below and choose a method to run PMM Server with Docker based on your preferred data storage option:

- [Running Docker with Data container](../docker/run_with_data_container.md)
- [Running Docker with host directory](../docker/run_with_host_dir.md)
- [Running Docker with volume](../docker/run_with_vol.md)

Expand All @@ -35,7 +34,7 @@ Before starting the installation, review the installation prerequisites below an

!!! summary alert alert-info ""
- Pull the Docker image.
- Copy it to create a persistent data container.
- Choose how you want to store data.
- Run the image.
- Open the PMM UI in a browser.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

!!! summary alert alert-info ""
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we delete this summary?
Since the page already contains only this task, the summary seems to duplicate the existing content. Summary sections are more appropriate for long topics where they help users jump to specific sections.

- Stop the container.
- Remove (delete) both the server and data containers.
- Remove (delete) both images.
- Remove the container.
- Remove the data volume.
- Remove the image.

---

Expand All @@ -21,14 +22,20 @@ To remove the container:
docker stop pmm-server
```

2. Remove containers.
2. Remove the container.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
2. Remove the container.
2. Remove the container:


```sh
docker rm pmm-server pmm-data
docker rm pmm-server
```

3. Remove the image.
3. Remove the data volume.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
3. Remove the data volume.
3. Remove the data volume:


```sh
docker rmi $(docker images | grep "percona/pmm-server" | awk {'print $3'})
docker volume rm pmm-data
```

4. Remove the image.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
4. Remove the image.
4. Remove the image:


```sh
docker rmi $(docker images | grep "percona/pmm-server" | awk '{print $3}')
```
Copy link
Contributor

Choose a reason for hiding this comment

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

Since the page already contains only this task, the summary seems to duplicate the existing content. Summary sections are more appropriate for long topics where they help users jump to specific sections.

Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
!!! summary alert alert-info ""
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
!!! summary alert alert-info ""

- Stop and remove the container.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- Stop and remove the container.

- Restore (rename) the backup container.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- Restore (rename) the backup container.

- Restore saved data to the data container.
- Restore permissions to the data.
- Restore saved data to the data volume.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- Restore saved data to the data volume.

- Restore permissions to the directories.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- Restore permissions to the directories.

- Start the container.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- Start the container.


---
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
---


Expand Down Expand Up @@ -36,36 +37,24 @@ To restore the container:

4. Change directory to the backup directory (e.g. `pmm-data-backup`).
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
4. Change directory to the backup directory (e.g. `pmm-data-backup`).
4. Change directory to the backup directory (e.g. `pmm-data-backup`):


5. Remove Victoria Metrics data folder.

```sh
docker run --rm --volumes-from pmm-data -it perconalab/pmm-server:3.0.0-beta rm -r /srv/victoriametrics/data
cd pmm-data-backup
```

6. Copy the data.
5. Copy the data.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
5. Copy the data.
5. Copy the data:


```sh
docker cp srv pmm-data:/
docker run --rm -v $(pwd)/srv:/backup -v pmm-data:/srv -t perconalab/pmm-server:3.0.0-beta cp -r /backup/* /srv
```

7. Restore permissions.
6. Restore permissions.

```sh
docker run --rm --volumes-from pmm-data -it perconalab/pmm-server:3.0.0-beta chown -R root:root /srv && \
docker run --rm --volumes-from pmm-data -it perconalab/pmm-server:3.0.0-beta chown -R pmm:pmm /srv/alertmanager && \
docker run --rm --volumes-from pmm-data -it perconalab/pmm-server:3.0.0-beta chown -R root:pmm /srv/clickhouse && \
docker run --rm --volumes-from pmm-data -it perconalab/pmm-server:3.0.0-beta chown -R grafana:grafana /srv/grafana && \
docker run --rm --volumes-from pmm-data -it perconalab/pmm-server:3.0.0-beta chown -R pmm:pmm /srv/logs && \
docker run --rm --volumes-from pmm-data -it perconalab/pmm-server:3.0.0-beta chown -R postgres:postgres /srv/postgres14 && \
docker run --rm --volumes-from pmm-data -it perconalab/pmm-server:3.0.0-beta chown -R pmm:pmm /srv/prometheus && \
docker run --rm --volumes-from pmm-data -it perconalab/pmm-server:3.0.0-beta chown -R pmm:pmm /srv/victoriametrics && \
docker run --rm --volumes-from pmm-data -it perconalab/pmm-server:3.0.0-beta chown -R postgres:postgres /srv/logs/postgresql14.log
docker run --rm -v pmm-data:/srv -t perconalab/pmm-server:3.0.0-beta chown -R pmm:pmm /srv
```

8. Start the image.
7. Start the image.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
7. Start the image.
7. Start the image:


```sh
docker start pmm-server
```


This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,36 +10,38 @@ To run Docker with the host directory:
docker pull perconalab/pmm-server:3.0.0-beta
```

2. Run the image:
2. Identify a directory on the host that you want to use to persist PMM data. For example, `/home/user/srv`.

3. Run the image:

```sh
docker run --detach --restart always \
--publish 443:8443 \
--env PMM_WATCHTOWER_HOST=your_watchtower_host \
--env PMM_WATCHTOWER_TOKEN=your_watchtower_token \
--volumes-from pmm-data \
--volume /home/user/srv:/srv \
--network=pmm_default \
--name pmm-server \
perconalab/pmm-server:3.0.0-beta
```

3. Change the password for the default `admin` user:
4. Change the password for the default `admin` user:

```sh
docker exec -t pmm-server change-admin-password <new_password>
```

4. Check the [WatchTower prerequisites](../docker/index.md|#prerequisites) and pass the following command to Docker Socket to start [Watchtower](https://containrrr.dev/watchtower/):
5. Check the [WatchTower prerequisites](../docker/index.md|#prerequisites) and pass the following command to Docker Socket to start [Watchtower](https://containrrr.dev/watchtower/):

```sh
docker run -v /var/run/docker.sock:/var/run/docker.sock -e WATCHTOWER_HTTP_API_UPDATE=1 -e WATCHTOWER_HTTP_API_TOKEN=your_watchtower_token --hostname=your_watchtower_host --network=pmm_default docker.io/perconalab/watchtower
```

5. Visit `https://localhost:443` to see the PMM user interface in a web browser. (If you are accessing the docker host remotely, replace `localhost` with the IP or server name of the host.)
6. Visit `https://localhost:443` to see the PMM user interface in a web browser. (If you are accessing the docker host remotely, replace `localhost` with the IP or server name of the host.)

## Migrate from data container to host directory/volume
## Migrate from data container to host directory

To migrate your PMM from data container to host directory or volume run the following command:
To migrate your PMM from data container to host directory, run the following command:
Comment on lines +42 to +44
Copy link
Contributor

Choose a reason for hiding this comment

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

Is data container still the right term here?

Copy link
Member Author

Choose a reason for hiding this comment

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

IMO yes, it still is the right term.


```sh
docker cp <containerId>:/srv /target/host/directory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ To run Docker with volume:
--publish 443:8443 \
--env PMM_WATCHTOWER_HOST=your_watchtower_host \
--env PMM_WATCHTOWER_TOKEN=your_watchtower_token \
--volumes-from pmm-data \
--volume pmm-data:/srv \
--network=pmm_default \
--name pmm-server \
perconalab/pmm-server:3.0.0-beta
```

4. Change the password for the default `admin` user, replacing `your_secure_password123` with a strong, unique password:
4. Change the password for the default `admin` user, replacing `your_secure_password` with a strong, unique password:

```sh
docker exec -t pmm-server change-admin-password your_secure_password123
docker exec -t pmm-server change-admin-password your_secure_password
```

5. Check the [WatchTower prerequisites](../docker/index.md|#prerequisites) and pass the following command to Docker Socket to start [Watchtower](https://containrrr.dev/watchtower/):
Expand All @@ -41,4 +41,4 @@ To run Docker with volume:
docker run -v /var/run/docker.sock:/var/run/docker.sock -e WATCHTOWER_HTTP_API_UPDATE=1 -e WATCHTOWER_HTTP_API_TOKEN=your_watchtower_token --hostname=your_watchtower_host --network=pmm_default docker.io/perconalab/watchtower
```

6. Visit `https://localhost:443` to see the PMM user interface in a web browser. If you are accessing the Docker host remotely, replace `localhost` with the IP or server name of the host.
6. Visit `https://localhost:443` to see the PMM user interface in a web browser. If you are accessing the Docker host remotely, replace `localhost` with the IP or server name of the host.
14 changes: 7 additions & 7 deletions documentation/docs/pmm-upgrade/migrating_from_pmm_2.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Migrate PMM 2 to PMM 3

PMM 3 introduces significant architectural changes that require gradual transition from PMM 2:
PMM 3 introduces significant architectural changes that require gradual transition from PMM 2
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
PMM 3 introduces significant architectural changes that require gradual transition from PMM 2
PMM 3 introduces significant architectural changes that require gradual transition from PMM 2.


## Step 1: Upgrade PMM 2 Server to the latest version

Expand Down Expand Up @@ -50,7 +50,7 @@ Before upgrading to PMM 3, ensure your PMM 2 Server is running the latest versio
docker pull perconalab/pmm-server:3.0.0-beta
```

6. Run new container with existing volume:
6. Run the new version of PMM Server with the existing volume:

```sh
docker run -d -v pmm-server-data:/srv -p 443:8443 --name pmm-server --restart always perconalab/pmm-server:3.0.0-beta
Expand All @@ -73,7 +73,7 @@ Before upgrading to PMM 3, ensure your PMM 2 Server is running the latest versio
docker exec -t <pmm-server> chown -R pmm:pmm /srv
```

3. Identify data container using either:
3. Identify the data container using either:

```sh
docker ps -a --filter "status=created"
Expand All @@ -87,7 +87,7 @@ Before upgrading to PMM 3, ensure your PMM 2 Server is running the latest versio
{% endraw %}
```

4. Stop and remove existing container:
4. Stop and remove the existing container:

```sh
docker stop pmm-server && docker rm pmm-server
Expand All @@ -99,7 +99,7 @@ Before upgrading to PMM 3, ensure your PMM 2 Server is running the latest versio
docker pull perconalab/pmm-server:3.0.0-beta
```

6. Run new container with existing data container:
6. Run the new version PMM Server with the existing data container:

```sh
docker run -d --volumes-from pmm-server-data -p 443:8443 --name pmm-server --restart always perconalab/pmm-server:3.0.0-beta
Expand All @@ -110,7 +110,7 @@ Before upgrading to PMM 3, ensure your PMM 2 Server is running the latest versio
!!! caution alert alert-warning "Important"
PMM 3 Server provides limited support for PMM 2 Clients (metrics and Query Analytics only). This support will be removed in PMM 3.3.

Depending on your initial installation method, update PMM Clients using your operating system's package manager or by updating from a tarball.
Depending on your initial installation method, update PMM Clients using your operating system's package manager or using a tarball.
For detailed instructions, see the [Upgrade PMM Client topic](../pmm-upgrade/upgrade_client.md).

### Post-migration steps
Expand All @@ -120,4 +120,4 @@ After you finish migrating:

1. Verify that all PMM Clients are up to date by checking **PMM Configuration > Updates**.
2. Confirm all previously monitored services are reporting correctly to the new PMM 3 Server by reviewing **Configuration > PMM Inventory > Services**.
3. Check the dashboards to make sure you're receiving the metrics information and QAN data.
3. Check the dashboards to make sure you're receiving the metrics and QAN data.
1 change: 0 additions & 1 deletion documentation/mkdocs-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ nav:
- install-pmm/install-pmm-server/baremetal/docker/easy-install.md
- install-pmm/install-pmm-server/baremetal/docker/index.md
- install-pmm/install-pmm-server/baremetal/docker/run_with_vol.md
- install-pmm/install-pmm-server/baremetal/docker/run_with_data_container.md
- install-pmm/install-pmm-server/baremetal/docker/run_with_host_dir.md
- install-pmm/install-pmm-server/baremetal/docker/backup_container.md
- install-pmm/install-pmm-server/baremetal/docker/restore_container.md
Expand Down
Loading