pgpool [child0] pid 180: LOG: authentication failed for user "postgres"
pgpool [child0] pid 180: ERROR: password authentication failed for user "postgres"
用户 “postgres” 的认证失败,密码错误。
连接池状态
1
2
pgpool [child0] pid 180: LOG: pool_connection_pool: Creating pool for node 0 database:postgres user:postgres
pgpool [child0] pid 180: LOG: pool_connection_pool: Creating pool for node 1 database:postgres user:postgres
为节点 0 和节点 1 创建连接池。
3.4 健康检查日志
健康检查开始
1
pgpool [health_check0] pid 181: LOG: health check started for node 0
开始对节点 0 进行健康检查。
健康检查成功
1
pgpool [health_check0] pid 181: LOG: health check succeeded for node 0
节点 0 的健康检查成功。
健康检查失败
1
2
pgpool [health_check0] pid 181: WARNING: health check failed for node 0
pgpool [health_check0] pid 181: LOG: health check retrying for node 0 (1/3)
节点 0 的健康检查失败,正在进行第 1 次重试(共 3 次)。
节点宕机
1
2
pgpool [health_check0] pid 181: WARNING: health check failed for node 0 (3/3)
pgpool [health_check0] pid 181: LOG: set node 0 status to NODE_DOWN
节点 0 的健康检查连续 3 次失败,将节点状态设置为宕机。
3.5 负载均衡日志
查询路由
1
2
pgpool [child0] pid 180: LOG: statement: SELECT * FROM users WHERE id = 1
pgpool [child0] pid 180: LOG: routing query to node 0
将查询 “SELECT * FROM users WHERE id = 1” 路由到节点 0。
负载均衡决策
1
pgpool[child0]pid180:LOG:loadbalancingnode:1
负载均衡选择了节点 1 处理请求。
3.6 复制延迟日志
1
2
pgpool [child0] pid 180: LOG: replication delay for node 1 is 10 seconds
pgpool [child0] pid 180: WARNING: replication delay for node 1 exceeds threshold (10 > 5)
节点 1 的复制延迟为 10 秒,超过了设定的阈值 5 秒。
3.7 启动和关闭日志
启动日志
1
2
3
4
pgpool [main] pid 179: LOG: starting Pgpool-II 4.3.0
pgpool [main] pid 179: LOG: setting up socket for 0.0.0.0:5432
pgpool [main] pid 179: LOG: setting up socket for 0.0.0.0:9898
pgpool [main] pid 179: LOG: Pgpool-II successfully started
这组日志记录了 Pgpool-II 的启动过程。
关闭日志
1
2
3
4
pgpool [main] pid 179: LOG: shutting down
pgpool [main] pid 179: LOG: waiting for all children to exit
pgpool [main] pid 179: LOG: all children have exited
pgpool [main] pid 179: LOG: Pgpool-II shutdown complete
这组日志记录了 Pgpool-II 的关闭过程。
4. 错误日志分析
4.1 常见错误模式
连接错误
1
2
pgpool [child0] pid 180: ERROR: connection to backend failed
pgpool [child0] pid 180: DETAIL: host=postgres-primary port=5432 was not reachable
无法连接到后端数据库服务器。
配置错误
1
2
pgpool [main] pid 179: ERROR: invalid value for parameter "max_pool": 0
pgpool [main] pid 179: DETAIL: max_pool must be between 1 and 65535
配置参数 “max_pool” 的值无效。
认证错误
1
pgpool [child0] pid 180: ERROR: pool_passwd file does not contain entry for "postgres"
pool_passwd 文件中没有用户 “postgres” 的条目。
4.2 严重错误
1
2
pgpool [main] pid 179: FATAL: failed to bind socket: Address already in use
pgpool [main] pid 179: HINT: Another Pgpool-II process is using the port 5432