Tried to install tobs on k8s. Followed the basic steps:
curl --proto '=https' --tlsv1.2 -sSLf https://tsdb.co/install-tobs-sh |sh
tobs helm show-values > values.yaml
And then changed the storage class to match storage class I have in the cluster.
Then installed:
tobs install -f values.yaml
Helm installation finished.
However the tobs-timescaledb-0 pod keeps crushing for :
2021-02-13 18:48:09.610 GMT [80] LOG: skipping missing configuration file "/var/run/postgresql/timescaledb.conf"
2021-02-13 18:48:09.611 GMT [80] LOG: skipping missing configuration file "/var/run/postgresql/timescaledb.conf"
2021-02-13 18:48:09.611 GMT [80] LOG: skipping missing configuration file "/var/lib/postgresql/data/postgresql.auto.conf"
2021-02-13 18:48:09.611 GMT [80] FATAL: "/var/lib/postgresql/data" is not a valid data directory
2021-02-13 18:48:09.611 GMT [80] DETAIL: File "/var/lib/postgresql/data/PG_VERSION" is missing.
running bootstrap script ... /var/run/postgresql:5432 - no response
Process Process-1:
Traceback (most recent call last):
File "/usr/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
self.run()
File "/usr/lib/python3.7/multiprocessing/process.py", line 99, in run
self._target(*self._args, **self._kwargs)
File "/usr/lib/python3/dist-packages/patroni/__init__.py", line 138, in patroni_main
abstract_main(Patroni, schema)
File "/usr/lib/python3/dist-packages/patroni/daemon.py", line 100, in abstract_main
controller.run()
File "/usr/lib/python3/dist-packages/patroni/__init__.py", line 108, in run
super(Patroni, self).run()
File "/usr/lib/python3/dist-packages/patroni/daemon.py", line 59, in run
self._run_cycle()
File "/usr/lib/python3/dist-packages/patroni/__init__.py", line 111, in _run_cycle
logger.info(self.ha.run_cycle())
File "/usr/lib/python3/dist-packages/patroni/ha.py", line 1452, in run_cycle
info = self._run_cycle()
File "/usr/lib/python3/dist-packages/patroni/ha.py", line 1346, in _run_cycle
return self.post_bootstrap()
File "/usr/lib/python3/dist-packages/patroni/ha.py", line 1242, in post_bootstrap
self.cancel_initialization()
File "/usr/lib/python3/dist-packages/patroni/ha.py", line 1235, in cancel_initialization
raise PatroniFatalException('Failed to bootstrap cluster')
patroni.exceptions.PatroniFatalException: 'Failed to bootstrap cluster'
I had later tried to install only timescaledb-single from the chart, and got the same failure.
I had modified the sts to sleep before running the init script on patroni, and I see directory /var/lib/postgresql/data is created by the pod command and exist.
However, indeed PG_VERSION does not exist there, not sure who shoold create it and when.
2021-02-13 18:47:56 - restore_or_initdb - Invoking initdb
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 text search configuration will be set to "english".
Data page checksums are disabled.
fixing permissions on existing directory /var/lib/postgresql/data ... ok
fixing permissions on existing directory /var/lib/postgresql/wal/pg_wal ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 20
selecting default shared_buffers ... 400kB
selecting default time zone ... Etc/UTC
creating configuration files ... ok
Bus error (core dumped)
child process exited with exit code 135
initdb: removing contents of data directory "/var/lib/postgresql/data"
initdb: removing contents of WAL directory "/var/lib/postgresql/wal/pg_wal"
2021-02-13 18:48:09,364 WARNING: max_connections setting is missing from pg_controldata output
2021-02-13 18:48:09,364 WARNING: max_prepared_xacts setting is missing from pg_controldata output
2021-02-13 18:48:09,364 WARNING: max_locks_per_xact setting is missing from pg_controldata output
2021-02-13 18:48:09,365 WARNING: Removing unexpected parameter=archive_command value=/etc/timescaledb/scripts/pgbackrest_archive.sh %p from the config
2021-02-13 18:48:09,365 WARNING: Removing unexpected parameter=archive_mode value=on from the config
2021-02-13 18:48:09,365 WARNING: Removing unexpected parameter=archive_timeout value=1800s from the config
2021-02-13 18:48:09,365 WARNING: Removing unexpected parameter=autovacuum_analyze_scale_factor value=0.02 from the config
2021-02-13 18:48:09,365 WARNING: Removing unexpected parameter=autovacuum_max_workers value=10 from the config
2021-02-13 18:48:09,365 WARNING: Removing unexpected parameter=autovacuum_vacuum_scale_factor value=0.05 from the config
2021-02-13 18:48:09,365 WARNING: Removing unexpected parameter=cluster_name value=tobs from the config
2021-02-13 18:48:09,365 WARNING: Removing unexpected parameter=hot_standby value=on from the config
2021-02-13 18:48:09,365 WARNING: Removing unexpected parameter=listen_addresses value=0.0.0.0 from the config
2021-02-13 18:48:09,365 WARNING: Removing unexpected parameter=log_autovacuum_min_duration value=0 from the config
2021-02-13 18:48:09,365 WARNING: Removing unexpected parameter=log_checkpoints value=on from the config
2021-02-13 18:48:09,365 WARNING: Removing unexpected parameter=log_connections value=on from the config
2021-02-13 18:48:09,365 WARNING: Removing unexpected parameter=log_disconnections value=on from the config
2021-02-13 18:48:09,365 WARNING: Removing unexpected parameter=log_line_prefix value=%t [%p]: [%c-%l] %u@%d,app=%a [%e] from the config
2021-02-13 18:48:09,365 WARNING: Removing unexpected parameter=log_lock_waits value=on from the config
2021-02-13 18:48:09,365 WARNING: Removing unexpected parameter=log_min_duration_statement value=1s from the config
2021-02-13 18:48:09,365 WARNING: Removing unexpected parameter=log_statement value=ddl from the config
2021-02-13 18:48:09,365 WARNING: Removing unexpected parameter=max_connections value=100 from the config
2021-02-13 18:48:09,365 WARNING: Removing unexpected parameter=max_locks_per_transaction value=64 from the config
2021-02-13 18:48:09,365 WARNING: Removing unexpected parameter=max_prepared_transactions value=150 from the config
2021-02-13 18:48:09,365 WARNING: Removing unexpected parameter=max_replication_slots value=10 from the config
2021-02-13 18:48:09,365 WARNING: Removing unexpected parameter=max_wal_senders value=10 from the config
2021-02-13 18:48:09,365 WARNING: Removing unexpected parameter=max_worker_processes value=8 from the config
2021-02-13 18:48:09,366 WARNING: Removing unexpected parameter=port value=5432 from the config
2021-02-13 18:48:09,366 WARNING: Removing unexpected parameter=shared_preload_libraries value=timescaledb,pg_stat_statements from the config
2021-02-13 18:48:09,366 WARNING: Removing unexpected parameter=ssl value=on from the config
2021-02-13 18:48:09,366 WARNING: Removing unexpected parameter=ssl_cert_file value=/etc/certificate/tls.crt from the config
2021-02-13 18:48:09,366 WARNING: Removing unexpected parameter=ssl_key_file value=/etc/certificate/tls.key from the config
2021-02-13 18:48:09,366 WARNING: Removing unexpected parameter=tcp_keepalives_idle value=900 from the config
2021-02-13 18:48:09,366 WARNING: Removing unexpected parameter=tcp_keepalives_interval value=100 from the config
2021-02-13 18:48:09,366 WARNING: Removing unexpected parameter=temp_file_limit value=1GB from the config
2021-02-13 18:48:09,366 WARNING: Removing unexpected parameter=track_commit_timestamp value=off from the config
2021-02-13 18:48:09,366 WARNING: Removing unexpected parameter=unix_socket_directories value=/var/run/postgresql from the config
2021-02-13 18:48:09,366 WARNING: Removing unexpected parameter=unix_socket_permissions value=0750 from the config
2021-02-13 18:48:09,366 WARNING: Removing unexpected parameter=wal_level value=hot_standby from the config
2021-02-13 18:48:09,366 WARNING: Removing unexpected parameter=wal_log_hints value=on from the config
2021-02-13 18:48:09.610 GMT [80] LOG: skipping missing configuration file "/var/run/postgresql/timescaledb.conf"
2021-02-13 18:48:09.611 GMT [80] LOG: skipping missing configuration file "/var/run/postgresql/timescaledb.conf"
2021-02-13 18:48:09.611 GMT [80] LOG: skipping missing configuration file "/var/lib/postgresql/data/postgresql.auto.conf"
2021-02-13 18:48:09.611 GMT [80] FATAL: "/var/lib/postgresql/data" is not a valid data directory
2021-02-13 18:48:09.611 GMT [80] DETAIL: File "/var/lib/postgresql/data/PG_VERSION" is missing.
running bootstrap script ... /var/run/postgresql:5432 - no response
Process Process-1:
Traceback (most recent call last):
File "/usr/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
self.run()
File "/usr/lib/python3.7/multiprocessing/process.py", line 99, in run
self._target(*self._args, **self._kwargs)
File "/usr/lib/python3/dist-packages/patroni/__init__.py", line 138, in patroni_main
abstract_main(Patroni, schema)
File "/usr/lib/python3/dist-packages/patroni/daemon.py", line 100, in abstract_main
controller.run()
File "/usr/lib/python3/dist-packages/patroni/__init__.py", line 108, in run
super(Patroni, self).run()
File "/usr/lib/python3/dist-packages/patroni/daemon.py", line 59, in run
self._run_cycle()
File "/usr/lib/python3/dist-packages/patroni/__init__.py", line 111, in _run_cycle
logger.info(self.ha.run_cycle())
File "/usr/lib/python3/dist-packages/patroni/ha.py", line 1452, in run_cycle
info = self._run_cycle()
File "/usr/lib/python3/dist-packages/patroni/ha.py", line 1346, in _run_cycle
return self.post_bootstrap()
File "/usr/lib/python3/dist-packages/patroni/ha.py", line 1242, in post_bootstrap
self.cancel_initialization()
File "/usr/lib/python3/dist-packages/patroni/ha.py", line 1235, in cancel_initialization
raise PatroniFatalException('Failed to bootstrap cluster')
patroni.exceptions.PatroniFatalException: 'Failed to bootstrap cluster'