PostgreSQL学习篇16.3 检查备库及流复制情况
来源:互联网 发布:淘宝安娜整容前后照片 编辑:程序博客网 时间:2024/06/05 11:54
检查异步流复制情况:主库查询:select pid,state,client_addr,sync_priority,sync_state from pg_stat_replication;postgres=# \d pg_stat_replication; View "pg_catalog.pg_stat_replication" Column | Type | Modifiers------------------+--------------------------+----------- pid | integer | usesysid | oid | usename | name | application_name | text | client_addr | inet | client_hostname | text | client_port | integer | backend_start | timestamp with time zone | backend_xmin | xid | state | text | sent_location | pg_lsn | write_location | pg_lsn | flush_location | pg_lsn | replay_location | pg_lsn | sync_priority | integer | sync_state | text | 查看备库落后主库多少字节的WAL日志:select pg_xlog_location_diff(pg_current_xlog_location(),replay_location) from pg_stat_replication;检查同步流复制的情况:select pid,state,client_addr,sync_priority,sync_state from pg_stat_replication;将主库上WAL位置转换为WAL文件名和偏移量:select * from pg_xlogfile_name_offset('');postgres=# select write_location from pg_stat_replication; write_location---------------- 0/15008550(1 row)postgres=# select * from pg_xlogfile_name_offset('0/15008550'); file_name | file_offset--------------------------+------------- 000000010000000000000015 | 34128(1 row)postgres=#查看备库状态:select pg_is_in_recovery(); --主库为f,备库为t如果不能连进去,可以用命令行工具:pg_controldata在hot standby,查看备库接收WAL日志和应用WAL日志的状态:pg_last_xlog_receive_location()pg_last_xlog_replay_location()pg_last_xact_replay_timestamp()
0 0
- PostgreSQL学习篇16.3 检查备库及流复制情况
- PostgreSQL学习篇16.2 同步流复制的standby数据库
- PostgreSQL数据库学习--流复制配置
- 检查学习情况
- Postgresql主备同步流复制及主备切换、IP漂移
- postgresql双机热备(流复制)及主备切换
- postgresql双机热备(流复制)及主备切换
- Postgresql 异步流复制 详解及配置切换
- postgresql 异步流复制
- postgresql流复制配置
- postgresql流复制
- Postgresql 异步流复制
- Postgresql 同步流复制
- Postgresql流复制
- postgresql 流复制切换
- PostgreSQL学习第十六篇 异步流复制Hot Standby的示例
- Postgresql 流复制同步模式
- postgresql异步流复制实现
- 【LeetCode题解】链表Linked Lis
- JVM内存管理
- CSS样式中margin、padding、border、content的区别
- 大数运算-PAT-A1023.Have Fun with Numbers
- Java中的Servlet
- PostgreSQL学习篇16.3 检查备库及流复制情况
- DotNetBat中supergridcontrol控件一些使用技巧
- 学习HLSL以来的一点心得(一):调试
- 48、Power Query-大量复杂数据的整理汇总
- 第三方开源库:TextView相关:MarqueeView
- 数据结构与算法--链表(1)
- 开源大数据处理工具汇总(上)
- 启动tomcat的时候就报错“Server Tomcat v7.0 Server at localhost failed to start.”
- instancetype