Git Product home page Git Product logo

timescaledb-docker's Introduction

Timescale

What is TimescaleDB?

TimescaleDB is an open-source database designed to make SQL scalable for time-series data. For more information, see the Timescale website.

How to use this image

This image is based on the official Postgres docker image so the documentation for that image also applies here, including the environment variables one can set, extensibility, etc.

Starting a TimescaleDB instance

docker run -d --name some-timescaledb -p 5432:5432 -e POSTGRES_PASSWORD=password timescale/timescaledb:latest-pg16

Then connect with an app or the psql client:

docker run -it --net=host -e PGPASSWORD=password --rm timescale/timescaledb:latest-pg16 psql -h localhost -U postgres

You can also connect your app via port 5432 on the host machine.

If you are running your docker image for the first time, you can also set an environmental variable, TIMESCALEDB_TELEMETRY, to set the level of telemetry in the Timescale docker instance. For example, to turn off telemetry, run:

docker run -d --name some-timescaledb -p 5432:5432 -e TIMESCALEDB_TELEMETRY=off -e POSTGRES_PASSWORD=password timescale/timescaledb:latest-pg16

Note that if the cluster has previously been initialized, you should not use this environment variable to set the level of telemetry. Instead, follow the instructions in our docs to disable telemetry once a cluster is running.

If you are interested in the latest development snapshot of timescaledb there is also a nightly build available under timescaledev/timescaledb:nightly-pg16 (for PG 14, 15 and 16).

Notes on timescaledb-tune

We run timescaledb-tune automatically on container initialization. By default, timescaledb-tune uses system calls to retrieve an instance's available CPU and memory. In docker images, these system calls reflect the available resources on the host. For cases where a container is allocated all available resources on a host, this is fine. But many use cases involve limiting the amount of resources a container (or the docker daemon) can have on the host. Therefore, this image looks in the cgroups metadata to determine the docker-defined limit sizes then passes those values to timescaledb-tune.

To specify your own limits, use the TS_TUNE_MEMORY and TS_TUNE_NUM_CPUS environment variables at runtime:

docker run -d --name timescaledb -p 5432:5432 -e POSTGRES_PASSWORD=password -e TS_TUNE_MEMORY=4GB -e TS_TUNE_NUM_CPUS=4 timescale/timescaledb:latest-pg16

To specify a maximum number of background workers, use the TS_TUNE_MAX_BG_WORKERS environment variable:

docker run -d --name timescaledb -p 5432:5432 -e POSTGRES_PASSWORD=password -e TS_TUNE_MAX_BG_WORKERS=16 timescale/timescaledb:latest-pg16

To specify a maximum number of connections, use the TS_TUNE_MAX_CONNS environment variable:

docker run -d --name timescaledb -p 5432:5432 -e POSTGRES_PASSWORD=password -e TS_TUNE_MAX_CONNS=200 timescale/timescaledb:latest-pg16

To not run timescaledb-tune at all, use the NO_TS_TUNE environment variable:

docker run -d --name timescaledb -p 5432:5432 -e POSTGRES_PASSWORD=password -e NO_TS_TUNE=true timescale/timescaledb:latest-pg16

timescaledb-docker's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

timescaledb-docker's Issues

Question/ Enhancement: Does the image support ARM architectures?

The original Postgres image supports ARM architectures: https://hub.docker.com/_/postgres/

Supported architectures: (more info)
amd64, arm32v5, arm32v6, arm32v7, arm64v8, i386, ppc64le, s390x

Does the TimescaleDB docker image provide this feature, too? I wanted to run it on a Raspberry Pi and got the error: standard_init_linux.go:190: exec user process caused "exec format error"

If it is not available for ARM architectures, this issue should be considered as an enhancement.

timescale not re-tuned when data directory is in a volume

For persistence, we run our timescaledb with the postgres data directory mapped to a docker volume. In this setup, timescaledb-tune doesn't re-tune the database if the resource constrains are changed. This lead to a nasty surprise after we lowered the memory limit. At some point, the database went beyond its allocated memory, was killed, and kept getting killed every time it tried to (re)start.

Reproduction (some output trimmed):

Run timescaledb with 20GB, and mount the data dir:

$ docker run --rm -d --name temp --cpus 1 --memory 20g -v /tmp/foo:/var/lib/postgresql/data/ timescale/timescaledb:1.6.0-pg11

$ docker exec -it temp psql -U postgres -d postgres -c "SHOW shared_buffers;"
 shared_buffers
----------------
 5GB

$ docker stop temp

Re-run the container with a limit of 1GB, using the previously created data dir:

$docker run --rm -d --name temp --cpus 1 --memory 1g -v /tmp/foo:/var/lib/postgresql/data/ timescale/timescaledb:1.6.0-pg11

$ docker exec -it temp psql -U postgres -d postgres -c "SHOW shared_buffers;"
 shared_buffers
----------------
 5GB

$ docker stop temp

Note that postgres is still configured to use 5GB of shared_buffers despite having a limit of 1GB.

Bitnami Image + Official Helm Chart Doesn't Work With Replication

When substituting the latest TimescaleDB Bitnami image (PG 11, TimeScale 1.3.2) and using the official PostgreSQL helm chart, the replication slaves fail to start because TimescaleDB is trying to install the extension, but it is not supplying the password for the postgres user. The reason seems to be differences in how the master and slaves start up. It looks like the TimescaleDB extension installation script relies on the HBA authentication being set to trust mode.

timescale/timescaledb-postgis compatible with ARM

Please update the docker script so that you can generate an image of
timescale/timescaledb-postgis
compatible which is compatible with ARM / ARM 64 just like
timescale/timescaledb
is.

