postgresqldbeavertimescaledbpostgresql-13

Timescale DB Create distributed hypertable


I want to create a PoC of a distributed hypertable, using TimescaleDB and docker compose.

I've set up a docker compose with two instances and created the respective table in both instances.

Let's say instance A is the access node (main node) Before executing the query SELECT create_distributed_hypertable('sensor_data', 'time', 'sensor_id');, I added the other data node successfully by running: SELECT add_data_node('australia-node', host => 'au-db', password => 'XXXXX', database => 'XXXXX');

Also, by querying SELECT * FROM timescaledb_information.data_nodes;, the australia-node is the only entry in this view, meaning that it is recgonized by the access node

When I try to run SELECT create_distributed_hypertable('sensor_data', 'time', 'sensor_id');, I receive the folllowing error:

SQL Error [08001]: ERROR: could not connect to "australia-node" Detail: fe_sendauth: no password supplied

Note: I execute all the queries, using DBeaver SQL editor


Solution

  • Once your instances are up and running, you need to configure authentication so that data nodes accept connections from access node. This is what we refer as Multi-node authentication.

    Since it is a PoC, go for Trust authentication which trusts all incoming connections and then create distributed hypertable

    Reference: https://docs.timescale.com/self-hosted/latest/multinode-timescaledb/multinode-auth/