User Tools

Site Tools


citus

Differences

This shows you the differences between two versions of the page.


citus [2021/05/25 12:35] (current) – created - external edit 127.0.0.1
Line 1: Line 1:
 +Coordinator node may be replicated using STREAMING REPLICATION
  
 +====== Start replication ======
 +Set replication factor before start
 +<code>SET citus.shard_replication_factor = 2;
 +SET citus.shard_count = 2;</code>
 +Set shard distributed table
 +<code>SELECT create_distributed_table('tablename', 'id');
 +SELECT truncate_local_data_after_distributing_table($$public.tablename$$);</code>
 +or Copy table to all nodes
 +<code>SELECT create_reference_table('tablename');</code>
 +---\\
 +Show connected workers
 +<code>SELECT * FROM citus_get_active_worker_nodes();</code>
 +====== Rebalance table ======
 +<code>SELECT rebalance_table_shards('tablename');</code>
 +
 +====== Drain node ======
 +<code>SELECT citus_drain_node('coordinator01',5432);</code>
 +
 +====== Basic status ======
 +<code>SELECT * FROM citus_shards;
 +SELECT * FROM citus_tables;</code>
citus.txt · Last modified: 2021/05/25 12:35 by Jan Forman