[英]Failover is not successful in Postgresql 9.0
我在Linux上使用PostgreSQL9.0。 我正在嘗試使用java做faiover。 因此,我能夠創建觸發器文件。 但是創建觸發文件后,Postgres服務器將停止。 我認為有人正在殺死服務器進程。 在pg_log中寫着:-
2011-11-16 15:25:18 ETC/GMT LOG: startup process (PID 32542) was terminated by signal 6: Aborted
2011-11-16 15:25:18 ETC/GMT LOG: terminating any other active server processes
2011-11-16 15:25:18 ETC/GMT DEBUG: sending SIGQUIT to process 32546
2011-11-16 15:25:18 ETC/GMT DEBUG: sending SIGQUIT to process 32547
2011-11-16 15:25:18 ETC/GMT DEBUG: shmem_exit(-1): 0 callbacks to make
2011-11-16 15:25:18 ETC/GMT DEBUG: proc_exit(-1): 0 callbacks to make
2011-11-16 15:25:18 ETC/GMT DEBUG: reaping dead processes
2011-11-16 15:25:18 ETC/GMT DEBUG: shmem_exit(-1): 0 callbacks to make
2011-11-16 15:25:18 ETC/GMT DEBUG: proc_exit(-1): 0 callbacks to make
2011-11-16 15:25:18 ETC/GMT DEBUG: reaping dead processes
2011-11-16 15:25:18 ETC/GMT DEBUG: shmem_exit(1): 3 callbacks to make
2011-11-16 15:25:18 ETC/GMT DEBUG: proc_exit(1): 3 callbacks to make
2011-11-16 15:25:18 ETC/GMT DEBUG: exit(1)
2011-11-16 15:25:18 ETC/GMT DEBUG: shmem_exit(-1): 0 callbacks to make
2011-11-16 15:25:18 ETC/GMT DEBUG: proc_exit(-1): 0 callbacks to make
2011-11-16 15:25:18 ETC/GMT DEBUG: logger shutting down
2011-11-16 15:25:18 ETC/GMT DEBUG: shmem_exit(0): 0 callbacks to make
2011-11-16 15:25:18 ETC/GMT DEBUG: proc_exit(0): 0 callbacks to make
2011-11-16 15:25:18 ETC/GMT DEBUG: exit(0)
2011-11-16 15:25:18 ETC/GMT DEBUG: shmem_exit(-1): 0 callbacks to make
2011-11-16 15:25:18 ETC/GMT DEBUG: proc_exit(-1): 0 callbacks to make
並且由於關閉服務器而無法將其設置為主服務器,而仍處於恢復模式。
當我手動使用pg_ctl啟動postgres服務器時,待機進入生產模式。
請告訴我該怎么做才能解決這個問題。 誰在向郵局局長發送SIGHQUIT信號?
這是日志:
2011-11-16 15:25:12 ETC/GMT DEBUG: executing restore command "cp /data/PostgreSQL/testdata/archive/000000030000000000000008 "pg_xlog/RECOVERYXLOG""
cp: cannot stat `/data/PostgreSQL/testdata/archive/000000030000000000000008': No such file or directory
2011-11-16 15:25:12 ETC/GMT DEBUG: could not restore file "000000030000000000000008" from archive: return code 256
2011-11-16 15:25:12 ETC/GMT DEBUG: could not open file "pg_xlog/000000030000000000000008" (log file 0, segment 8): No such file or directory
2011-11-16 15:25:14 ETC/GMT DEBUG: skipping restartpoint, already performed at 0/8000020
2011-11-16 15:25:18 ETC/GMT DEBUG: find_in_dynamic_libpath: trying "/data/PostgreSQL/lib/postgresql/libpqwalreceiver"
2011-11-16 15:25:18 ETC/GMT DEBUG: find_in_dynamic_libpath: trying "/data/PostgreSQL/lib/postgresql/libpqwalreceiver.so"
2011-11-16 15:25:18 ETC/GMT FATAL: could not connect to the primary server: could not connect to server: Connection refused
Is the server running on host "172.168.1.28" and accepting
TCP/IP connections on port 5433?
2011-11-16 15:25:18 ETC/GMT DEBUG: shmem_exit(1): 5 callbacks to make
2011-11-16 15:25:18 ETC/GMT DEBUG: proc_exit(1): 2 callbacks to make
2011-11-16 15:25:18 ETC/GMT DEBUG: exit(1)
2011-11-16 15:25:18 ETC/GMT DEBUG: shmem_exit(-1): 0 callbacks to make
2011-11-16 15:25:18 ETC/GMT DEBUG: proc_exit(-1): 0 callbacks to make
2011-11-16 15:25:18 ETC/GMT DEBUG: reaping dead processes
2011-11-16 15:25:18 ETC/GMT DEBUG: executing restore command "cp /data/PostgreSQL/testdata/archive/000000030000000000000008 "pg_xlog/RECOVERYXLOG""
cp: cannot stat `/data/PostgreSQL/testdata/archive/000000030000000000000008': No such file or directory
2011-11-16 15:25:18 ETC/GMT DEBUG: could not restore file "000000030000000000000008" from archive: return code 256
2011-11-16 15:25:18 ETC/GMT PANIC: could not open file "pg_xlog/000000030000000000000008" (log file 0, segment 8): Permission denied
2011-11-16 15:25:18 ETC/GMT DEBUG: reaping dead processes
2011-11-16 15:25:18 ETC/GMT LOG: startup process (PID 32542) was terminated by signal 6: Aborted
2011-11-16 15:25:18 ETC/GMT LOG: terminating any other active server processes
2011-11-16 15:25:18 ETC/GMT DEBUG: sending SIGQUIT to process 32546
2011-11-16 15:25:18 ETC/GMT DEBUG: sending SIGQUIT to process 32547
2011-11-16 15:25:18 ETC/GMT DEBUG: shmem_exit(-1): 0 callbacks to make
2011-11-16 15:25:18 ETC/GMT DEBUG: proc_exit(-1): 0 callbacks to make
2011-11-16 15:25:18 ETC/GMT DEBUG: reaping dead processes
2011-11-16 15:25:18 ETC/GMT DEBUG: shmem_exit(-1): 0 callbacks to make
2011-11-16 15:25:18 ETC/GMT DEBUG: proc_exit(-1): 0 callbacks to make
2011-11-16 15:25:18 ETC/GMT DEBUG: reaping dead processes
2011-11-16 15:25:18 ETC/GMT DEBUG: shmem_exit(1): 3 callbacks to make
2011-11-16 15:25:18 ETC/GMT DEBUG: proc_exit(1): 3 callbacks to make
2011-11-16 15:25:18 ETC/GMT DEBUG: exit(1)
2011-11-16 15:25:18 ETC/GMT DEBUG: shmem_exit(-1): 0 callbacks to make
2011-11-16 15:25:18 ETC/GMT DEBUG: proc_exit(-1): 0 callbacks to make
2011-11-16 15:25:18 ETC/GMT DEBUG: logger shutting down
2011-11-16 15:25:18 ETC/GMT DEBUG: shmem_exit(0): 0 callbacks to make
2011-11-16 15:25:18 ETC/GMT DEBUG: proc_exit(0): 0 callbacks to make
2011-11-16 15:25:18 ETC/GMT DEBUG: exit(0)
2011-11-16 15:25:18 ETC/GMT DEBUG: shmem_exit(-1): 0 callbacks to make
2011-11-16 15:25:18 ETC/GMT DEBUG: proc_exit(-1): 0 callbacks to make
因此,查看您的日志,似乎是主服務器發出的日志存在問題:
2011-11-16 15:25:12 ETC/GMT DEBUG: executing restore command "cp /data/PostgreSQL/testdata/archive/000000030000000000000008 "pg_xlog/RECOVERYXLOG"" cp: cannot stat `/data/PostgreSQL/testdata/archive/000000030000000000000008': No such file or directory
2011-11-16 15:25:18 ETC/GMT DEBUG: could not restore file "000000030000000000000008" from archive: return code 256
2011-11-16 15:25:18 ETC/GMT PANIC: could not open file "pg_xlog/000000030000000000000008" (log file 0, segment 8): Permission denied 2011-11-16
您確定日志文件已從服務器正確復制並且可以由本地postgres進程讀取/寫入嗎? 我會證實這一點。
我看到的另一個錯誤(我不熟悉,自從上次設置備用服務器以來,似乎添加了一些錯誤)是:
15:25:18 ETC/GMT FATAL: could not connect to the primary server: could not connect to server: Connection refused Is the server running on host "172.168.1.28" and accepting TCP/IP connections on port 5433?
您確定連接信息正確嗎? 您可以在主服務器中看到傳入的連接嗎?
查看此日志,當您單擊觸發文件時,服務器似乎未處於一致狀態,這將導致服務器在嘗試完成啟動序列時關閉。 如果您確定日志傳送正常運行,則應該能夠啟動它。 希望這可以幫助。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.