You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a setup of pgautofailover monitor node, primary and secondary nodes.
I was able to register the primary node to monitor but the connection type is "read-write!"
when I tried to connect to monitor node from primary I see the below error, could anyon please understand how tp fix it?
Enter the captcha 'OOUC' to execute the command: OOUC
03:28:57 17434 WARN No encryption is used for network traffic! This allows an attacker on the network to read all replication data.
03:28:57 17434 WARN Using --ssl-self-signed instead of --no-ssl is recommend to achieve more security with the same ease of deployment.
03:28:57 17434 WARN See https://www.postgresql.org/docs/current/libpq-ssl.html for details on how to improve
03:28:57 17434 INFO Using default --ssl-mode "prefer"
03:28:57 17434 INFO Started pg_autoctl postgres service with pid 17436
03:28:57 17436 INFO /usr/pgsql-14/bin/pg_autoctl do service postgres --pgdata /var/lib/pgsql/14/data/ -v
03:28:57 17434 INFO Started pg_autoctl node-init service with pid 17437
03:28:57 17437 INFO Registered node 9 "node_9" (ny2mzhp1p1pg1:5432)in formation "default", group 0, state "single"
03:28:57 17437 INFO Writing keeper state file at "/var/lib/pgsql/.local/share/pg_autoctl/var/lib/pgsql/14/data/pg_autoctl.state"
03:28:57 17437 INFO Writing keeper init state file at "/var/lib/pgsql/.local/share/pg_autoctl/var/lib/pgsql/14/data/pg_autoctl.init"
03:28:57 17437 INFO Successfully registered as "single" to the monitor.
03:28:57 17437 INFO FSM transition from "init" to "single": Start as a single node
03:28:57 17437 INFO Initialising postgres as a primary
03:28:57 17437 INFO Initialising a PostgreSQL cluster at "/var/lib/pgsql/14/data/"
03:28:57 17437 INFO /usr/pgsql-14/bin/pg_ctl initdb -s -D /var/lib/pgsql/14/data/ --option '--auth=trust'
03:28:58 17457 INFO /usr/pgsql-14/bin/postgres -D /var/lib/pgsql/14/data -p 5432 -h *
03:28:58 17437 INFO The user "postgres" already exists, skipping.
03:28:58 17437 INFO CREATE DATABASE postgres;
03:28:58 17437 INFO The database "postgres" already exists, skipping.
03:28:58 17437 INFO CREATE EXTENSION pg_stat_statements;
03:28:58 17437 INFO Disabling synchronous replication
03:28:58 17436 INFO Postgres is now serving PGDATA "/var/lib/pgsql/14/data" on port 5432 with pid 17457
03:28:58 17437 INFO Reloading Postgres configuration and HBA rules
03:28:58 17437 INFO Reloading Postgres configuration and HBA rules
03:28:58 17437 INFO Transition complete: current state is now "single"
03:28:58 17437 INFO keeper has been successfully initialized.
03:28:58 17434 WARN pg_autoctl service node-init exited with exit status 0
03:28:58 17436 INFO Postgres controller service received signal SIGTERM, terminating
03:28:58 17436 INFO Stopping pg_autoctl postgres service
03:28:58 17436 INFO /usr/pgsql-14/bin/pg_ctl --pgdata /var/lib/pgsql/14/data --wait stop --mode fast
03:28:58 17434 INFO Stop pg_autoctl
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have a setup of pgautofailover monitor node, primary and secondary nodes.
I was able to register the primary node to monitor but the connection type is "read-write!"
when I tried to connect to monitor node from primary I see the below error, could anyon please understand how tp fix it?
sudo -iu postgres psql 'postgres://pgautofailover_replicator@monitor:5432/postgres'
psql: error: connection to server at "monitor", port 5432 failed: FATAL: role "pgautofailover_replicator" does not exist
Below are the logs I see when I register the primary to monitor
-u postgres /usr/pgsql-14/bin/pg_autoctl create postgres --pgdata /var/lib/pgsql/14/data/ --auth trust --no-ssl --username postgres --dbname postgres --hostname ny2mzhp1p1pg1 --pgctl /usr/pgsql-14/bin/pg_ctl --monitor postgres://autoctl_node@ny2mzhp1p1pg3:5432/pg_auto_failover?sslmode=prefer
Enter the captcha 'OOUC' to execute the command: OOUC
03:28:57 17434 WARN No encryption is used for network traffic! This allows an attacker on the network to read all replication data.
03:28:57 17434 WARN Using --ssl-self-signed instead of --no-ssl is recommend to achieve more security with the same ease of deployment.
03:28:57 17434 WARN See https://www.postgresql.org/docs/current/libpq-ssl.html for details on how to improve
03:28:57 17434 INFO Using default --ssl-mode "prefer"
03:28:57 17434 INFO Started pg_autoctl postgres service with pid 17436
03:28:57 17436 INFO /usr/pgsql-14/bin/pg_autoctl do service postgres --pgdata /var/lib/pgsql/14/data/ -v
03:28:57 17434 INFO Started pg_autoctl node-init service with pid 17437
03:28:57 17437 INFO Registered node 9 "node_9" (ny2mzhp1p1pg1:5432)in formation "default", group 0, state "single"
03:28:57 17437 INFO Writing keeper state file at "/var/lib/pgsql/.local/share/pg_autoctl/var/lib/pgsql/14/data/pg_autoctl.state"
03:28:57 17437 INFO Writing keeper init state file at "/var/lib/pgsql/.local/share/pg_autoctl/var/lib/pgsql/14/data/pg_autoctl.init"
03:28:57 17437 INFO Successfully registered as "single" to the monitor.
03:28:57 17437 INFO FSM transition from "init" to "single": Start as a single node
03:28:57 17437 INFO Initialising postgres as a primary
03:28:57 17437 INFO Initialising a PostgreSQL cluster at "/var/lib/pgsql/14/data/"
03:28:57 17437 INFO /usr/pgsql-14/bin/pg_ctl initdb -s -D /var/lib/pgsql/14/data/ --option '--auth=trust'
03:28:58 17457 INFO /usr/pgsql-14/bin/postgres -D /var/lib/pgsql/14/data -p 5432 -h *
03:28:58 17437 INFO The user "postgres" already exists, skipping.
03:28:58 17437 INFO CREATE DATABASE postgres;
03:28:58 17437 INFO The database "postgres" already exists, skipping.
03:28:58 17437 INFO CREATE EXTENSION pg_stat_statements;
03:28:58 17437 INFO Disabling synchronous replication
03:28:58 17436 INFO Postgres is now serving PGDATA "/var/lib/pgsql/14/data" on port 5432 with pid 17457
03:28:58 17437 INFO Reloading Postgres configuration and HBA rules
03:28:58 17437 INFO Reloading Postgres configuration and HBA rules
03:28:58 17437 INFO Transition complete: current state is now "single"
03:28:58 17437 INFO keeper has been successfully initialized.
03:28:58 17434 WARN pg_autoctl service node-init exited with exit status 0
03:28:58 17436 INFO Postgres controller service received signal SIGTERM, terminating
03:28:58 17436 INFO Stopping pg_autoctl postgres service
03:28:58 17436 INFO /usr/pgsql-14/bin/pg_ctl --pgdata /var/lib/pgsql/14/data --wait stop --mode fast
03:28:58 17434 INFO Stop pg_autoctl
Name | Node | Host:Port | TLI: LSN | Connection | Reported State | Assigned State
--------+-------+--------------------+----------------+--------------+---------------------+--------------------
node_9 | 9 | ny2mzhp1p1pg1:5432 | 1: 0/17CEEA8 | read-write ! | wait_primary | wait_primary
node_10 | 10 | ny2mzhp1p1pg2:5432 | 1: 0/0 | none ! | wait_standby | catchingup
Beta Was this translation helpful? Give feedback.
All reactions