Memo
共 45 条移除 ZooKeeperServer not running 日志
fd 'zookeeper.log.*' -x sd '[^\n]*ZooKeeperServer not running\n' '' {}
使用 Docker Compose 运行 node-exporter
services:
node_exporter:
image: quay.io/prometheus/node-exporter:latest
container_name: node-exporter
command:
- '--path.rootfs=/host'
network_mode: host
pid: host
restart: unless-stopped
volumes:
- '/:/host:ro,rslave'
按内容查询 Git 提交
git log -S '<your-query-keyword>' --format='%h %s' --source --all
顺序一致性与线性一致性
Zab 保证顺序一致性,Raft 通常提供线性一致性语义。顺序一致性不带真实时间约束,因此读操作在语义上可能返回旧值;线性一致性则要求结果符合现实中的先后顺序。
对于分布式协调服务,单客户端 FIFO 不等于所有客户端都能得到线性一致读。
使用 nftables 模拟丢包
丢弃目标端口的入站 TCP 流量:
sudo nft create table ip filter
sudo nft add chain ip filter input { type filter hook input priority 0 \; }
sudo nft add rule ip filter input tcp dport 3888 counter drop
恢复前先查看 handle,再删除对应规则:
sudo nft list chain ip filter input sudo nft delete rule ip filter input handle n
SQL Server 页面大小
SQL Server 的数据页固定为 8 KB。数据页存放行数据,索引页和系统页则存放定位与组织数据所需的元数据。
ZooKeeper 的 sync + read 不保证严格线性一致读
理论上可通过 sync + read 获得线性一致读,但 ZooKeeper 的 sync 实现并未将其作为空写日志复制。leader 直接向 follower 返回 zxid,未像 Raft 的 ReadIndex 或 lease read 一样确认自己仍是 leader。
网络分区或脑裂的边界条件下,这可能返回旧数据。因此它不满足严格的线性一致读语义,尽管该场景罕见且实现上可以修复。
参考:ZooKeeper 论文阅读。
命令行工具与实用技巧
命令行工具
some one-liners to extract urls, email address, and a dictionary from a text file
Manage your dotfiles across multiple diverse machines, securely.