备库搭建后,进入备库报错psql: FATAL: the database system is starting up

时间:2023-03-09 20:07:02
备库搭建后,进入备库报错psql: FATAL: the database system is starting up
备库搭建后,进入备库报错psql: FATAL:  the database system is starting up
 原因:备库配置文件没有hot_standby = on
master
-bash-4.1$ ps aux |grep post
postgres  89707  0.0  0.0 43196188 2872 ?       Ss   00:15   0:27 postgres: wal sender process rep 10.40.55.69(26717) streaming 9F6/E1DCC0D8
slave
[root@db-hx-55-69 bohai]# ps aux|grep post                        
postgres 14020  0.3 29.0 43132932 19181752 ?   Ss   00:15   4:26 postgres: startup process   recovering 00000001000009F6000000E7                                 
postgres 14055  0.1  0.0 43137588 2204 ?       Ss   00:15   1:23 postgres: wal receiver process   streaming 9F6/E7F52960      
[postgres@db-hx-55-69 ~]$ psql
psql: FATAL:  the database system is starting up
[postgres@db-hx-55-69 pg_log]$ tail -f  postgresql-Sat.log
< 2018-03-10 22:59:51.188 CST >FATAL:  the database system is starting up
[postgres@db-hx-55-69 data]$ vi  postgresql.conf
hot_standby = on
[postgres@db-hx-55-69 data]$ pg_ctl restart  -D /opt/tuniu/postgresql/data  
< 2018-03-10 23:14:30.391 CST >LOG:  received fast shutdown request
< 2018-03-10 23:14:30.391 CST >FATAL:  terminating walreceiver process due to administrator command
< 2018-03-10 23:14:30.771 CST >LOG:  shutting down
< 2018-03-10 23:14:30.772 CST >LOG:  database system is shut down
< 2018-03-10 23:14:34.263 CST >LOG:  database system was shut down in recovery at 2018-03-10 23:14:30 CST
< 2018-03-10 23:14:34.263 CST >LOG:  entering standby mode
< 2018-03-10 23:14:34.264 CST >LOG:  redo starts at 9F6/C4395020
< 2018-03-10 23:14:37.272 CST >FATAL:  the database system is starting up
< 2018-03-10 23:14:39.167 CST >FATAL:  the database system is starting up
< 2018-03-10 23:14:44.326 CST >LOG:  consistent recovery state reached at 9F6/FF6393F0
< 2018-03-10 23:14:44.326 CST >LOG:  invalid resource manager ID 255 at 9F6/FF6393F0
< 2018-03-10 23:14:44.327 CST >LOG:  database system is ready to accept read only connections
< 2018-03-10 23:14:44.330 CST >LOG:  started streaming WAL from primary at 9F6/FF000000 on timeline 1
[postgres@db-hx-55-69 data]$ psql
psql (9.5.4)
Type "help" for help.
postgres=# \l