摘要: binlog 和 redolog 的持久化问题 对于 MySQL 来说,只要 binlog 和 redolog 都能正确持久化到磁盘上,就可以保证数据不丢失了。 binlog binlog cache >page cache > disk cache 到 cache 是write的过程,page c 阅读全文
posted @ 2022-04-30 13:34 y_dou 阅读(194) 评论(0) 推荐(0)
摘要: pg_wait_sampling 安装 # su - postgres $ git clone https://github.com/postgrespro/pg_wait_sampling.git $ cd pg_wait_sampling $ make USE_PGXS=1 $ sudo mak 阅读全文
posted @ 2022-04-24 16:36 y_dou 阅读(254) 评论(0) 推荐(0)
摘要: TCP KEEPALIVE FOR A BETTER POSTGRESQL EXPERIENCE【译】 如果您听说过 TCP keepalive 但不确定那是什么,请继续阅读。如果您曾经对以下错误消息感到惊讶: server closed the connection unexpectedly SS 阅读全文
posted @ 2022-04-20 11:37 y_dou 阅读(4952) 评论(0) 推荐(1)
摘要: 识别/回收索引碎片 create extension pgstattuple; postgres=# SELECT * FROM pgstatindex('idx_fragmented'); -[ RECORD 1 ] + version | 4 tree_level | 2 index_size 阅读全文
posted @ 2022-04-13 15:00 y_dou 阅读(911) 评论(0) 推荐(1)
摘要: MYSQL的复制方式: 异步:主库提交后就立即返回结果 同步:主库执行完,所有从库都回放改事务后,才返回 半同步:主库执行完,等待至少一个从库接受并写到relaylog中,才返回,超时后退化为异步 半同步复制的“半”体现在,虽然主从库的Binlog是同步的,但主库不会等待从库执行完Relay-log 阅读全文
posted @ 2022-03-16 22:51 y_dou 阅读(249) 评论(0) 推荐(0)
摘要: 背景: 生产环境中在重做备机的时候 pg_basebackup -D -P -v --wal -method=steam 发现数据目录大小一直未增长,但是basebackup的进程还一直在,就夯住了,想到去看下执行pg_basebackup的前提都有哪些,以及官方文档是怎么描述的: 在备份的开始时, 阅读全文
posted @ 2022-03-11 14:39 y_dou 阅读(1403) 评论(2) 推荐(0)
摘要: 原文https://blog.csdn.net/weixin_39540651/article/details/108227188 【等保用】 在oracle中我们可以通过设置FAILED_LOGIN_ATTEMPTS来限制用户密码登录错误的次数,但是在postgresql中是不支持这个功能的。尽管 阅读全文
posted @ 2022-02-22 15:50 y_dou 阅读(1171) 评论(0) 推荐(0)
摘要: 目的 使用两台机器测试prometheus,监控机器指标和postgresql指标 server1 安装prometheus server和grafana server2 安装 node_exporter和postgres_exporter 安装 wget https://github.com/pr 阅读全文
posted @ 2022-02-19 18:50 y_dou 阅读(2410) 评论(0) 推荐(1)
摘要: 列级权限 grant select on column to 行级权限 Command: CREATE POLICY Description: define a new row-level security policy for a table Syntax: CREATE POLICY name 阅读全文
posted @ 2022-02-18 14:56 y_dou 阅读(444) 评论(0) 推荐(0)
摘要: 第一章体系机构和存储引擎 [root@pg1 sbin]# mysql --help | grep my.cnf order of preference, my.cnf, $MYSQL_TCP_PORT, /etc/my.cnf /etc/mysql/my.cnf /usr/etc/my.cnf ~ 阅读全文
posted @ 2022-02-17 16:42 y_dou 阅读(31) 评论(0) 推荐(0)