Background:

Trying to run timescale/timescaledb-postgis fails with this error on a 32 bit os running on a Raspberry Pi 4:

standard_init_linux.go:211: exec user process caused "exec format error"

A lot of people elaborate with IoT and docker on Raspberry Pis. There's an interest in time series databases in the community for Home Assistant, an open source home automation platform. Offering a simple way of running TimescaleDB together with Home Assistant would be beneficial for everyone involved.

timescale bitnami image + bitnami helm chart will not start

Hello,
I am trying to deploy timescale to k8s using helm but it keeps failing without any error. i have tried their official bitnami Postgres image and they work fine.

k logs timescale-postgresql-0
 06:30:53.62
 06:30:53.62 Welcome to the Bitnami postgresql container
 06:30:53.62 Subscribe to project updates by watching https://github.com/bitnami/bitnami-docker-postgresql
 06:30:53.63 Submit issues and feature requests at https://github.com/bitnami/bitnami-docker-postgresql/issues
 06:30:53.63 Send us your feedback at [email protected]
 06:30:53.63
 06:30:53.64 INFO  ==> ** Starting PostgreSQL setup **
 06:30:53.66 INFO  ==> Validating settings in POSTGRESQL_* env vars..
 06:30:53.66 INFO  ==> Initializing PostgreSQL database...
 06:30:53.67 INFO  ==> postgresql.conf file not detected. Generating it...
 06:30:53.67 INFO  ==> pg_hba.conf file not detected. Generating it...
 06:30:53.68 INFO  ==> Deploying PostgreSQL with persisted data...
 06:30:53.68 INFO  ==> Configuring replication parameters
 06:30:53.69 INFO  ==> Configuring fsync
 06:30:53.70 INFO  ==> Loading custom scripts...
 06:30:53.70 INFO  ==> Loading user's custom files from /docker-entrypoint-initdb.d ...
 06:30:53.70 INFO  ==> Starting PostgreSQL in background...
 06:30:53.81 INFO  ==> Stopping PostgreSQL...

Problems in deploying timescaledb with updated official postgres helm chart based on bitnami

I am trying to deploy timescaledb docker image 1.2.0-pg10-bitnami with official postgres helm chart as the following:

helm install --name "myname" -f my-timescaledb-values.yaml stable/postgresql --set postgresqlPassword=<pass>

My values file is:

image:
  repository: timescale/timescaledb
#  tag: 1.2.0-pg10
  tag: 1.2.0-pg10-bitnami
metrics:
  enabled: true

persistence:
  enabled: true
  storageClass: ssd
  size: 200Gi

## PostgreSQL service configuration
service:
  type: NodePort
  nodePort: 32150

#postgresqlDataDir: /bitnami/postgresql

postgresqlDatabase: "postgres"
postgresqlUsername: "postgres"

And I am running into issues:

  1. postgres user password is not initialized
  2. When trying to connect to container in initialize the password manually, I receive the following error:
psql: local user with ID 1001 does not exist
  1. When trying to connect with psql -U postgres and altering the password with ALTER USER postgres WITH PASSWORD '####', still cannot connect to the server (authentication failed)

Compatibility with Dokku postgres plugin

Hi,
I am just starting to use TimescaleDB and ran into an issue for my deployment right away. Thanks for providing a docker image based on the official Postgres one!

I'm using dokku (similar to Heroku) to deploy my apps and they support Postgres with a nice plugin. The plugin even allows to specify the image name and version which lets you install TimescaleDB directly!

However, bad news: it doesn't start the container correctly ๐Ÿ˜ž
Good news though is that all it takes is to copy existing server.crt and server.key from a different Postgres DB container to the TimescaleDB one.

This issue and solution was brought up here dokku/dokku-postgres#153 - I was wondering if that's maybe something that can be fixed in the timescaledb docker image.

Is there a specific reason why TimescaleDB deletes the server certificate? - can we simply not delete it or maybe generate one?

trying to build postgis locally but get ERROR: unsatisfiable constraints

I am trying to build timescaledb-postgis locally but I get ERROR: unsatisfiable constraints:
geos (missing):
required by: .postgis-deps-20200312.163435[geos]
gdal (missing):
required by: .postgis-deps-20200312.163435[gdal]
proj (missing):
required by: .postgis-deps-20200312.163435[proj]

