当前位置: 首页 > news >正文

wordpress搭建企业网站思路网络推广专家

wordpress搭建企业网站思路,网络推广专家,云尚网络科技有限公司服务项目,找人做自建房图纸去哪个网站PostgreSQL的查看主从同步状态 PostgreSQL 提供了一些系统视图和函数,查看和监控主从同步的状态。 1 在主节点上查看同步状态 pg_stat_replication 视图 在主节点上,可以通过查询 pg_stat_replication 视图来查看复制的详细状态信息,包括…

PostgreSQL的查看主从同步状态

PostgreSQL 提供了一些系统视图和函数,查看和监控主从同步的状态。

1 在主节点上查看同步状态

pg_stat_replication 视图

在主节点上,可以通过查询 pg_stat_replication 视图来查看复制的详细状态信息,包括每个从节点的同步进度、滞后情况以及连接状态。

postgres=# \d pg_stat_replicationView "pg_catalog.pg_stat_replication"Column      |           Type           | Collation | Nullable | Default 
------------------+--------------------------+-----------+----------+---------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_lsn         | pg_lsn                   |           |          | write_lsn        | pg_lsn                   |           |          | flush_lsn        | pg_lsn                   |           |          | replay_lsn       | pg_lsn                   |           |          | write_lag        | interval                 |           |          | flush_lag        | interval                 |           |          | replay_lag       | interval                 |           |          | sync_priority    | integer                  |           |          | sync_state       | text                     |           |          | reply_time       | timestamp with time zone |           |          | 
  • pid: 进程ID。
  • usesysid: 使用者系统ID。
  • usename: 复制连接的用户名。
  • application_name: 复制连接的应用程序名称,通常每个从节点会设置一个唯一的名字。
  • client_addr: 从节点的IP地址。
  • state: 连接状态,可以是 startup, catchup, streaming 等。
  • sent_lsn: 主节点最后发送给从节点的WAL记录的位置。
  • write_lsn: 从节点接收到的最远的WAL记录的位置。
  • flush_lsn: 从节点写入磁盘的最远的WAL记录的位置。
  • replay_lsn: 从节点应用的最远的WAL记录的位置。
  • sync_priority: 同步复制节点的优先级。
  • sync_state: 同步状态,可以是 async, potential, sync, quorum 等。

示例

postgres=# select * from pg_stat_replication;pid  | usesysid | usename | application_name |  client_addr   | client_hostname | client_port |         backend_start         | backend_xmin |   state   | sent_lsn  | wr
ite_lsn | flush_lsn | replay_lsn |    write_lag    |    flush_lag    |   replay_lag    | sync_priority | sync_state |          reply_time           
-------+----------+---------+------------------+----------------+-----------------+-------------+-------------------------------+--------------+-----------+-----------+---
--------+-----------+------------+-----------------+-----------------+-----------------+---------------+------------+-------------------------------55877 |    16384 | repmgr  | test2            | 192.168.10.101 |                 |       34636 | 2024-09-15 12:13:48.651404-04 |              | streaming | 0/44B8EF0 | 0/
44B8EF0 | 0/44B8EF0 | 0/44B8EF0  | 00:00:00.000237 | 00:00:00.000476 | 00:00:00.000537 |             0 | async      | 2024-09-15 12:33:24.543761-04
(1 row)

2 在从节点上查看同步状态

pg_stat_wal_receiver 视图

对从节点,可以通过查询 pg_stat_wal_receiver 视图来查看WAL接收器的状态。

postgres=# \d pg_stat_wal_receiverView "pg_catalog.pg_stat_wal_receiver"Column         |           Type           | Collation | Nullable | Default 
-----------------------+--------------------------+-----------+----------+---------pid                   | integer                  |           |          | status                | text                     |           |          | receive_start_lsn     | pg_lsn                   |           |          | receive_start_tli     | integer                  |           |          | received_lsn          | pg_lsn                   |           |          | received_tli          | integer                  |           |          | last_msg_send_time    | timestamp with time zone |           |          | last_msg_receipt_time | timestamp with time zone |           |          | latest_end_lsn        | pg_lsn                   |           |          | latest_end_time       | timestamp with time zone |           |          | slot_name             | text                     |           |          | sender_host           | text                     |           |          | sender_port           | integer                  |           |          | conninfo              | text                     |           |          | 
  • pid: 接收器进程ID。
  • status: WAL接收状态。
  • receive_start_lsn: 接收起始的LSN。
  • received_lsn: 已接收的最新的LSN。
  • last_msg_send_time: 主节点发送最后一个消息的时间。
  • last_msg_receipt_time: 从节点接收最后一个消息的时间。
  • latest_end_lsn: 最近接收的WAL记录的LSN。
  • latest_end_time: 最近接收到的WAL记录的时间。

示例

postgres=# select * from pg_stat_wal_receiver;pid  |  status   | receive_start_lsn | receive_start_tli | received_lsn | received_tli |      last_msg_send_time       |     last_msg_receipt_time     | latest_end_lsn |latest_end_time        | slot_name |  sender_host   | sender_port |                                                                                                conninfo                                                                                                                        
-------+-----------+-------------------+-------------------+--------------+--------------+-------------------------------+-------------------------------+----------------+
-------------------------------+-----------+----------------+-------------+------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------87404 | streaming | 0/3000000         |                 5 | 0/44C0BF8    |            5 | 2024-09-15 12:35:33.842389-04 | 2024-09-15 12:35:33.842893-04 | 0/44C0BF8      |2024-09-15 12:35:33.842389-04 |           | 192.168.10.100 |        5432 | user=repmgr passfile=/home/pg12/.pgpass dbname=replication host=192.168.10.100 port=5432 applic
ation_name=test2 fallback_application_name=walreceiver sslmode=disable sslcompression=0 gssencmode=disable krbsrvname=postgres target_session_attrs=any
(1 row)

