Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >>> Setting up STOP handlers...
- >>> STARTING SSH (if required)...
- >>> TUNING UP SSH CLIENT...
- > STARTING SSH SERVER...
- >>> STARTING POSTGRES...
- >>> SETTING UP POLYMORPHIC VARIABLES (repmgr=3+postgres=9 | repmgr=4, postgres=10)...
- >>> TUNING UP POSTGRES...
- >>> Cleaning data folder which might have some garbage...
- >>> Check all partner nodes for common upstream node...
- >>>>>> Checking NODE=pgmaster...
- psql: could not connect to server: Connection refused
- Is the server running on host "pgmaster" (10.0.0.3) and accepting
- TCP/IP connections on port 5432?
- >>>>>> Skipping: failed to get master from the node!
- >>> Auto-detected master name: ''
- >>> Setting up repmgr...
- >>> Setting up repmgr config file '/etc/repmgr.conf'...
- >>> Setting up upstream node...
- cat: /var/lib/postgresql/data/standby.lock: No such file or directory
- >>> Previously Locked standby upstream node LOCKED_STANDBY=''
- >>> Waiting for upstream postgres server...
- >>> Wait schema replication_db.repmgr_pg_cluster on pgmaster:5432(user: replication_user,password: *******), will try 30 times with delay 10 seconds (TIMEOUT=300)
- psql: could not connect to server: Connection refused
- Is the server running on host "pgmaster" (10.0.0.3) and accepting
- TCP/IP connections on port 5432?
- >>>>>> Host pgmaster:5432 is not accessible (will try 30 times more)
- >>>>>> Schema replication_db.repmgr_pg_cluster is still not accessible on host pgmaster:5432 (will try 29 times more)
- >>>>>> Schema replication_db.repmgr_pg_cluster is still not accessible on host pgmaster:5432 (will try 28 times more)
- >>>>>> Schema replication_db.repmgr_pg_cluster exists on host pgmaster:5432!
- >>> REPLICATION_UPSTREAM_NODE_ID=1
- >>> Sending in background postgres start...
- >>> Waiting for upstream postgres server...
- >>> Wait schema replication_db.repmgr_pg_cluster on pgmaster:5432(user: replication_user,password: *******), will try 30 times with delay 10 seconds (TIMEOUT=300)
- >>>>>> Schema replication_db.repmgr_pg_cluster exists on host pgmaster:5432!
- >>> Starting standby node...
- >>> Instance hasn't been set up yet.
- >>> Clonning primary node...
- >>> Waiting for upstream postgres server...
- >>> Wait schema replication_db.repmgr_pg_cluster on pgmaster:5432(user: replication_user,password: *******), will try 30 times with delay 10 seconds (TIMEOUT=300)
- NOTICE: destination directory '/var/lib/postgresql/data' provided
- INFO: connecting to upstream node
- INFO: Successfully connected to upstream node. Current installation size is 37 MB
- INFO: checking and correcting permissions on existing directory /var/lib/postgresql/data ...
- >>>>>> Schema replication_db.repmgr_pg_cluster exists on host pgmaster:5432!
- >>> Waiting for cloning on this node is over(if any in progress): CLEAN_UP_ON_FAIL=, INTERVAL=30
- >>> Replicated: 4
- NOTICE: starting backup (using pg_basebackup)...
- INFO: executing: '/usr/lib/postgresql/10/bin/pg_basebackup -l "repmgr base backup" -D /var/lib/postgresql/data -h pgmaster -p 5432 -U replication_user -c fast -X stream -S repmgr_slot_424 '
- NOTICE: standby clone (using pg_basebackup) complete
- NOTICE: you can now start your PostgreSQL server
- HINT: for example : pg_ctl -D /var/lib/postgresql/data start
- HINT: After starting the server, you need to register this standby with "repmgr standby register"
- [REPMGR EVENT] Node id: 424; Event type: standby_clone; Success [1|0]: 1; Time: 2018-11-22 16:29:34.355397+00; Details: Cloned from host 'pgmaster', port 5432; backup method: pg_basebackup; --force: Y
- >>> Configuring /var/lib/postgresql/data/postgresql.conf
- >>>>>> Will add configs to the exists file
- >>>>>> Adding config 'max_replication_slots'='10'
- >>>>>> Adding config 'shared_preload_libraries'=''repmgr_funcs''
- >>> Starting postgres...
- >>> Waiting for local postgres server recovery if any in progress:LAUNCH_RECOVERY_CHECK_INTERVAL=30
- >>> Recovery is in progress:
- 2018-11-22 16:29:34.741 UTC [156] LOG: listening on IPv4 address "0.0.0.0", port 5432
- 2018-11-22 16:29:34.741 UTC [156] LOG: listening on IPv6 address "::", port 5432
- 2018-11-22 16:29:34.808 UTC [156] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
- 2018-11-22 16:29:34.931 UTC [165] LOG: database system was interrupted; last known up at 2018-11-22 16:29:32 UTC
- 2018-11-22 16:29:35.282 UTC [165] LOG: entering standby mode
- 2018-11-22 16:29:35.359 UTC [165] LOG: redo starts at 0/2000028
- 2018-11-22 16:29:35.410 UTC [165] LOG: consistent recovery state reached at 0/20000F8
- 2018-11-22 16:29:35.411 UTC [156] LOG: database system is ready to accept read only connections
- 2018-11-22 16:29:35.450 UTC [169] LOG: started streaming WAL from primary at 0/3000000 on timeline 1
- >>> Cloning is done
- >>>>>> WAL id: 000000010000000000000003
- >>>>>> WAL_RECEIVER_FLAG=1!
- >>> Not in recovery state (anymore)
- >>> Waiting for local postgres server start...
- >>> Wait schema replication_db.public on aaa5ca7e285c:5432(user: replication_user,password: *******), will try 9 times with delay 10 seconds (TIMEOUT=90)
- >>>>>> Schema replication_db.public exists on host aaa5ca7e285c:5432!
- >>> Unregister the node if it was done before
- DELETE 0
- >>> Registering node with role standby
- INFO: connecting to standby database
- INFO: connecting to master database
- INFO: retrieving node list for cluster 'pg_cluster'
- INFO: registering the standby
- [REPMGR EVENT] Node id: 424; Event type: standby_register; Success [1|0]: 1; Time: 2018-11-22 16:30:05.013207+00; Details:
- INFO: standby registration complete
- NOTICE: standby node correctly registered for cluster pg_cluster with id 424 (conninfo: user=replication_user password=replication_pass host=aaa5ca7e285c dbname=replication_db port=5432 connect_timeout=2)
- Locking standby (NEW_UPSTREAM_NODE_ID=1)...
- >>> Starting repmgr daemon...
- [2018-11-22 16:30:05] [NOTICE] looking for configuration file in current directory
- [2018-11-22 16:30:05] [NOTICE] looking for configuration file in /etc
- [2018-11-22 16:30:05] [NOTICE] configuration file found at: /etc/repmgr.conf
- [2018-11-22 16:30:05] [INFO] connecting to database 'user=replication_user password=replication_pass host=aaa5ca7e285c dbname=replication_db port=5432 connect_timeout=2'
- [2018-11-22 16:30:05] [INFO] connected to database, checking its state
- [2018-11-22 16:30:05] [INFO] connecting to master node of cluster 'pg_cluster'
- [2018-11-22 16:30:05] [INFO] retrieving node list for cluster 'pg_cluster'
- [2018-11-22 16:30:05] [INFO] checking role of cluster node '1'
- [2018-11-22 16:30:05] [INFO] checking cluster configuration with schema 'repmgr_pg_cluster'
- [2018-11-22 16:30:05] [INFO] checking node 424 in cluster 'pg_cluster'
- [2018-11-22 16:30:05] [INFO] reloading configuration file
- [2018-11-22 16:30:05] [INFO] configuration has not changed
- [2018-11-22 16:30:05] [INFO] starting continuous standby node monitoring
- 2018-11-22 16:37:19.236 UTC [415] LOG: incomplete startup packet
- 2018-11-22 17:16:43.597 UTC [169] FATAL: could not receive data from WAL stream: server closed the connection unexpectedly
- This probably means the server terminated abnormally
- before or while processing the request.
- 2018-11-22 17:16:43.597 UTC [165] LOG: invalid record length at 0/3004230: wanted 24, got 0
- 2018-11-22 17:16:43.622 UTC [1555] FATAL: could not connect to the primary server: server closed the connection unexpectedly
- This probably means the server terminated abnormally
- before or while processing the request.
- [2018-11-22 17:16:45] [ERROR] connection to database failed: could not translate host name "pgmaster" to address: Temporary failure in name resolution
- [2018-11-22 17:16:45] [ERROR] unable to connect to upstream node: could not translate host name "pgmaster" to address: Temporary failure in name resolution
- [2018-11-22 17:16:45] [ERROR] connection to database failed: could not translate host name "pgmaster" to address: Temporary failure in name resolution
- [2018-11-22 17:16:45] [WARNING] connection to master has been lost, trying to recover... 15 seconds before failover decision
- 2018-11-22 17:16:48.617 UTC [1557] FATAL: could not connect to the primary server: could not translate host name "pgmaster" to address: Temporary failure in name resolution
- [2018-11-22 17:16:50] [WARNING] connection to master has been lost, trying to recover... 10 seconds before failover decision
- 2018-11-22 17:16:53.614 UTC [1560] FATAL: could not connect to the primary server: could not translate host name "pgmaster" to address: Temporary failure in name resolution
- [2018-11-22 17:16:55] [WARNING] connection to master has been lost, trying to recover... 5 seconds before failover decision
- 2018-11-22 17:16:58.627 UTC [1571] LOG: started streaming WAL from primary at 0/3000000 on timeline 1
- [2018-11-22 17:17:00] [ERROR] unable to reconnect to master (timeout 60 seconds)...
- [2018-11-22 17:17:05] [NOTICE] this node is the best candidate to be the new master, promoting...
- NOTICE: looking for configuration file in current directory
- NOTICE: looking for configuration file in /etc
- NOTICE: configuration file found at: /etc/repmgr.conf
- DEBUG: slot name initialised as: repmgr_slot_424
- INFO: connecting to standby database
- DEBUG: connecting to: 'user=replication_user password=replication_pass host=aaa5ca7e285c dbname=replication_db port=5432 connect_timeout=2 fallback_application_name='repmgr''
- DEBUG: set_config():
- SET synchronous_commit TO 'local'
- INFO: connected to standby, checking its state
- DEBUG: is_standby(): SELECT pg_catalog.pg_is_in_recovery()
- INFO: retrieving node list for cluster 'pg_cluster'
- DEBUG: get_master_connection():
- SELECT id, conninfo, CASE WHEN type = 'master' THEN 1 ELSE 2 END AS type_priority FROM "repmgr_pg_cluster".repl_nodes WHERE cluster = 'pg_cluster' AND type != 'witness' ORDER BY active DESC, type_priority, priority, id
- INFO: checking role of cluster node '1'
- DEBUG: connecting to: 'user=replication_user password=replication_pass host=pgmaster dbname=replication_db port=5432 connect_timeout=2 fallback_application_name='repmgr''
- DEBUG: set_config():
- SET synchronous_commit TO 'local'
- DEBUG: is_standby(): SELECT pg_catalog.pg_is_in_recovery()
- DEBUG: get_master_connection(): current master node is 1
- ERROR: this cluster already has an active master server
- [2018-11-22 17:17:05] [INFO] retrieving node list for cluster 'pg_cluster'
- [2018-11-22 17:17:05] [INFO] checking role of cluster node '1'
- [2018-11-22 17:17:05] [NOTICE] Original master reappeared before this standby was promoted - no action taken
- [2018-11-22 17:17:07] [INFO] connecting to master node of cluster 'pg_cluster'
- [2018-11-22 17:17:07] [INFO] retrieving node list for cluster 'pg_cluster'
- [2018-11-22 17:17:07] [INFO] checking role of cluster node '1'
- [2018-11-22 17:17:07] [INFO] checking cluster configuration with schema 'repmgr_pg_cluster'
- [2018-11-22 17:17:07] [INFO] checking node 424 in cluster 'pg_cluster'
- [2018-11-22 17:17:07] [INFO] reloading configuration file
- [2018-11-22 17:17:07] [INFO] configuration has not changed
- [2018-11-22 17:17:07] [INFO] starting continuous standby node monitoring
- 2018-11-22 17:17:25.804 UTC [1569] ERROR: cannot execute CREATE TABLE in a read-only transaction
- 2018-11-22 17:17:25.804 UTC [1569] STATEMENT: create table test (id int, name varchar(324));
- 2018-11-22 17:18:15.745 UTC [1618] ERROR: cannot execute CREATE TABLE in a read-only transaction
- 2018-11-22 17:18:15.745 UTC [1618] STATEMENT: create table test (id int, name varchar(234));
- 2018-11-22 17:19:51.205 UTC [1571] FATAL: could not receive data from WAL stream: server closed the connection unexpectedly
- This probably means the server terminated abnormally
- before or while processing the request.
- 2018-11-22 17:19:51.205 UTC [165] LOG: invalid record length at 0/3019460: wanted 24, got 0
- 2018-11-22 17:19:51.211 UTC [1673] FATAL: could not connect to the primary server: could not connect to server: Connection refused
- Is the server running on host "pgmaster" (10.0.0.3) and accepting
- TCP/IP connections on port 5432?
- [2018-11-22 17:19:51] [ERROR] connection to database failed: could not connect to server: Connection refused
- Is the server running on host "pgmaster" (10.0.0.3) and accepting
- TCP/IP connections on port 5432?
- [2018-11-22 17:19:51] [ERROR] unable to connect to upstream node: could not connect to server: Connection refused
- Is the server running on host "pgmaster" (10.0.0.3) and accepting
- TCP/IP connections on port 5432?
- [2018-11-22 17:19:51] [ERROR] connection to database failed: could not connect to server: Connection refused
- Is the server running on host "pgmaster" (10.0.0.3) and accepting
- TCP/IP connections on port 5432?
- [2018-11-22 17:19:51] [WARNING] connection to master has been lost, trying to recover... 15 seconds before failover decision
- 2018-11-22 17:19:56.220 UTC [1675] FATAL: could not connect to the primary server: could not translate host name "pgmaster" to address: Temporary failure in name resolution
- [2018-11-22 17:19:56] [WARNING] connection to master has been lost, trying to recover... 10 seconds before failover decision
- 2018-11-22 17:20:01.221 UTC [1676] FATAL: could not connect to the primary server: could not translate host name "pgmaster" to address: Temporary failure in name resolution
- [2018-11-22 17:20:01] [WARNING] connection to master has been lost, trying to recover... 5 seconds before failover decision
- 2018-11-22 17:20:06.231 UTC [1678] LOG: started streaming WAL from primary at 0/3000000 on timeline 1
- [2018-11-22 17:20:06] [ERROR] unable to reconnect to master (timeout 60 seconds)...
- [2018-11-22 17:20:11] [NOTICE] this node is the best candidate to be the new master, promoting...
- NOTICE: looking for configuration file in current directory
- NOTICE: looking for configuration file in /etc
- NOTICE: configuration file found at: /etc/repmgr.conf
- DEBUG: slot name initialised as: repmgr_slot_424
- INFO: connecting to standby database
- DEBUG: connecting to: 'user=replication_user password=replication_pass host=aaa5ca7e285c dbname=replication_db port=5432 connect_timeout=2 fallback_application_name='repmgr''
- DEBUG: set_config():
- SET synchronous_commit TO 'local'
- INFO: connected to standby, checking its state
- DEBUG: is_standby(): SELECT pg_catalog.pg_is_in_recovery()
- INFO: retrieving node list for cluster 'pg_cluster'
- DEBUG: get_master_connection():
- SELECT id, conninfo, CASE WHEN type = 'master' THEN 1 ELSE 2 END AS type_priority FROM "repmgr_pg_cluster".repl_nodes WHERE cluster = 'pg_cluster' AND type != 'witness' ORDER BY active DESC, type_priority, priority, id
- INFO: checking role of cluster node '1'
- DEBUG: connecting to: 'user=replication_user password=replication_pass host=pgmaster dbname=replication_db port=5432 connect_timeout=2 fallback_application_name='repmgr''
- DEBUG: set_config():
- SET synchronous_commit TO 'local'
- DEBUG: is_standby(): SELECT pg_catalog.pg_is_in_recovery()
- DEBUG: get_master_connection(): current master node is 1
- ERROR: this cluster already has an active master server
- [2018-11-22 17:20:11] [INFO] retrieving node list for cluster 'pg_cluster'
- [2018-11-22 17:20:11] [INFO] checking role of cluster node '1'
- [2018-11-22 17:20:11] [NOTICE] Original master reappeared before this standby was promoted - no action taken
- [2018-11-22 17:20:13] [INFO] connecting to master node of cluster 'pg_cluster'
- [2018-11-22 17:20:13] [INFO] retrieving node list for cluster 'pg_cluster'
- [2018-11-22 17:20:13] [INFO] checking role of cluster node '1'
- [2018-11-22 17:20:13] [INFO] checking cluster configuration with schema 'repmgr_pg_cluster'
- [2018-11-22 17:20:13] [INFO] checking node 424 in cluster 'pg_cluster'
- [2018-11-22 17:20:13] [INFO] reloading configuration file
- [2018-11-22 17:20:13] [INFO] configuration has not changed
- [2018-11-22 17:20:13] [INFO] starting continuous standby node monitoring
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement