ChenHuajun / pha4pgsql

Pacemaker High Availability for PostgreSQL
GNU General Public License v3.0
62 stars 29 forks source link

PG双节点集群,Can't obtain distributed lock on promote #18

Open ZSH9053 opened 3 years ago

ZSH9053 commented 3 years ago

今天早上看到PG备库挂了,cls_status 看到的是 备库:Can't obtain distributed lock on promote 这个有啥解决办法吗?仲裁节点正常。

ZSH9053 commented 3 years ago

Dec 17 03:51:06 jy-crm-pgsql-prod-db02 expgsql(pgsql)[224191]: ERROR: Can't obtain distributed lock on promote. Dec 17 03:51:06 jy-crm-pgsql-prod-db02 expgsql(pgsql)[224191]: ERROR: Can't obtain distributed lock on promote. Dec 17 03:51:06 jy-crm-pgsql-prod-db02 expgsql(pgsql)[224798]: INFO: Stopping PostgreSQL on demote. Dec 17 03:51:06 jy-crm-pgsql-prod-db02 expgsql(pgsql)[224798]: INFO: Stopping PostgreSQL on demote. Dec 17 03:51:06 jy-crm-pgsql-prod-db02 expgsql(pgsql)[224798]: INFO: stop_escalate(or stop_escalate_in_slave) time is adjusted to 50 based on the configured timeout. Dec 17 03:51:06 jy-crm-pgsql-prod-db02 expgsql(pgsql)[224798]: INFO: stop_escalate(or stop_escalate_in_slave) time is adjusted to 50 based on the configured timeout. Dec 17 03:51:06 jy-crm-pgsql-prod-db02 expgsql(pgsql)[224798]: INFO: server shutting down Dec 17 03:51:06 jy-crm-pgsql-prod-db02 expgsql(pgsql)[224798]: INFO: server shutting down Dec 17 03:51:11 jy-crm-pgsql-prod-db02 expgsql(pgsql)[224798]: INFO: PostgreSQL is down Dec 17 03:51:11 jy-crm-pgsql-prod-db02 expgsql(pgsql)[224798]: INFO: PostgreSQL is down Dec 17 03:51:11 jy-crm-pgsql-prod-db02 expgsql(pgsql)[224798]: INFO: Removing /var/lib/pgsql/tmp/PGSQL.lock. Dec 17 03:51:11 jy-crm-pgsql-prod-db02 expgsql(pgsql)[224798]: INFO: Removing /var/lib/pgsql/tmp/PGSQL.lock. Dec 17 03:51:11 jy-crm-pgsql-prod-db02 expgsql(pgsql)[224798]: INFO: Changing pgsql-status on jy-crm-pgsql-prod-db02 : HS:sync->STOP. Dec 17 03:51:11 jy-crm-pgsql-prod-db02 expgsql(pgsql)[224798]: INFO: Changing pgsql-status on jy-crm-pgsql-prod-db02 : HS:sync->STOP. Dec 17 03:51:12 jy-crm-pgsql-prod-db02 expgsql(pgsql)[225357]: INFO: PostgreSQL is already stopped. Dec 17 03:51:12 jy-crm-pgsql-prod-db02 expgsql(pgsql)[225357]: INFO: PostgreSQL is already stopped.

ChenHuajun commented 3 years ago

看下主库是否正常。主库正常时备库不应该去抢锁,出现这种情况可能是备库以为主库故障了, 看下备库和主库间的corosync的通讯是否出现异常。