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

timescaledb:2.8.1-pg14 The data is not stored at /home/postgres/pgdata/data #196

Open
lionants02 opened this issue Nov 3, 2022 · 3 comments
Assignees

Comments

@lionants02
Copy link

lionants02 commented Nov 3, 2022

I lost my data. Fortunately, there is no key information.
timescale/timescaledb:2.8.1-pg14
The data is not stored at /home/postgres/pgdata/data
But data is kept at /var/lib/postgresql/data

Might have to check again. But it's definitely not at /home/postgres/pgdata/data

My compose

version: "3.4"

services:
  homeward_timescale:
    image: "timescale/timescaledb:2.8.1-pg14"
    restart: always
    ports:
      - 10335:5432 
    volumes:
      - "/data/a_med_care/timescale:/home/postgres/pgdata/data:rw" #Data lost change to /var/lib/postgresql/data
    environment:
      POSTGRES_PASSWORD: OjpvYE2hBaBYdf79SR5CygAH8O683hxxxdymmypass
      TS_TUNE_MEMORY: 2GB
      TS_TUNE_NUM_CPUS: 4
      TS_TUNE_MAX_CONNS: 150
    healthcheck:
      test: ["CMD", "pg_isready", "-U", "postgres"]
      interval: 1m30s
      timeout: 10s
      retries: 3
      start_period: 60s
    deploy:
      resources:
        limits:
          cpus: '4'
          memory: 2100M

Good luck.

@svenklemm
Copy link
Member

Why did you think data was stored in /home/postgresql? Is this documented somewhere?

@lionants02
Copy link
Author

There is an explanation on this reference page.
https://docs.timescale.com/install/latest/installation-docker/
image

Why did you think data was stored in /home/postgresql? Is this documented somewhere?

@Slyke
Copy link

Slyke commented Mar 3, 2024

This happened to me too. I changed from an older version of timescaledb to timescaledb-ha:pg16-all and noticed all my data has now vanished.

I found in the logs the data dir is different than what I had set:

using nss-wrapper
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 "C.UTF-8".
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 /home/postgres/pgdata/data ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... Etc/UTC
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok


Success. You can now start the database server using:

    pg_ctl -D /home/postgres/pgdata/data -l logfile start

initdb: warning: enabling "trust" authentication for local connections

This is not obvious, as there are no volume examples on the main readme.md, nor does it mention that it's using a different directory to store data. But it does mention:

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.

Which threw me off the path for a while.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants