버카도 상태 문제.

6084 단어 PostgreSQLbucaro
Bucardo를 PostgreSQL로 하는 두 개의 주 또는 주종은 예를 들어 A 서버에 Bucardo를 배치하여 B 서버에 A 서버의 데이터를 실시간으로 동기화하는데 만약에 B 서버가 끊기면 Bucardo의 상태에 영향을 줄 수 있다.하지만 이 상태는 세분화해야 내려갈 수 있다.
하나,
환경:
PostgreSQL 9.3.5
Bucardo 5.3.0
A와 B는 Bucardo를 통해 동기화됩니다.
2. 상태 모니터링
-- B DB, sync_adm , 
[postgres@his-db02 ~]$ bucardo status
PID of Bucardo MCP: 25822
 Name       State    Last good    Time     Last I/D    Last bad    Time  
==========+========+============+========+===========+===========+=======
 sync_adm | Good   | 11:18:12   | 9m 30s | 0/0       | none      |     

-- sync_adm 
[postgres@his-db02 ~]$ bucardo status sync_adm
======================================================================
Last good                : Jan 23, 2015 11:18:12 (time to run: 1s)
Rows deleted/inserted    : 0 / 0
Sync name                : sync_adm
Current state            : Good
Source relgroup/database : herd_adm / source_db_adm
Tables in sync           : 1
Status                   : Stalled
Check time               : None
Overdue time             : 00:00:00
Expired time             : 00:00:00
Stayalive/Kidsalive      : Yes / Yes
Rebuild index            : No
Autokick                 : Yes
Onetimecopy              : No
Post-copy analyze        : Yes
Last error:              : 
======================================================================
이때 이 상태가 Stalled인 것을 볼 수 있습니다. 양쪽의 동기화가 끊어졌습니다. 이때 bucardo를 다시 시작해야 합니다. 다시 시작하면 자동으로 동기화됩니다. 만약에 주종만 한다면 Postgre SQL에 내장된 Replication stream보다 못하지만 동기화의 입도는 표급이고 내장된 흐름 복제보다 더 가늘다는 장점이 있습니다.
3. 일지
(25862) [Fri Jan 23 10:57:17 2015] KID (sync_adm) Totals: deletes=1 inserts=1 conflicts=0
(25862) [Fri Jan 23 10:57:51 2015] KID (sync_adm) Delta count for source_db_adm.public.test_ken : 1
(25862) [Fri Jan 23 10:57:51 2015] KID (sync_adm) Totals: deletes=1 inserts=1 conflicts=0
(25822) [Fri Jan 23 11:17:49 2015] MCP Ping failed for database target_db_adm, trying to reconnect
(25862) [Fri Jan 23 11:17:49 2015] KID (sync_adm) Kid has died, error is: Ping failed for database "target_db_adm" Line: 5413 
(25862) [Fri Jan 23 11:17:49 2015] KID (sync_adm) Ping failed for database target_db_adm
(25862) [Fri Jan 23 11:17:49 2015] KID (sync_adm) Kid 25862 exiting at cleanup_kid. Sync "sync_adm" public.test_ken Reason: Ping failed for database "target_db_adm" Line: 5413 
(25822) [Fri Jan 23 11:17:49 2015] MCP Starting check_sync_health
(25822) [Fri Jan 23 11:17:49 2015] MCP Database target_db_adm failed ping
(25822) [Fri Jan 23 11:17:49 2015] MCP Warning: Killed (line 44): DBI connect('dbname=admin;port=5432;host=192.168.2.90','postgres',...) failed: could not connect to server: Connection refused
        Is the server running on host "192.168.2.90" and accepting
        TCP/IP connections on port 5432? at Bucardo.pm line 5644
(25822) [Fri Jan 23 11:17:49 2015] MCP Database target_db_adm is unreachable, marking as stalled
(25822) [Fri Jan 23 11:17:49 2015] MCP Marked sync sync_adm as stalled
(29392) [Fri Jan 23 11:17:50 2015] KID (sync_adm) New kid, sync "sync_adm" alive=1 Parent=25848 PID=29392 kicked=1 
(29392) [Fri Jan 23 11:17:50 2015] KID (sync_adm) Kid has died, error is: DBI connect('dbname=admin;port=5432;host=192.168.2.90','postgres',...) failed: could not connect to server: Connection refused         Is the server running on host "192.168.2.90" and accepting    TCP/IP connections on port 5432? at Bucardo.pm line 5644 Line: 3213 
(29392) [Fri Jan 23 11:17:50 2015] KID (sync_adm) Missing target_db_adm database handle
(29392) [Fri Jan 23 11:17:50 2015] KID (sync_adm) Kid 29392 exiting at cleanup_kid. Sync "sync_adm" Reason: DBI connect('dbname=admin;port=5432;host=192.168.2.90','postgres',...) failed: could not connect to server: Connection refused   Is the server running on host "192.168.2.90" and accepting        TCP/IP connections on port 5432? at Bucardo.pm line 5644 Line: 3213 
(25822) [Fri Jan 23 11:17:50 2015] MCP Starting check_sync_health
(25822) [Fri Jan 23 11:17:50 2015] MCP Skipping stalled sync sync_adm
(29519) [Fri Jan 23 11:18:01 2015] KID (sync_adm) New kid, sync "sync_adm" alive=1 Parent=25848 PID=29519 kicked=1 
(29519) [Fri Jan 23 11:18:01 2015] KID (sync_adm) Kid has died, error is: DBI connect('dbname=admin;port=5432;host=192.168.2.90','postgres',...) failed: could not connect to server: Connection refused         Is the server running on host "192.168.2.90" and accepting    TCP/IP connections on port 5432? at Bucardo.pm line 5644 Line: 3213 
(29519) [Fri Jan 23 11:18:01 2015] KID (sync_adm) Missing target_db_adm database handle
(29519) [Fri Jan 23 11:18:01 2015] KID (sync_adm) Kid 29519 exiting at cleanup_kid. Sync "sync_adm" Reason: DBI connect('dbname=admin;port=5432;host=192.168.2.90','postgres',...) failed: could not connect to server: Connection refused   Is the server running on host "192.168.2.90" and accepting        TCP/IP connections on port 5432? at Bucardo.pm line 5644 Line: 3213 
(25822) [Fri Jan 23 11:18:01 2015] MCP Starting check_sync_health
(25822) [Fri Jan 23 11:18:01 2015] MCP Skipping stalled sync sync_adm
(29652) [Fri Jan 23 11:18:12 2015] KID (sync_adm) New kid, sync "sync_adm" alive=1 Parent=25848 PID=29652 kicked=1 
(25822) [Fri Jan 23 11:18:49 2015] MCP Database "target_db_adm" Local epoch: 1421983129.73297  DB epoch: 1421983089.30327
(25822) [Fri Jan 23 11:18:49 2015] MCP Database "target_db_adm" Local time: Fri Jan 23 11:18:49 2015  DB time: 2015-01-23 11:18:09.303267+08
(25822) [Fri Jan 23 11:18:49 2015] MCP Database "target_db_adm" Local timezone: CST (+0800)  DB timezone: PRC
(25822) [Fri Jan 23 11:18:49 2015] MCP Database "target_db_adm" Postgres version: 90305
(25822) [Fri Jan 23 11:18:49 2015] MCP Database "target_db_adm" Database port: 5432
(25822) [Fri Jan 23 11:18:49 2015] MCP Database "target_db_adm" Database host: 192.168.2.90

좋은 웹페이지 즐겨찾기