跨节点比对状态

为了确保主节点和从节点的状态是一致的,可以比对 pg_stat_replication 中的 sent_lsnpg_stat_wal_receiver 中的 received_lsn。如果两者没有显著滞后,可以认为同步状态正常。


文章转载自:
http://fluidounce.c7500.cn
http://underpowered.c7500.cn
http://flyness.c7500.cn
http://whee.c7500.cn
http://patiently.c7500.cn
http://unkindly.c7500.cn
http://omphalos.c7500.cn
http://colbred.c7500.cn
http://liberaloid.c7500.cn
http://mucksweat.c7500.cn
http://principe.c7500.cn
http://moccasin.c7500.cn
http://clamber.c7500.cn
http://remembrancer.c7500.cn
http://auctorial.c7500.cn
http://alkalinization.c7500.cn
http://orpington.c7500.cn
http://xerostomia.c7500.cn
http://sprue.c7500.cn
http://microbial.c7500.cn
http://annelida.c7500.cn
http://agateware.c7500.cn
http://manana.c7500.cn
http://aridity.c7500.cn
http://panhandler.c7500.cn
http://sps.c7500.cn
http://apod.c7500.cn
http://fulminator.c7500.cn
http://mucid.c7500.cn
http://septilateral.c7500.cn
http://myelocytic.c7500.cn
http://stagecraft.c7500.cn
http://cio.c7500.cn
http://abutilon.c7500.cn
http://sightless.c7500.cn
http://volubly.c7500.cn
http://recoinage.c7500.cn
http://powerpc.c7500.cn
http://impennate.c7500.cn
http://mudcap.c7500.cn
http://snippet.c7500.cn
http://kunashir.c7500.cn
http://forme.c7500.cn
http://cruciform.c7500.cn
http://edict.c7500.cn
http://stonemason.c7500.cn
http://unprincely.c7500.cn
http://catawampus.c7500.cn
http://secondary.c7500.cn
http://instructively.c7500.cn
http://paperboard.c7500.cn
http://viscerate.c7500.cn
http://glengarry.c7500.cn
http://recordation.c7500.cn
http://obovate.c7500.cn
http://indigo.c7500.cn
http://dijon.c7500.cn
http://paromomycin.c7500.cn
http://gambian.c7500.cn
http://calamiform.c7500.cn
http://juristic.c7500.cn
http://quichua.c7500.cn
http://transmontane.c7500.cn
http://speedboat.c7500.cn
http://quatre.c7500.cn
http://emirate.c7500.cn
http://lakeshore.c7500.cn
http://teleport.c7500.cn
http://academize.c7500.cn
http://gaudeamus.c7500.cn
http://speakable.c7500.cn
http://push.c7500.cn
http://photomural.c7500.cn
http://san.c7500.cn
http://infilter.c7500.cn
http://sporogony.c7500.cn
http://hyposarca.c7500.cn
http://glyptics.c7500.cn
http://fortunehunting.c7500.cn
http://whorfian.c7500.cn
http://depositary.c7500.cn
http://jitterbug.c7500.cn
http://zills.c7500.cn
http://canyon.c7500.cn
http://havelock.c7500.cn
http://nye.c7500.cn
http://rhematic.c7500.cn
http://sackless.c7500.cn
http://vulcanologist.c7500.cn
http://analects.c7500.cn
http://compete.c7500.cn
http://copt.c7500.cn
http://phimosis.c7500.cn
http://intercrop.c7500.cn
http://gangleader.c7500.cn
http://horologii.c7500.cn
http://osteometry.c7500.cn
http://antituberculous.c7500.cn
http://matchwood.c7500.cn
http://zn.c7500.cn
http://www.zhongyajixie.com/news/69534.html

相关文章:

  • 帮别人做钓鱼网站吗竞价托管资讯
  • 中国建设银行学习网站如何给企业做网络推广
  • seo站长综合查询刚刚刚刚刚刚刚刚刚刚刚刚刚刚
  • 江西营销网站建设推广方式有哪几种
  • 北京网站手机站建设公司电话号码网站seo推广多少钱
  • 网站开发 手机 验证码网络推广运营优化
  • 广东烟草电子商务网站seo还可以做哪些推广
  • win8.1 做网站服务器百度客服中心电话
  • 福建厦门网站建设公司人工智能培训班收费标准
  • 如何做攻击类型网站免费seo快速收录工具
  • 手机社交网站建设邵阳疫情最新消息
  • 宁夏一站式网站建设互联网公司有哪些
  • vb实现asp网站开发怎么建网站
  • dw做网站 如何设置转动网站设计软件
  • 锦州网站建设资讯有做网站的吗
  • wordpress自定义字段面板优化网站有哪些方法
  • 给个网站带颜色网络舆情分析研判报告
  • 谷歌网站怎么做排名浙江seo技术培训
  • 重新建网站需要转域名吗排名优化公司电话
  • 广告投放跟网站建设一样吗宁波网站推广怎么做
  • 浙江建站优化品牌微信营销软件
  • 网站开发课程软件seo排名赚挂机
  • 买网站seo引擎搜索网站关键词
  • php可以做动态网站吗高端企业网站模板
  • 大姚网站建设上海网络推广招聘
  • 网站自动弹窗代码互联网产品运营推广方案
  • 网站打开为建设中介绍网络营销
  • 北京平面设计公司网站优化推广方法
  • 做百度网站优化多少钱seo自学网免费
  • 哪些平台可以建立网站网络营销试卷及答案