Skip to content
This repository was archived by the owner on Apr 2, 2024. It is now read-only.

Commit 5b8727e

Browse files
committed
Switch docs to using the ha docker image
This image contains a lot more tools, including toolkit. It is also the official image of the company.
1 parent c3c95d6 commit 5b8727e

File tree

2 files changed

+55
-8
lines changed

2 files changed

+55
-8
lines changed

docs/docker.md

Lines changed: 53 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@ on Docker Hub at [timescale/promscale](https://hub.docker.com/r/timescale/promsc
88
To fetch the latest Promscale image, please refer to the [releases](https://github.com/timescale/promscale/releases)
99
section of Promscale github repository.
1010

11-
A docker image of TimescaleDB with the `promscale`
12-
extension is available at on Docker Hub at
13-
[`timescaledev/promscale-extension:latest-ts2-pg13`](https://hub.docker.com/r/timescaledev/promscale-extension). You can
14-
install this via `docker pull timescaledev/promscale-extension:latest-ts2-pg13`.
11+
A docker image of TimescaleDB with associated extensions including the `promscale`
12+
extension is available on Docker Hub at [`timescale/timescaledb-ha:pg14-latest`](https://hub.docker.com/r/timescale/timescaledb-ha).
13+
You can install this via `docker pull timescale/timescaledb-ha:pg14-latest`.
1514

16-
The `ts2-pg13` suffix means TimescaleDB version 2 on PostgreSQL version 13. We also publish images to DockerHub for other combinations of TimescaleDB and PostgreSQL versions in case you have specific version requirements.
15+
The `pg14` suffix means this image is for PostgreSQL version 14. We also publish images to DockerHub for other PostgreSQL versions in case you have specific version requirements.
1716

1817
**Example using docker:**
1918

@@ -26,7 +25,7 @@ docker network create --driver bridge promscale-timescaledb
2625
Install and run TimescaleDB with Promscale extension:
2726

2827
```dockerfile
29-
docker run --name timescaledb -e POSTGRES_PASSWORD=<password> -d -p 5432:5432 --network promscale-timescaledb timescaledev/promscale-extension:latest-ts2-pg13 postgres -csynchronous_commit=off
28+
docker run --name timescaledb -e POSTGRES_PASSWORD=<password> -d -p 5432:5432 --network promscale-timescaledb timescale/timescaledb-ha:pg14-latest postgres -csynchronous_commit=off
3029
```
3130

3231
Finally, let's run Promscale:
@@ -105,3 +104,51 @@ our docs or by running with the `-h` flag (e.g. `promscale -h`).
105104
## 🛠 Building from source
106105

107106
You can build the Docker container using the [Dockerfile](../build/Dockerfile).
107+
108+
## Upgrading from the previous alpine image
109+
110+
Previously, our recommended image was located at [`timescaledev/promscale-extension`](https://hub.docker.com/r/timescaledev/promscale-extension).
111+
It was based on the [Alpine docker image for PostgreSQL](https://github.com/docker-library/postgres/blob/e8ebf74e50128123a8d0220b85e357ef2d73a7ec/12/alpine/Dockerfile).
112+
Because of [collation bugs](https://github.com/docker-library/postgres/issues/327) and other issues we have now switched our recommendation to the Debian-based image above.
113+
114+
Our previous Alpine-based image will continue to be supported but all new installations should switch to the `timescaledb-ha` image specified above.
115+
116+
You can also migrate to Debian version by doing the following (please note: this can be a lengthy process and involves downtime):
117+
118+
1. Use `docker inspect` to determine the data volumes used by your database for the data directory.
119+
1. Shutdown all Promscale Connectors.
120+
1. Shutdown the original database docker image while preserving the volume mount for the data directory.
121+
You will need to mount this same directory in the new image.
122+
1. Change the ownership of the data-directory to the postgres user and group in the new image. For example:
123+
```
124+
docker run -v <data_dir_volume_mount>:/var/lib/postgresql/data timescale/timescaledb-ha:pg14-latest chown -R postgres:postgres /var/lib/postgresql/data
125+
```
126+
1. Start the new docker container with the same volume mounts as what the original container used.
127+
1. Connect to the new database using psql and reindex all the data that has data
128+
that is collatable. This is necessary because the collation in the Alpine image
129+
is broken and so BTREE-based indexes will be incorrect until they are reindexed.
130+
It is extremely important to execute this step before ingesting new data to
131+
avoid data corruption. Note: This process can take a long time depending on how
132+
much indexed textual data the database has. You should use the following query to
133+
reindex all the necessary indexes:
134+
```
135+
DO $$DECLARE r record;
136+
BEGIN
137+
FOR r IN
138+
SELECT DISTINCT indclass
139+
FROM (SELECT indexrelid::regclass indclass, unnest(string_to_array(indcollation::text, ' ')) coll FROM pg_catalog.pg_index) sub
140+
INNER JOIN pg_catalog.pg_class c ON (c.oid = sub.indclass)
141+
WHERE coll !='0' AND c.relkind != 'I'
142+
LOOP
143+
EXECUTE 'REINDEX INDEX ' || r.indclass;
144+
END LOOP;
145+
END$$;
146+
```
147+
148+
1. Restart the Promscale Connector
149+
150+
If you are using Kubernetes instead of plain docker you should:
151+
1. Shutdown the Promscale Connector pods
152+
1. Change the database pod to use the debian docker image and restart it.
153+
1. Execute jobs for the script in steps 4 and 6 above.
154+
1. Restart the Promscale Connector pods.

docs/tracing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Next step is to configure your services to [send traces to Promscale](#ingest-tr
5454

5555
Promscale consists of the Promscale Connector and TimescaleDB.
5656

57-
There are images on DockerHub for both the [Promscale Connector](https://hub.docker.com/r/timescale/promscale/tags) and [TimescaleDB with the Promscale extension](https://hub.docker.com/r/timescaledev/promscale-extension).
57+
There are images on DockerHub for both the [Promscale Connector](https://hub.docker.com/r/timescale/promscale/tags) and [TimescaleDB with the Promscale extension](https://hub.docker.com/r/timescale/timescaledb-ha).
5858

5959
For the Promscale Connector we recommend using the latest version with tracing support (`0.7.0-beta.latest`). For TimescaleDB with the Promscale extension the latest version with more recent TimescaleDB and Postgres versions (`latest-ts2-pg13`).
6060

@@ -69,7 +69,7 @@ docker network create --driver bridge promscale-timescaledb
6969
Then let's run TimescaleDB with the Promscale extension (replace `<password>` with your selected password):
7070

7171
```bash
72-
docker run --name timescaledb -e POSTGRES_PASSWORD=<password> -d -p 5432:5432 --network promscale-timescaledb timescaledev/promscale-extension:latest-ts2-pg13 postgres -csynchronous_commit=off
72+
docker run --name timescaledb -e POSTGRES_PASSWORD=<password> -d -p 5432:5432 --network promscale-timescaledb timescale/timescaledb-ha:pg14-latest postgres -csynchronous_commit=off
7373
```
7474

7575
Finally let’s run the Promscale Connector with tracing enabled (replace `<password>` with the password you selected in the previous step):

0 commit comments

Comments
 (0)