Percona postgres Citus cluster , not able to write both server in cluster , it is writing table in single node

Hi Team,
Very good morning, I Hope you doing well.

First up on, Thanks to you, for giving a wonderful cluster solution with table sharing, I have installed the Percona Postgres cluster using Citus in ubuntu 22 servers.

I have installed using the below doc https://www.percona.com/blog/scalable-solutions-with-percona-distribution-for-postgresql-part-2-using-citus/#

Used 3 nodes, and 192.168.1.101 is coordinator_host,
192.168.1.100 and 192.168.1.1.150 servers are used as nodes , all are used same version even percona postgres cluster and Citus.

Also, I make changes as per the doc in pg_hba.conf and postgresql.conf,
in each server to allow connection from other nodes, and each server is connected with private IP .

My problem is when I do testing like importing data , it is only writes table in to a single node that is in 192.168.1.100 server, not writing 192.168.1.150 server, I have tested using below command.

SET citus.explain_all_tasks TO on;
EXPLAIN ANALYZE SELECT * FROM events;

testdb=# EXPLAIN ANALYZE SELECT * FROM events;
QUERY PLAN

Custom Scan (Citus Adaptive) (cost=0.00…0.00 rows=100000 width=52) (actual time=38.927…38.928 rows=5 loops=1)
Task Count: 32
Tuple data received from nodes: 290 bytes
Tasks Shown: One of 32
→ Task
Tuple data received from node: 0 bytes
Node: host=192.168.1.100 port=5432 dbname=testdb
→ Seq Scan on events_102040 events (cost=0.00…20.20 rows=1020 width=52) (actual time=0.005…0.006 rows=0 loops=1)
Planning Time: 0.509 ms
Execution Time: 0.032 ms
Planning Time: 1.453 ms
Execution Time: 38.974 ms
(12 rows)

ubuntu@main-server:~$ netstat -plnatu | grep 543
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 0.0.0.0:5432 0.0.0.0:* LISTEN -

postgres=# SELECT VERSION();
version

PostgreSQL 15.7 - Percona Distribution on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, 64-bit
(1 row)

postgres=# select citus_version();
citus_version

Citus 12.0.1 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, 64-bit
(1 row)

postgres=# SELECT * FROM pg_dist_node;
nodeid | groupid | nodename | nodeport | noderack | hasmetadata | isactive | noderole | nodecluster | metadatasynced | shouldhaveshards
--------±--------±--------------±---------±---------±------------±---------±---------±------------±---------------±-----------------
18 | 17 | 192.168.1.100 | 5432 | default | t | t | primary | default | t | t
1 | 0 | 192.168.1.101 | 5432 | default | t | t | primary | default | t | f
20 | 19 | 192.168.1.150 | 5435 | default | t | t | primary | default | t | t
(3 rows)

postgres=# SELECT * FROM citus_get_active_worker_nodes();
node_name | node_port
---------------±----------
192.168.1.150 | 5435
192.168.1.100 | 5432
(2 rows)

Hi,

Have a look at this blog and see if it clears things up for you.

Thank you very much , for the replay @Robert_Bernier
I will check that , currently I need to remove existing one node ip from the cluster,
I need to remove node from the cluster list , this is for add new another server.

I have added node using below command,

SELECT * from citus_add_node('192.168.1.150', 5435);

:+1: good to hear your finding the material useful.