👋 你好,我是寻雾

记录软件工程、分布式系统、云原生与 AI 的学习、实践与思考。

【读点论文】What’s Really New with NewSQL?

本篇论文是 2016 年 CMU 发表的一篇介绍 NewSQL 发展的综述论文,主要对新兴 NewSQL 数据库的起源、分类以及主要技术原理做了介绍,其中对数据库发展历史、NewSQL 实现原理的介绍非常值得一读。 ...

2025-01-10 · 8 分钟 · 寻雾

【读书笔记】《A Philosophy of Software Design》

The most fundamental problem in computer science is problem decomposition: how to take a complex problem and divide it up into pieces that can be solved independently. It’s all about complexity. Complexity Complexity is anything related to the structure of a software system that makes it hard to understand and modify the system. Complexity manifests itself in three general ways: Change amplification: a seemingly simple change requires code modifications in many different places. ...

2025-01-10 · 2 分钟 · 寻雾

AWS NAT Gateway 使用简记

最近项目遇到个需求,需要将后端的服务器出口统一成一个 IP,服务器在 AWS 上,这个可以用 AWS 的 NAT Gateway 实现,调研实施的过程中发现如果对 AWS 相关概念不熟悉的话会绕点路的,这里简单整理下,希望对需要的小伙伴有帮助。 ...

2024-10-30 · 4 分钟 · 寻雾

【动手实验】MySQL 客户端 SocketTimeout 问题抓包分析

实验准备 服务端环境准备 服务器信息 阿里云 99 大洋白嫖机 1 2 [root@t01 ~]# cat /proc/version Linux version 5.10.134-18.al8.x86_64 (mockbuild@h87c01383.na61) (gcc (GCC) 10.2.1 20200825 (Alibaba 10.2.1-3.8 2.32), GNU ld version 2.35-12.3.al8) #1 SMP Fri Dec 13 16:56:53 CST 2024 安装 JDK, docker, tshark 1 ​yum install -y java-1.8.0-openjdk.x86_64 java-1.8.0-openjdk-devel.x86_64 podman-docker.noarch wireshark 启动 MySQL 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 [root@t01 ~]# docker run -it -d --net=host -e MYSQL_ROOT_PASSWORD=123 --name=mysql mysql:8.0.28 Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg. 233c8ca518d0e8feef367995aee656fffb65b6a2f16a589d2e765f06dad96828 [root@t01 ~]# docker ps Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg. CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 233c8ca518d0 docker.io/library/mysql:8.0.28 mysqld 11 seconds ago Up 12 seconds mysql [root@t01 ~]# docker exec -it mysql sh Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg. # mysql -uroot -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 8 Server version: 8.0.28 MySQL Community Server - GPL Copyright (c) 2000, 2022, Oracle and/or its affiliates. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> \s -------------- mysql Ver 8.0.28 for Linux on x86_64 (MySQL Community Server - GPL) Connection id: 8 Current database: Current user: root@localhost SSL: Not in use Current pager: stdout Using outfile: '' Using delimiter: ; Server version: 8.0.28 MySQL Community Server - GPL Protocol version: 10 Connection: Localhost via UNIX socket Server characterset: utf8mb4 Db characterset: utf8mb4 Client characterset: latin1 Conn. characterset: latin1 UNIX socket: /var/run/mysqld/mysqld.sock Binary data as: Hexadecimal Uptime: 23 sec Threads: 2 Questions: 5 Slow queries: 0 Opens: 117 Flush tables: 3 Open tables: 36 Queries per second avg: 0.217 -------------- 初始化 MySQL 密码、数据库 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 CREATE DATABASE test CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123'; CREATE USER 'test'@'%' IDENTIFIED BY '123'; GRANT ALL PRIVILEGES ON test.* TO test@'%'; FLUSH PRIVILEGES; # 创建表 create table t_user ( id bigint(20) unsigned not null auto_increment primary key comment 'primary key', name varchar(64) not null default '' comment 'user name', age tinyint unsigned not null default 0 comment '年龄', gender tinyint unsigned not null default 0 comment '性别, 0 男,1 女', create_at datetime(3) not null default current_timestamp(3) comment 'record create date', update_at datetime(3) not null default current_timestamp(3) on update current_timestamp(3) comment 'record update date' ) engine = innodb default charset = utf8mb4 collate = utf8mb4_unicode_ci comment '用户表'; # 插入数据 insert into t_user (id, name, age) values (1, "tom", 18); 执行查询 1 2 3 4 5 6 7 8 9 10 mysql> select sleep(10), id, name from t_user where id = 100; Empty set (0.00 sec) mysql> select sleep(10), id, name from t_user where id = 1; +-----------+----+------+ | sleep(10) | id | name | +-----------+----+------+ | 0 | 1 | tom | +-----------+----+------+ 1 row in set (10.00 sec) 能查到数据时,sleep 生效 数据不存在时,sleep 不生效 服务端抓包命令 ...

2023-09-02 · 5 分钟 · 寻雾

【动手实验】TCP orphan socket 的产生与消亡

之前在实验中提到了 tcp_max_orphans 和 tcp_orphan_retries 两个参数,我们使用 ss -s 命令查看当前系统中的 socket 状态也有 orphan 状态的 socket,本篇文章我们就来分析下到底什么情况下的 socket 才会被视为 orphan socket。 ...

2023-09-02 · 14 分钟 · 寻雾

【动手实验】TCP 连接的建立与关闭抓包分析

本文是基于知识星球程序员踩坑案例分享中的作业进行的复现和总结,借此加深对 TCP 协议的理解, 原文参见TCP 连接的建立和关闭 —— 强烈建议新手看看。 实验环境 这里使用两台位于同一子网的腾讯云服务器,IP 分别是 node2(172.19.0.12)和 node3(172.19.0.15),内核版本均为 5.15.0-130-generic。 ...

2023-09-02 · 24 分钟 · 寻雾

【动手实验】TCP 数据的发送与接收抓包分析

重传 实验环境 这里使用两台腾讯云服务器:vm-1(172.19.0.3)和vm-2(172.19.0.6)。 超时重传 首先 vm-1 作为服务端启动 nc,然后开启抓包,并使用 netstat 查看连接状态: ...

2023-09-02 · 11 分钟 · 寻雾