hapostgres / pg_auto_failover

Postgres extension and service for automated failover and high-availability
Other
1.09k stars 114 forks source link

Create postgres error #865

Closed seaurching closed 2 years ago

seaurching commented 2 years ago

I have four servers, and I successfully created a monitor on one of them. When I created the Postgres node on the other three servers, I was prompted with an error

-bash-4.2$ /usr/pgsql-10/bin/pg_autoctl create postgres --pgdata /var/lib/pgsql/10/data/  --auth trust --ssl-self-signed --monitor postgres://autoctl_node@10.90.199.105:5433/pg_auto_failover?sslmode=require --pgctl /usr/pgsql-10/bin/pg_ctl
19:45:56 63937 INFO  Using default --ssl-mode "require"
19:45:56 63937 INFO  Using --ssl-self-signed: pg_autoctl will create self-signed certificates, allowing for encrypted network traffic
19:45:56 63937 WARN  Self-signed certificates provide protection against eavesdropping; this setup does NOT protect against Man-In-The-Middle attacks nor Impersonation attacks.
19:45:56 63937 WARN  See https://www.postgresql.org/docs/current/libpq-ssl.html for details
19:45:56 63937 INFO  Started pg_autoctl postgres service with pid 63939
19:45:56 63939 INFO   /usr/pgsql-10/bin/pg_autoctl do service postgres --pgdata /var/lib/pgsql/10/data/ -v
19:45:56 63937 INFO  Started pg_autoctl node-init service with pid 63940
19:45:56 63940 INFO  Continuing from a previous `pg_autoctl create` failed attempt
19:45:56 63940 INFO  PostgreSQL state at registration time was: PGDATA does not exist
19:45:56 63940 ERROR reach_initial_state: don't know how to read state dropped
19:45:57 63937 ERROR pg_autoctl service node-init exited with exit status 12
19:45:57 63937 INFO  Restarting service node-init
19:45:57 63942 INFO  Continuing from a previous `pg_autoctl create` failed attempt
19:45:57 63942 INFO  PostgreSQL state at registration time was: PGDATA does not exist
19:45:57 63942 ERROR reach_initial_state: don't know how to read state dropped
19:45:57 63937 ERROR pg_autoctl service node-init exited with exit status 12
DimCitus commented 2 years ago

This error message has two important parts. First:

19:45:56 63940 INFO  Continuing from a previous `pg_autoctl create` failed attempt

and then

19:45:56 63940 ERROR reach_initial_state: don't know how to read state dropped

So it looks like something went wrong and then you dropped the node from the monitor itself, and now that you want to create it again the init files that were created still exist. Please use pg_autoctl drop node --destroy on the node itself, and then create it from scratch again.

seaurching commented 2 years ago

I drop the node,it still show this error. And delete the monitor run again, the error also shows. My netmask is 19

I drop the node,it still show this error. And delete the monitor run again, the error also shows. My netmask is 19

DimCitus commented 2 years ago

Hi @seaurching ; please include a copy/paste of the command you type, on which node you're typing the command, and the output you get.