0

Yesterday, i used londiste for logical replication between PostgreSQL 9.3 and 9.5

Today, i try use londiste again. But i dont deleted node, schema after use londiste yesterday.

List package

yum list skytools*
Installed Packages
skytools-95.x86_64           3.2.6-1.rhel7
skytools-95-modules.x86_64   3.2.6-1.rhel7

Config master

cat /etc/skytools/londiste-master.ini
[londiste3]
job_name = appqueue
db = dbname=my_database host=master_IP
queue_name = appqueue
logfile = /var/log/skytools/master.log
pidfile = /var/run/skytools/master.pid

Config Slave

cat /etc/skytools/londiste-slave.ini 
[londiste3]
job_name = appqueue
db = dbname=my_database
queue_name = appqueue
logfile = /var/log/skytools/slave.log
pidfile = /var/run/skytools/slave.pid
You have mail in /var/spool/mail/root

Install scheme

qadmin -h master_IP -U postgres -d my_database -c "install londiste"
INSTALL

Copy DB

pg_dump -h master_IP -s -C -U postgres my_database |psql -U postgres

create-root master_IP

su postgres -c "londiste3 /etc/skytools/londiste-master.ini create-root master_IP 'dbname=my_database host=master_IP'"
2017-10-27 08:36:16,250 20249 INFO plpgsql is installed
2017-10-27 08:36:16,250 20249 INFO pgq is installed
2017-10-27 08:36:16,252 20249 INFO pgq.get_batch_cursor is installed
2017-10-27 08:36:16,252 20249 INFO pgq_ext is installed
2017-10-27 08:36:16,253 20249 INFO pgq_node is installed
2017-10-27 08:36:16,254 20249 INFO londiste is installed
2017-10-27 08:36:16,254 20249 INFO londiste.global_add_table is installed
2017-10-27 08:36:16,262 20249 INFO Node is already initialized as root

create-leaf slave_IP

su postgres -c "londiste3 /etc/skytools/londiste-slave.ini create-leaf slave_IP dbname=my_database --provider='host=master_IP dbname=my_database'"
2017-10-27 08:37:10,984 20414 WARNING No host= in public connect string, bad idea
2017-10-27 08:37:10,991 20414 INFO plpgsql is installed
2017-10-27 08:37:10,992 20414 INFO pgq is installed
2017-10-27 08:37:10,993 20414 INFO pgq.get_batch_cursor is installed
2017-10-27 08:37:10,993 20414 INFO pgq_ext is installed
2017-10-27 08:37:10,994 20414 INFO pgq_node is installed
2017-10-27 08:37:10,994 20414 INFO londiste is installed
2017-10-27 08:37:10,994 20414 INFO londiste.global_add_table is installed
2017-10-27 08:37:11,006 20414 INFO Initializing node
2017-10-27 08:37:11,022 20414 ERROR Node 'slave_IP' already exists

Run londiste3 master and slave worker

su postgres -c "londiste3 -d /etc/skytools/londiste-slave.ini worker"
Ignoring stale pidfile

su postgres -c "londiste3 -d /etc/skytools/londiste-master.ini worker"
Ignoring stale pidfile

Run pgqd

pgqd -d /etc/skytools/pgqd.ini
2017-10-27 08:38:31.638 20659 LOG Starting pgqd 3.2.6

Master status

su postgres -c "londiste3 /etc/skytools/londiste-master.ini status"
Queue: appqueue   Local node: master_IP

None (None)
                              Tables: 0/0/0
                              Lag: (n/a), NOT UPTODATE
master_IP (root)
                              Tables: 0/0/0
                              Lag: 17h56m7s, Tick: 1

Try Delete node:

su postgres -c "londiste3 /etc/skytools/londiste-slave.ini drop-node slave_IP"
2017-10-27 09:20:50,945 29464 ERROR get_node_database: cannot resolve slave_IP

su postgres -c "londiste3 /etc/skytools/londiste-slave.ini drop-node slave_IP dbname=my_database"
2017-10-27 09:21:17,859 29543 ERROR command 'drop-node' got 2 args, but expects 1: node_name

su postgres -c "londiste3 /etc/skytools/londiste-master.ini drop-node master_IP"
2017-10-27 09:24:32,038 30190 ERROR node still has subscribers

How correct fix this error? Package don`t have application pgqadm.py

Anton Patsev
  • 605
  • 2
  • 13
  • 27

1 Answers1

-1

You must use the name you gave the node, not its ip. for example if you create the node

londiste3 slave.ini create-branch slave 'SLAVE_CONN_STR' --provider = 'MASTER_CONN_STR'

you delete the node with

londiste3 slave.ini drop-node slave
Robert
  • 5,278
  • 43
  • 65
  • 115