Guest User

Untitled

a guest
Sep 21st, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.20 KB | None | 0 0
  1. host replication replication_user 0.0.0.0/0 trust
  2.  
  3. listen_addresses = '*'
  4. max_wal_senders = 10
  5. port = 5432
  6. wal_keep_segments = 500
  7. wal_level = replica
  8.  
  9. hot_standby = on
  10.  
  11. 2018-09-21 16:48:09.990 UTC [153] LOG: listening on IPv4 address "0.0.0.0", port 5432
  12. 2018-09-21 16:48:09.990 UTC [153] LOG: listening on IPv6 address "::", port 5432
  13. 2018-09-21 16:48:10.003 UTC [153] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
  14. 2018-09-21 16:48:10.029 UTC [161] LOG: database system was interrupted; last known up at 2018-09-21 16:48:09 UTC
  15. 2018-09-21 16:48:10.214 UTC [161] LOG: entering standby mode
  16. 2018-09-21 16:48:10.223 UTC [161] LOG: redo starts at 0/2000028
  17. 2018-09-21 16:48:10.228 UTC [161] LOG: consistent recovery state reached at 0/20000F8
  18. 2018-09-21 16:48:10.229 UTC [153] LOG: database system is ready to accept read only connections
  19. 2018-09-21 16:48:10.238 UTC [165] LOG: started streaming WAL from primary at 0/3000000 on timeline 1
  20. >>> Cloning is done
  21. >>>>>> WAL id: 000000010000000000000003
  22. >>>>>> WAL_RECEIVER_FLAG=1!
  23. >>> Not in recovery state (anymore)
  24. >>> Waiting for local postgres server start...
  25. >>> Wait schema replication_db.public on pgslave1:5432(user: replication_user,password: *******), will try 9 times with delay 10 seconds (TIMEOUT=90)
  26. >>>>>> Schema replication_db.public exists on host pgslave1:5432!
  27. >>> Unregister the node if it was done before
  28. DELETE 0
  29. >>> Registering node with role standby
  30. INFO: connecting to standby database
  31. INFO: connecting to master database
  32. INFO: retrieving node list for cluster 'pg_cluster'
  33. INFO: registering the standby
  34. [REPMGR EVENT] Node id: 2; Event type: standby_register; Success [1|0]: 1; Time: 2018-09-21 16:48:40.143418+00; Details:
  35. INFO: standby registration complete
  36. NOTICE: standby node correctly registered for cluster pg_cluster with id 2 (conninfo: user=replication_user password=replication_pass host=pgslave1 dbname=replication_db port=5432 connect_timeout=2)
  37. Locking standby (NEW_UPSTREAM_NODE_ID=1)...
  38. >>> Starting repmgr daemon...
  39. [2018-09-21 16:48:40] [NOTICE] looking for configuration file in current directory
  40. [2018-09-21 16:48:40] [NOTICE] looking for configuration file in /etc
  41. [2018-09-21 16:48:40] [NOTICE] configuration file found at: /etc/repmgr.conf
  42. [2018-09-21 16:48:40] [INFO] connecting to database 'user=replication_user password=replication_pass host=pgslave1 dbname=replication_db port=5432 connect_timeout=2'
  43. [2018-09-21 16:48:40] [INFO] connected to database, checking its state
  44. [2018-09-21 16:48:40] [INFO] connecting to master node of cluster 'pg_cluster'
  45. [2018-09-21 16:48:40] [INFO] retrieving node list for cluster 'pg_cluster'
  46. [2018-09-21 16:48:40] [INFO] checking role of cluster node '1'
  47. [2018-09-21 16:48:40] [INFO] checking cluster configuration with schema 'repmgr_pg_cluster'
  48. [2018-09-21 16:48:40] [INFO] checking node 2 in cluster 'pg_cluster'
  49. [2018-09-21 16:48:40] [INFO] reloading configuration file
  50. [2018-09-21 16:48:40] [INFO] configuration has not changed
  51. [2018-09-21 16:48:40] [INFO] starting continuous standby node monitoring
  52.  
  53. root@5f05159b998d:/etc# gosu postgres repmgr cluster show
  54. INFO: connecting to database
  55. Role | Name | Upstream | Connection String
  56. ----------+-------|----------|----------------------------------------------------------------------------------------------------------------
  57. * master | node1 | | user=replication_user password=replication_pass host=pgmaster dbname=replication_db port=5432 connect_timeout=2
  58. standby | node2 | node1 | user=replication_user password=replication_pass host=pgslave1 dbname=replication_db port=5432 connect_timeout=2
  59.  
  60. root@0d95e8dc83f8:/# pcp_attach_node -U pcp_user -h localhost -n 0
  61. Password:
  62. pcp_attach_node -- Command Successful
  63. root@0d95e8dc83f8:/# PGPASSWORD=$CHECK_PASSWORD psql -U $CHECK_USER -h localhost template1 -c "show pool_nodes"
  64. node_id | hostname | port | status | lb_weight | role | select_cnt | load_balance_node | replication_delay
  65. ---------+----------+------+--------+-----------+---------+------------+-------------------+-------------------
  66. 0 | pgmaster | 5432 | up | 0.500000 | primary | 0 | true | 0
  67. 1 | pgslave1 | 5432 | up | 0.500000 | standby | 0 | false | 0
  68. (2 rows)
Add Comment
Please, Sign In to add comment