我想在2臺Web服務器上運行pgpool,這些服務器還有一個Rails應用等。這個想法是通過slony或流的複製以及通過pgpool進行故障轉移。如果查詢與replca平衡,並且Web服務器連接集中起來,但最重要的是獲得master_slave和故障轉移的工作,這也很好。在master_slave模式下配置pgpool無法驗證後端
我從Ubuntu 10.04 LTS上的apt軟件包中安裝了pgpool 3.4.1版本(lainihi)。 db01是master並通過slony複製到db02。我pgpool.conf看起來是這樣的:
# configure frontend
listen_addresses = 'localhost'
port = 5432
# configure the backends
backend_host_name = 'db01'
backend_port = 5432
secondary_backend_host_name = 'db02'
secondary_backend_port = 5432
# uncomment this and pgpool fails to connect
#master_slave_mode = true
#master_slave_sub_mode = 'slony'
它現在工作在「原始模式」,我不知道我將獲得多少與master_slave?無論如何,如果我取消了master_slave =真我得到folling當我連接:
# psql -h localhost -U XXX -W
Password for user XXX:
psql: server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
在pgpool日誌我看到
以下
2011-01-13 02:03:17 DEBUG: pid 24144: I am 24144 accept fd 6
2011-01-13 02:03:17 DEBUG: pid 24144: Protocol Major: 1234 Minor: 5679 database: user:
2011-01-13 02:03:17 DEBUG: pid 24144: SSLRequest: sent N; retry startup
2011-01-13 02:03:17 DEBUG: pid 24144: Protocol Major: 3 Minor: 0 database: XXX user: XXX
2011-01-13 02:03:17 DEBUG: pid 24147: I am 24147 accept fd 6
2011-01-13 02:03:17 DEBUG: pid 24147: Protocol Major: 3 Minor: 0 database: XXX user: XXX
2011-01-13 02:03:17 DEBUG: pid 24144: pool_read_message_length: lenghth: 12
2011-01-13 02:03:17 DEBUG: pid 24144: trying md5 authentication
2011-01-13 02:03:17 DEBUG: pid 24144: master: 1 salt: 8bcce867
2011-01-13 02:03:17 DEBUG: pid 24147: pool_read_message_length: lenghth: 12
2011-01-13 02:03:17 DEBUG: pid 24147: trying md5 authentication
2011-01-13 02:03:17 DEBUG: pid 24147: master: 1 salt: bb5f7a63
2011-01-13 02:03:17 DEBUG: pid 24144: master: 0 salt: 5abb8e55
2011-01-13 02:03:17 DEBUG: pid 24144: do_md5: backend does not return R while processing MD5 authentication E
2011-01-13 02:03:17 ERROR: pid 24144: pool_do_auth: backend does not return authenticaton ok
2011-01-13 02:03:17 DEBUG: pid 24147: master: 0 salt: 4c1e5953
2011-01-13 02:03:17 DEBUG: pid 24147: do_md5: backend does not return R while processing MD5 authentication E
2011-01-13 02:03:17 ERROR: pid 24147: pool_do_auth: backend does not return authenticaton ok
好像pgpool不能與後端進行身份驗證,但我可以使用psql從每個客戶端連接到每個後端服務器,正如我所說的,pgpool以「原始模式」工作。
獲得配置pgpool的任何幫助將不勝感激。它看起來是一個很好的解決方案,但設置起來比預期的要困難得多。
TIA,
丹尼斯