Set up multi-node on self-hosted TimescaleDB
To set up multi-node on a self-hosted TimescaleDB instance, you need:
- A PostgreSQL instance to act as an access node (AN)
- One or more PostgreSQL instances to act as data nodes (DN)
- TimescaleDB installed and set up on all nodes
- Access to a superuser role, such as
postgres, on all nodes
The access and data nodes must begin as individual TimescaleDB instances. They should be hosts with a running PostgreSQL server and a loaded TimescaleDB extension. For more information about installing self-hosted TimescaleDB instances, see the installation instructions.
The multi-node TimescaleDB architecture consists of an access node (AN) which stores metadata for the distributed hypertable and performs query planning across the cluster, and a set of data nodes (DNs) which store subsets of the distributed hypertable dataset and execute queries locally. For more information about the multi-node architecture, see about multi-node.
If you intend to use continuous aggregates in your multi-node environment, check the additional considerations in the continuous aggregates section.
When you have installed TimescaleDB on the access node and as many data nodes as you require, you can set up multi-node and create a distributed hypertable.
Setting up multi-node on self-hosted TimescaleDB
- On the access node (AN), run this command and provide the hostname of the
first data node (DN1) you want to add:
SELECT add_data_node('dn1', 'dn1.example.com')
- Repeat for all other data nodes:
SELECT add_data_node('dn2', 'dn2.example.com') SELECT add_data_node('dn3', 'dn3.example.com')
- On the access node, create the distributed hypertable with your chosen
partitioning. In this example, the distributed hypertable is called
example, and it is partitioned on
SELECT create_distributed_hypertable('example', 'time', 'location');
- Insert some data into the hypertable. For example:
INSERT INTO example VALUES ('2020-12-14 13:45', 1, '22.214.171.124');
When you have set up your multi-node installation, you can configure your cluster. For more information, see the configuration section.
Found an issue on this page?Report an issue!