I think this is related to using alpine 3.9 to build on. Alpine 3.9 repository does not have those packages. However alpine 3.11 does. Is there a way to build on alpine 3.11? The postgres docker-library (https://github.com/docker-library/postgres) is using alpine 3.11, so it sounds like this may be possible. Alpine 3.11 also has postgis v3 which is what I want to try and upgrade timescaledb-postgis too.

Thanks
Jim

`timescaledb:latest-pg9.6` complaining "sorry, too many clients already"

We've been using timescaledb/timescaledb:latest-pg9.6 for a while without problem, but this morning with the update to timescaledb 1.2.0 we started seeing the following error in our builds:

17:00:30.681 [error] Postgrex.Protocol (#PID<0.464.0>) failed to connect: ** (Postgrex.Error) FATAL 53300 (too_many_connections): sorry, too many clients already
17:00:30.883 [info] Failed to start Postgrex.Notifications due to: %Postgrex.Error{connection_id: nil, message: nil, postgres: %{code: :too_many_connections, file: "proc.c", line: "340", message: "sorry, too many clients already", pg_code: "53300", routine: "InitProcess", severity: "FATAL", unknown: "FATAL"}}

Setting our docker image to timescaledb/timescaledb:1.1.1-pg9.6 makes it function properly. Perhaps an issue in the 1.2.0 update to timescaledb? Methinks that if there is an issue, that the latest-pg9.6 tag should not point to the new version yet until that issue is resolved.

Environment variables not set when used in docker-compose

Hi,

I have a problem with setting timescale credentials when using it inside docker-compose file. It looks like environment variables are not read and docker image starts with the default values. Example docker-compose.yml:

version: "3.7"

services:
  timescale:
    image: timescale/timescaledb
    container_name: timescale
    restart: unless-stopped
    ports:
      - 5432:5432
    environment:
      - "POSTGRES_USER:postgres"
      - "POSTGRES_PASSWORD:postgres"

By executing docker-compose up It starts but in logs there is a following warning:

timescale    | ****************************************************
timescale    | WARNING: No password has been set for the database.
timescale    |          This will allow anyone with access to the
timescale    |          Postgres port to access your database. In
timescale    |          Docker's default configuration, this is
timescale    |          effectively any other container on the same
timescale    |          system.
timescale    | 
timescale    |          Use "-e POSTGRES_PASSWORD=password" to set
timescale    |          it in "docker run".
timescale    | ****************************************************

And when I try to access it:

> psql -U postgres -h localhost -p 5432
Password for user username: 
psql: FATAL:  password authentication failed for user "postgres"

In docker-compose logs it throws:

timescale    | FATAL:  password authentication failed for user "postgres"
timescale    | DETAIL:  User "postgres" has an empty password.
timescale    |  Connection matched pg_hba.conf line 95: "host all all all md5"

postgres process not running as PID 1 & doesn't receive halt signal

postgres get wrapped by backup_init.sh & thus the container doesn't shut down properly. Causing an issue in our kubernetes environment hanging deployment updates.

$ docker run -p 5432:5432 -d timescale/timescaledb:0.9.1-pg10
$ docker exec 9c28f07b23b0 ps                              
PID   USER     TIME   COMMAND
    1 root       0:00 {backup_init.sh} /bin/bash ./backup_init.sh postgres
    8 postgres   0:00 postgres
   49 postgres   0:00 postgres: checkpointer process   
   50 postgres   0:00 postgres: writer process   
   51 postgres   0:00 postgres: wal writer process   
   52 postgres   0:00 postgres: autovacuum launcher process   
   53 postgres   0:00 postgres: stats collector process   
   54 postgres   0:00 postgres: bgworker: logical replication launcher   
   55 root       0:00 ps

container_linux.go:344: starting container process caused "exec: \"docker-entrypoint.sh\": executable file not found in $PATH": unknown.

I`m trying to execute docker command from official timescale docs:

docker run -d --name timescaledb -p 5432:5432 -e POSTGRES_PASSWORD=password timescale/timescaledb:latest-pg12

and I`m getting this one error:

docker: Error response from daemon: OCI runtime create failed: container_linux.go:344: starting container process caused "exec: \"docker-entrypoint.sh\": executable file not found in $PATH": unknown.

Question: locale support

How can we set a default locale for new database instances?

The current docker image (timescale/timescaledb:1.5.0-pg11) is based on postgres-alpine so the usual way of setting the locale/collation/etc. does not work: e.g. for initdb: POSTGRES_INITDB_ARGS=--lc-collate=de-AT --lc-ctype=de-AT
see this issue on stackexchange

So how can we resolve this?

  • do you provide an image that is based on the default postgres image (i.e. not -alpine)?
    I guess not yet, because of #26
  • or is there a simple way to activate/install locales in the current alpine image?

PgTune creates invalid configuration inside docker

Hello,

For some reason PgTune thinks we have 8 388 608 TB of available memory.
This results in invalid configuration because some values exceeds integer range.
As of #53 it's easy to disable or override this.
Anyway I'm opening this issue to track this behavior.

Bellow is relevant part of the container output:

Recommendations based on 8 388 608.00 TB of available memory and 4 CPUs for PostgreSQL 11
shared_buffers = 2147483647GB
effective_cache_size = 2147483647GB
maintenance_work_mem = 2047MB
work_mem = 10737418GB
timescaledb.max_background_workers = 4
max_worker_processes = 11
max_parallel_workers_per_gather = 2
max_parallel_workers = 4
wal_buffers = 16MB
min_wal_size = 4GB
max_wal_size = 8GB
default_statistics_target = 500
random_page_cost = 1.1
checkpoint_completion_target = 0.9
max_connections = 50
max_locks_per_transaction = 512
effective_io_concurrency = 200
timescaledb.last_tuned = '2019-02-14T12:42:38Z'
timescaledb.last_tuned_version = '0.4.1'
Saving changes to: /var/lib/postgresql/data/postgresql.conf

2019-02-14 12:42:38.961 UTC [31] LOG:  received fast shutdown request
waiting for server to shut down....2019-02-14 12:42:38.963 UTC [31] LOG:  aborting any active transactions
2019-02-14 12:42:38.963 UTC [43] LOG:  terminating TimescaleDB job scheduler due to administrator command
2019-02-14 12:42:38.963 UTC [43] FATAL:  terminating connection due to administrator command
2019-02-14 12:42:38.963 UTC [46] LOG:  terminating TimescaleDB background job "Telemetry Reporter" due to administrator command
2019-02-14 12:42:38.963 UTC [38] LOG:  terminating TimescaleDB background worker launcher due to administrator command
2019-02-14 12:42:38.963 UTC [38] FATAL:  terminating connection due to administrator command
2019-02-14 12:42:38.963 UTC [43] LOG:  terminating TimescaleDB job scheduler due to administrator command
2019-02-14 12:42:38.963 UTC [46] LOG:  terminating TimescaleDB background job "Telemetry Reporter" due to administrator command
2019-02-14 12:42:38.964 UTC [46] FATAL:  terminating connection due to administrator command
2019-02-14 12:42:38.964 UTC [59] FATAL:  terminating autovacuum process due to administrator command
2019-02-14 12:42:38.965 UTC [31] LOG:  background worker "TimescaleDB Background Worker Launcher" (PID 38) exited with exit code 1
2019-02-14 12:42:38.965 UTC [31] LOG:  background worker "logical replication launcher" (PID 39) exited with exit code 1
2019-02-14 12:42:38.965 UTC [31] LOG:  background worker "TimescaleDB Background Worker Scheduler" (PID 43) exited with exit code 1
2019-02-14 12:42:38.965 UTC [31] LOG:  background worker "Telemetry Reporter" (PID 46) exited with exit code 1
2019-02-14 12:42:38.965 UTC [33] LOG:  shutting down
2019-02-14 12:42:39.092 UTC [31] LOG:  database system is shut down
 done
server stopped

PostgreSQL init process complete; ready for start up.

2019-02-14 12:42:39.167 GMT [1] LOG:  invalid value for parameter "shared_buffers": "2147483647GB"
2019-02-14 12:42:39.167 GMT [1] HINT:  Value exceeds integer range.
2019-02-14 12:42:39.167 GMT [1] LOG:  invalid value for parameter "work_mem": "10737418GB"
2019-02-14 12:42:39.167 GMT [1] HINT:  Value exceeds integer range.
2019-02-14 12:42:39.167 GMT [1] LOG:  invalid value for parameter "effective_cache_size": "2147483647GB"
2019-02-14 12:42:39.167 GMT [1] HINT:  Value exceeds integer range.
2019-02-14 12:42:39.168 UTC [1] FATAL:  configuration file "/var/lib/postgresql/data/postgresql.conf" contains errors

Setting POSTGRES_USER breaks container

/usr/local/bin/docker-entrypoint.sh: sourcing /docker-entrypoint-initdb.d/install_timescaledb.sh
FATAL:  role "postgres" does not exist
psql: FATAL:  role "postgres" does not exist

Y U NO USE ${POSTGRES_USER} in the script??? Simple fix.

FATAL: role "postgres" does not exist

Hey there,

I added this to my docker-compose file:

timescaledb0:
  restart: always
  image: timescale/timescaledb
  ports:
    - "127.0.0.1:5432:5432"
  volumes:
    - /opt_docker/data/timescaledb0:/var/lib/postgresql/data
  mem_limit: 32768m
  env_file:
    - ./environment
  environment:
    - POSTGRES_DB=${POSTGRES_DB}
    - POSTGRES_USER=${POSTGRES_USER}
    - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
    - TIMESCALEDB_TELEMETRY=off
  container_name: timescaledb0
  healthcheck:
    test: ["CMD-SHELL", "pg_isready -U postgres"]
    interval: 30s
    timeout: 30s
    retries: 5

and I'm seeing this in the logs:

FATAL:  role "postgres" does not exist

What's the best way to fix this? Thanks!

Question: how can we check if timescale has started

Currently I start the docker container and then test every second until Select 1 returns true.
This does not work when the database is new: e.g. started for the first time - maybe after restoring a backup.

In this case it seems the database is started, shut down and then restarted: at least I suppose so, because I get this error: "the database system is shutting down"

What is the recommended way to check if the timescaledb docker image is ready to accept connections?

Update readme to reflect correct entrypoint

TimescaleDB images propagate entry point from PostgreSQL, which developed over time. However, the instructions in the readme are not up-to-date and don't allow to run a container on an image without modifications.

Setting PG_DATA breaks container

PG_DATA must be set for certain environments like GCE with data on Persistent Disks. However, setting PG_DATA breaks the TimescaleDB cointainer.

CREATE EXTENSION
/usr/local/bin/docker-entrypoint.sh: sourcing /docker-entrypoint-initdb.d/reenable_auth.sh
sed: /var/lib/postgresql/data/pg_hba.conf: No such file or directory 

timescaledb extension not loaded when Kubernetes pod respawned

When pod was moved to a different Kubernetes node (VM). All DB clients started to receive errors:

ERROR    Postgres: could not access file "timescaledb-0.12.0": No such file or directory

I needed to manually connect to a running container and run ALTER EXTENSION timescaledb UPDATE; for each database (as noted in this post).

Am I doing something wrong?

  • Timescaledb was installed with official postgres helm chart and with pg10 image

Thanks,
Meir Tseitlin

Running Timescale in Kubernetes: Pod recreate results in data loss

Reference: https://stackoverflow.com/questions/57140161/kubernetes-timescaledb-statefulset-changes-lost-on-pod-recreation

I use Kubernetes statefulset to run Timescale. I use Postgres 9.6. When the pod is recreated, it appears to lose DB(s) and underlying tables. The /var/lib/postgresql is backed by a persistent volume in Kubernetes.

  1. The three entry point files if they are run more than once, will it result in recreation of folder /var/lib/postgresql/data? https://github.com/timescale/timescaledb-docker/tree/master/docker-entrypoint-initdb.d
  2. How does Timescale know that it has already initialised so that it would not reinitialise databases?
  3. Or is there something in Postgres base Docker image that causes to reinitialise its data dir?

By reinitialise, I mean it only has DBs (postgres, template0 and template1).

I have raised the question in StackOverflow. Currently the suspicion is TimeScale is reinitialising. Any pointers are appreciated.

Latest update killed my postgres

Hello there. After the update to the latest docker image (3 hours ago) my postgres is not working anymore. I'm using the 'timescale/timescaledb-postgis:latest-pg11' tag. You updated the postgis version from 2.5 to 3.0, without providing an update path. So every statement to a table with the enabled postgis extension fails with

ERROR:  could not access file "$libdir/postgis-2.5": No such file or directory

because the 2.5 is not installed anymore and the updater does not work.

PostGIS - could not find libproj

Hi all,

I am trying to build a Docker image of TimescaleDB with PostGIS extension. I've pulled down the project at master branch and cd into postgis directory, then called make. It was able to install dependencies, download PostGIS source code, but it has stopped at configure command where it said

configure:  error: could not find libproj - you may need to specify the directory of a PROJ.4 installation using --with-projdir

I also see an error message previous the libproj error but I don't know if it's relevant to the error that I'm having

checking for shared library run path origin... /bin/sh: can't open 'build-aux/config.rpath': No such file or directory
done

I have verified that proj and proj-dev are installed in the image prior running configure script. I have no idea where exactly proj files are installed in. Should I try look for them then use --with-projdir command?

PgTune is hidden ๐Ÿ‰, no way to control it

Today our CI pulled new timescaledb docker image because we were missing version constraint in our docker-compose file. Builds started failing because of this pgtune https://github.com/timescale/timescaledb-docker/blob/master/docker-entrypoint-initdb.d/002_timescaledb_tune.sh Timescale container wouldn't start, with OOM error as as reson of failure. Our CI machine is pretty strong but it probably refused to give resources timescaledb container wanted.

IMO having such script there by default is not a good idea, maybe adding env var that enables it could solve it?

We downgraded the image to 1.1.0-pg10 that doesn't contain pgtune.

Using docker timescale/timescaledb image, 'CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;' fails as it is not preloaded

Seems prebuilt images are misconfigured, trying to create the timescaledb extension fails because the premade docker images do not have the library preloaded in their config.

Error: FATAL: extension "timescaledb" must be preloaded
  Hint: Please preload the timescaledb library via shared_preload_libraries.

This can be done by editing the config file at: /var/lib/postgresql/data/pgdata/postgresql.conf
and adding 'timescaledb' to the list in the shared_preload_libraries config.
	# Modify postgresql.conf:
	shared_preload_libraries = 'timescaledb'

Another way to do this, if not preloading other libraries, is with the command:
	echo "shared_preload_libraries = 'timescaledb'" >> /var/lib/postgresql/data/pgdata/postgresql.conf 

(Will require a database restart.)

If you REALLY know what you are doing and would like to load the library without preloading, you can disable this check with: 
	SET timescaledb.allow_install_without_preload = 'on';
SQLState:  XX000
ErrorCode: 0
Error: An I/O error occurred while sending to the backend.
SQLState:  08006
ErrorCode: 0

timescale/timescaledb:1.6.1-pg11-oss still seems to use timescaledb extension 1.6.0

Hi,

looking through my logs I found this:

[email protected]:~# docker ps
CONTAINER ID        IMAGE                                  COMMAND                  CREATED             STATUS              PORTS                         NAMES
183cd78f21ff        dpage/pgadmin4                         "/entrypoint.sh"         15 hours ago        Up 15 hours         0.0.0.0:80->80/tcp, 443/tcp   pgadmin4
44c753102f53        timescale/timescaledb:1.6.1-pg11-oss   "docker-entrypoint.sโ€ฆ"   15 hours ago        Up 15 hours                                       timescaledb
[email protected]:~# docker logs --tail 4 timescaledb
2020-03-26 07:31:35.384 UTC [539] WARNING:  there is no transaction in progress
2020-03-26 09:29:02.833 UTC [14151] WARNING:  there is no transaction in progress
2020-03-26 13:27:44.000 UTC [12013] LOG:  the "timescaledb" extension is not up-to-date
2020-03-26 13:27:44.000 UTC [12013] HINT:  The most up-to-date version is 1.6.1, the installed version is 1.6.0
[email protected]:~#

Can you verify the version of the extension in the container?

Thanks and stay at home!

Timescale extension not available when using docker bitnami image

I started the image with

docker run -d -p 5433:5432 --name timescale --restart always -v $VOL_BASE/data:/bitnami -e POSTGRES_PASSWORD=xxxxx timescale/timescaledb:1.2.2-pg11-bitnami

and it came up with

ash-4.3# docker logs timescale

Welcome to the Bitnami postgresql container
Subscribe to project updates by watching https://github.com/bitnami/bitnami-docker-postgresql
Submit issues and feature requests at https://github.com/bitnami/bitnami-docker-postgresql/issues

nami    INFO  Initializing postgresql
postgre INFO  ==> No injected postgresql.conf file found. Creating default postgresql.conf file...
postgre INFO  ==> No injected pg_hba.conf file found. Creating default pg_hba.conf file...
postgre INFO  ==> Deploying PostgreSQL from scratch...
postgre INFO  ==> Creating postgres user with unrestricted access...
postgre INFO  ==> Configuring PostgreSQL...
postgre INFO  ==> Configuring replication parameters...
postgre INFO  ==> Configuring permissions for config files...
postgre INFO
postgre INFO  ########################################################################
postgre INFO   Installation parameters for postgresql:
postgre INFO     Root User: postgres
postgre INFO     Password: **********
postgre INFO   (Passwords are not shown for security reasons)
postgre INFO  ########################################################################
postgre INFO
nami    INFO  postgresql successfully initialized
INFO  ==> Starting postgresql...
INFO  ==> Loading user files from /docker-entrypoint-initdb.d
INFO  ==> Initialization: Waiting for PostgreSQL to be available
/run.sh: line 21: debug: command not found
Sourcing /docker-entrypoint-initdb.d/000_install_timescaledb.sh
FATAL:  extension "timescaledb" must be preloaded
HINT:  Please preload the timescaledb library via shared_preload_libraries.

This can be done by editing the config file at: /opt/bitnami/postgresql/conf/postgresql.conf
and adding 'timescaledb' to the list in the shared_preload_libraries config.
        # Modify postgresql.conf:
        shared_preload_libraries = 'timescaledb'

Another way to do this, if not preloading other libraries, is with the command:
        echo "shared_preload_libraries = 'timescaledb'" >> /opt/bitnami/postgresql/conf/postgresql.conf

(Will require a database restart.)

If you REALLY know what you are doing and would like to load the library without preloading, you can disable this check with:
        SET timescaledb.allow_install_without_preload = 'on';
server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
connection to server was lost
FATAL:  extension "timescaledb" must be preloaded
HINT:  Please preload the timescaledb library via shared_preload_libraries.

This can be done by editing the config file at: /opt/bitnami/postgresql/conf/postgresql.conf
and adding 'timescaledb' to the list in the shared_preload_libraries config.
        # Modify postgresql.conf:
        shared_preload_libraries = 'timescaledb'

Another way to do this, if not preloading other libraries, is with the command:
        echo "shared_preload_libraries = 'timescaledb'" >> /opt/bitnami/postgresql/conf/postgresql.conf

(Will require a database restart.)

If you REALLY know what you are doing and would like to load the library without preloading, you can disable this check with:
        SET timescaledb.allow_install_without_preload = 'on';
server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
connection to server was lost
FATAL:  extension "timescaledb" must be preloaded
HINT:  Please preload the timescaledb library via shared_preload_libraries.

This can be done by editing the config file at: /opt/bitnami/postgresql/conf/postgresql.conf
and adding 'timescaledb' to the list in the shared_preload_libraries config.
        # Modify postgresql.conf:
        shared_preload_libraries = 'timescaledb'

Another way to do this, if not preloading other libraries, is with the command:
        echo "shared_preload_libraries = 'timescaledb'" >> /opt/bitnami/postgresql/conf/postgresql.conf

(Will require a database restart.)

If you REALLY know what you are doing and would like to load the library without preloading, you can disable this check with:
        SET timescaledb.allow_install_without_preload = 'on';
server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
connection to server was lost
Sourcing /docker-entrypoint-initdb.d/001_reenable_auth.sh
sed: can't read /bitnami/postgresql/pg_hba.conf: No such file or directory
Executing /docker-entrypoint-initdb.d/002_timescaledb_tune.sh
Using postgresql.conf at this path:
/bitnami/postgresql/postgresql.conf

Writing backup to:
/tmp/timescaledb_tune.backup201903312106

Recommendations based on 7.72 GB of available memory and 2 CPUs for PostgreSQL 11
shared_preload_libraries = 'timescaledb'
shared_buffers = 1975MB
effective_cache_size = 5927MB
maintenance_work_mem = 1011679kB
work_mem = 20233kB
timescaledb.max_background_workers = 4
max_worker_processes = 9
max_parallel_workers_per_gather = 1
max_parallel_workers = 2
wal_buffers = 16MB
min_wal_size = 4GB
max_wal_size = 8GB
default_statistics_target = 500
random_page_cost = 1.1
checkpoint_completion_target = 0.9
max_connections = 50
max_locks_per_transaction = 64
effective_io_concurrency = 200
timescaledb.last_tuned = '2019-03-31T21:06:04Z'
timescaledb.last_tuned_version = '0.5.0'
Saving changes to: /bitnami/postgresql/postgresql.conf
2019-03-31 21:06:07.509 GMT [139] LOG:  received fast shutdown request
2019-03-31 21:06:07.612 GMT [139] LOG:  aborting any active transactions
2019-03-31 21:06:07.615 GMT [139] LOG:  background worker "logical replication launcher" (PID 147) exited with exit code 1
2019-03-31 21:06:07.615 GMT [142] LOG:  shutting down
2019-03-31 21:06:15.166 GMT [139] LOG:  database system is shut down
2019-03-31 21:06:18.210 GMT [211] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2019-03-31 21:06:18.210 GMT [211] LOG:  listening on IPv6 address "::", port 5432
2019-03-31 21:06:18.312 GMT [211] LOG:  listening on Unix socket "/tmp/.s.PGSQL.5432"
2019-03-31 21:06:18.473 GMT [213] LOG:  database system was shut down at 2019-03-31 21:06:15 GMT
2019-03-31 21:06:18.545 GMT [211] LOG:  database system is ready to accept connections

BUT the extension was not loaded?!
Seems to work with non-bitnami image

psql (9.3.22, server 11.1)
WARNING: psql major version 9.3, server major version 11.
         Some psql features might not work.
Type "help" for help.

postgres=# \dx timescaledb
     List of installed extensions
 Name | Version | Schema | Description
------+---------+--------+-------------
(0 rows)

timescale container with volume not starting

OSX 10.14.4
Docker for Mac 2.0.0.3

Tried multiple different Timescale versions but getting same problems.

docker run -d --name cobalt-timescaledb -p 5432:5432 -e POSTGRES_PASSWORD=password timescale/timescaledb:1.2.2-pg10 -v timescalecobalt:/var/lib/postgresql/data

docker logs 49aa92b523c3

The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.utf8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /var/lib/postgresql/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting dynamic shared memory implementation ... posix
creating configuration files ... ok
running bootstrap script ... ok
sh: locale: not found
2019-05-20 23:55:40.107 UTC [27] WARNING:  no usable system locales were found
performing post-bootstrap initialization ... ok
syncing data to disk ... ok

Success. You can now start the database server using:

    pg_ctl -D /var/lib/postgresql/data -l logfile start


WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.
waiting for server to start....2019-05-20 23:55:40.666 UTC [31] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2019-05-20 23:55:40.678 UTC [32] LOG:  database system was shut down at 2019-05-20 23:55:40 UTC
2019-05-20 23:55:40.681 UTC [31] LOG:  database system is ready to accept connections
2019-05-20 23:55:40.681 UTC [38] LOG:  TimescaleDB background worker launcher connected to shared catalogs
 done
server started

/usr/local/bin/docker-entrypoint.sh: sourcing /docker-entrypoint-initdb.d/000_install_timescaledb.sh
2019-05-20 23:55:40.864 UTC [42] WARNING:
	WELCOME TO
	 _____ _                               _     ____________
	|_   _(_)                             | |    |  _  \ ___ \
	  | |  _ _ __ ___   ___  ___  ___ __ _| | ___| | | | |_/ /
	  | | | |  _ ` _ \ / _ \/ __|/ __/ _` | |/ _ \ | | | ___ \
	  | | | | | | | | |  __/\__ \ (_| (_| | |  __/ |/ /| |_/ /
	  |_| |_|_| |_| |_|\___||___/\___\__,_|_|\___|___/ \____/
	               Running version 1.2.2
	For more information on TimescaleDB, please visit the following links:

	 1. Getting started: https://docs.timescale.com/getting-started
	 2. API reference documentation: https://docs.timescale.com/api
	 3. How TimescaleDB is designed: https://docs.timescale.com/introduction/architecture

	Note: TimescaleDB collects anonymous reports to better understand and assist our users.
	For more information and how to disable, please see our docs https://docs.timescaledb.com/using-timescaledb/telemetry.

2019-05-20 23:55:40.864 UTC [42] CONTEXT:  PL/pgSQL function inline_code_block line 15 at RAISE
WARNING:
WELCOME TO
 _____ _                               _     ____________
|_   _(_)                             | |    |  _  \ ___ \
  | |  _ _ __ ___   ___  ___  ___ __ _| | ___| | | | |_/ /
  | | | |  _ ` _ \ / _ \/ __|/ __/ _` | |/ _ \ | | | ___ \
  | | | | | | | | |  __/\__ \ (_| (_| | |  __/ |/ /| |_/ /
  |_| |_|_| |_| |_|\___||___/\___\__,_|_|\___|___/ \____/
               Running version 1.2.2
For more information on TimescaleDB, please visit the following links:

 1. Getting started: https://docs.timescale.com/getting-started
 2. API reference documentation: https://docs.timescale.com/api
 3. How TimescaleDB is designed: https://docs.timescale.com/introduction/architecture

Note: TimescaleDB collects anonymous reports to better understand and assist our users.
For more information and how to disable, please see our docs https://docs.timescaledb.com/using-timescaledb/telemetry.

CREATE EXTENSION
WARNING:
WELCOME TO
 _____ _                               _     ____________
|_   _(_)                             | |    |  _  \ ___ \
  | |  _ _ __ ___   ___  ___  ___ __ _| | ___| | | | |_/ /
  | | | |  _ ` _ \ / _ \/ __|/ __/ _` | |/ _ \ | | | ___ \
  | | | | | | | | |  __/\__ \ (_| (_| | |  __/ |/ /| |_/ /
  |_| |_|_| |_| |_|\___||___/\___\__,_|_|\___|___/ \____/
               Running version 1.2.2
For more information on TimescaleDB, please visit the following links:

 1. Getting started: https://docs.timescale.com/getting-started
 2. API reference documentation: https://docs.timescale.com/api
 3. How TimescaleDB is designed: https://docs.timescale.com/introduction/architecture

Note: TimescaleDB collects anonymous reports to better understand and assist our users.
For more information and how to disable, please see our docs https://docs.timescaledb.com/using-timescaledb/telemetry.

2019-05-20 23:55:40.954 UTC [45] WARNING:
	WELCOME TO
	 _____ _                               _     ____________
	|_   _(_)                             | |    |  _  \ ___ \
	  | |  _ _ __ ___   ___  ___  ___ __ _| | ___| | | | |_/ /
	  | | | |  _ ` _ \ / _ \/ __|/ __/ _` | |/ _ \ | | | ___ \
	  | | | | | | | | |  __/\__ \ (_| (_| | |  __/ |/ /| |_/ /
	  |_| |_|_| |_| |_|\___||___/\___\__,_|_|\___|___/ \____/
	               Running version 1.2.2
	For more information on TimescaleDB, please visit the following links:

	 1. Getting started: https://docs.timescale.com/getting-started
	 2. API reference documentation: https://docs.timescale.com/api
	 3. How TimescaleDB is designed: https://docs.timescale.com/introduction/architecture

	Note: TimescaleDB collects anonymous reports to better understand and assist our users.
	For more information and how to disable, please see our docs https://docs.timescaledb.com/using-timescaledb/telemetry.

2019-05-20 23:55:40.954 UTC [45] CONTEXT:  PL/pgSQL function inline_code_block line 15 at RAISE
2019-05-20 23:55:40.957 UTC [47] ERROR:  TimescaleDB background worker connected to template database, exiting
CREATE EXTENSION

/usr/local/bin/docker-entrypoint.sh: sourcing /docker-entrypoint-initdb.d/001_reenable_auth.sh
2019-05-20 23:55:40.958 UTC [31] LOG:  worker process: TimescaleDB Background Worker Scheduler (PID 47) exited with exit code 1

/usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/002_timescaledb_tune.sh
Using postgresql.conf at this path:
/var/lib/postgresql/data/postgresql.conf

Writing backup to:
/tmp/timescaledb_tune.backup201905202355

Recommendations based on 1.95 GB of available memory and 4 CPUs for PostgreSQL 10
shared_buffers = 511687kB
effective_cache_size = 1499MB
maintenance_work_mem = 255843kB
work_mem = 2558kB
timescaledb.max_background_workers = 4
max_worker_processes = 11
max_parallel_workers_per_gather = 2
max_parallel_workers = 4
wal_buffers = 15349kB
min_wal_size = 4GB
max_wal_size = 8GB
default_statistics_target = 500
random_page_cost = 1.1
checkpoint_completion_target = 0.9
max_connections = 50
max_locks_per_transaction = 64
effective_io_concurrency = 200
timescaledb.last_tuned = '2019-05-20T23:55:40Z'
timescaledb.last_tuned_version = '0.5.0'
Saving changes to: /var/lib/postgresql/data/postgresql.conf

waiting for server to shut down....2019-05-20 23:55:40.979 UTC [31] LOG:  received fast shutdown request
2019-05-20 23:55:40.980 UTC [31] LOG:  aborting any active transactions
2019-05-20 23:55:40.980 UTC [43] LOG:  terminating TimescaleDB job scheduler due to administrator command
2019-05-20 23:55:40.980 UTC [43] FATAL:  terminating connection due to administrator command
2019-05-20 23:55:40.981 UTC [38] LOG:  terminating TimescaleDB background worker launcher due to administrator command
2019-05-20 23:55:40.981 UTC [38] FATAL:  terminating connection due to administrator command
2019-05-20 23:55:40.981 UTC [46] LOG:  terminating TimescaleDB background job "Telemetry Reporter" due to administrator command
2019-05-20 23:55:40.981 UTC [31] LOG:  worker process: TimescaleDB Background Worker Launcher (PID 38) exited with exit code 1
2019-05-20 23:55:40.981 UTC [46] WARNING:  telemetry could not connect to "telemetry.timescale.com"
2019-05-20 23:55:40.981 UTC [46] DETAIL:  Interrupted system call
2019-05-20 23:55:40.981 UTC [31] LOG:  worker process: logical replication launcher (PID 39) exited with exit code 1
2019-05-20 23:55:40.981 UTC [31] LOG:  worker process: TimescaleDB Background Worker Scheduler (PID 43) exited with exit code 1
2019-05-20 23:55:40.981 UTC [46] FATAL:  terminating connection due to administrator command
2019-05-20 23:55:40.982 UTC [46] LOG:  terminating TimescaleDB background job "Telemetry Reporter" due to administrator command
2019-05-20 23:55:40.982 UTC [31] LOG:  worker process: Telemetry Reporter (PID 46) exited with exit code 1
2019-05-20 23:55:40.983 UTC [33] LOG:  shutting down
2019-05-20 23:55:41.055 UTC [31] LOG:  database system is shut down
 done
server stopped

PostgreSQL init process complete; ready for start up.

postgres: unrecognized option: v
Try "postgres --help" for more information.
postgres: unrecognized option: v
Try "postgres --help" for more information.

Is something incorrect with my system? Do I need something from Homebrew? Unclear of what is going on.

Upgrading to new release

I have a container built from timescale/timescaledb:0.9.2-pg10 with a host-mounted volume.
In order to update to 0.10.0, can I just switch the base image to timescale/timescaledb:0.10.0-pg10 and recreate the container?

Thanks in advance

Cannot install timescaledb extension if `POSTGRES_USER` is specified on Bitnami image.

To reproduce:

 docker run --rm -p 5432:5432 \
    --env POSTGRESQL_USERNAME=test \
    --env POSTGRESQL_PASSWORD=test \
    timescale/timescaledb:1.5.0-pg11-bitnami
postgresql 12:59:06.64 INFO  ==> Starting PostgreSQL in background...
ERROR:  permission denied to create extension "timescaledb"
HINT:  Must be superuser to create this extension.
postgresql 12:59:06.65 INFO  ==> Stopping PostgreSQL...

The POSTGRESQL_USERNAME is used to install TimescaleDB here:
https://github.com/timescale/timescaledb-docker/blob/master/docker-entrypoint-initdb.d/000_install_timescaledb.sh#L30

But this user is a restricted user:

create a restricted database user that only has permissions for the database created with the POSTGRESQL_DATABASE environment variable

https://github.com/bitnami/bitnami-docker-postgresql#creating-a-database-user-on-first-run

Question: How can I run TimeScaleDB on Docker on an ARM architecture with volumes?

Hi, I have a short question:

How can I run TimeScale on Docker on a ARM architecture with the Postgres/TimescaleDB data volumes exposed to the host?

My idea was to do the following:

docker run -d --restart always \
--name timescaledb \
-p 5432:5432 \
-e POSTGRES_PASSWORD=password \
-e POSTGRES_USER=user \
-e POSTGRES_DB=databasename \
-v /etc/postgresql:$PWD/postgres/etc \
-v /var/log/postgresql:$PWD/postgres/log \
-v /var/lib/postgresql:$PWD/postgres/lib \
timescale/timescaledb

However, TimescaleDB seems to be stuck in the start/ restart process:

grafik

Do you have any suggestions / ideas what I'm doing wrong?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.