西维蜀黍

🐒 Software engineer | 📷Photographer | 👹Urban explorer

  • 主页
  • 所有文章
Tag Friends

西维蜀黍

🐒 Software engineer | 📷Photographer | 👹Urban explorer

  • 主页
  • 所有文章

【Redis】Codis 安装

2020-07-25

Prerequisition

安装Go

1
2
$ echo "export GOPATH=/home/parallels/go" > .zshrc
$ echo "export GOROOT=/usr/lib/go-1.14" > .zshrc

安装Java

安装Zookeeper

安装 autoconf

1
$ sudo apt-get install autoconf

手动编译

1
2
3
4
$ sudo mkdir -p $GOPATH/src/github.com/CodisLabs
$ cd $_ && git clone https://github.com/CodisLabs/codis.git -b release3.2
$ echo "export PATH=$GOPATH/src/github.com/CodisLabs/codis/bin:$PATH" > ~/.zshrc
$ sudo make

Binary

1
2
3
$ curl -OL https://github.com/CodisLabs/codis/releases/download/3.2.2/codis3.2.2-go1.8.5-linux.zip
$ unzip codis3.2.2-go1.8.5-linux.zip
$ cd codis3.2.2-go1.8.5-linux

启动

启动 codis-dashboard

1
2
3
4
5
$ # vim config/dashboard.toml
coordinator_name = "zookeeper"
# 这里填你的ZooKeeper的地址
coordinator_addr = "127.0.0.1:2181"
product_name = "codis-demo"

启动

1
2
3
4
$ nohup ./codis-dashboard --ncpu=4 --config=config/dashboard.toml --log=logs/dashboard.log --log-level=WARN &

# 如果开启多个shell tab,则直接以实时查看Log
$ ./codis-dashboard --ncpu=4 --config=config/dashboard.toml

image-20200727222746412

默认工作在18080端口。

1
2
3
4
5
6
7
8
9
10
11
$  ./codis-dashboard -h
Usage:
codis-dashboard [--ncpu=N] [--config=CONF] [--log=FILE] [--log-level=LEVEL] [--host-admin=ADDR] [--pidfile=FILE] [--zookeeper=ADDR|--etcd=ADDR|--filesystem=ROOT] [--product_name=NAME] [--product_auth=AUTH] [--remove-lock]
codis-dashboard --default-config
codis-dashboard --version

Options:
--ncpu=N set runtime.GOMAXPROCS to N, default is runtime.NumCPU().
-c CONF, --config=CONF run with the specific configuration.
-l FILE, --log=FILE set path/name of daliy rotated log file.
--log-level=LEVEL set the log-level, should be INFO,WARN,DEBUG or ERROR, default is INFO.

默认配置文件

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
$ ./codis-dashboard --default-config | tee dashboard.toml

##################################################
# #
# Codis-Dashboard #
# #
##################################################

# Set Coordinator, only accept "zookeeper" & "etcd" & "filesystem".
# for zookeeper/etcd, coorinator_auth accept "user:password"
# Quick Start
coordinator_name = "filesystem"
coordinator_addr = "/tmp/codis"
#coordinator_name = "zookeeper"
#coordinator_addr = "127.0.0.1:2181"
#coordinator_auth = ""

# Set Codis Product Name/Auth.
product_name = "codis-demo"
product_auth = ""

# Set bind address for admin(rpc), tcp only.
admin_addr = "0.0.0.0:18080"

# Set arguments for data migration (only accept 'sync' & 'semi-async').
migration_method = "semi-async"
migration_parallel_slots = 100
migration_async_maxbulks = 200
migration_async_maxbytes = "32mb"
migration_async_numkeys = 500
migration_timeout = "30s"

# Set configs for redis sentinel.
sentinel_client_timeout = "10s"
sentinel_quorum = 2
sentinel_parallel_syncs = 1
sentinel_down_after = "30s"
sentinel_failover_timeout = "5m"
sentinel_notification_script = ""
sentinel_client_reconfig_script = ""
参数 说明
coordinator_name 外部存储类型,接受 zookeeper/etcd
coordinator_addr 外部存储地址
product_name 集群名称,满足正则 \w[\w\.\-]*
product_auth 集群密码,默认为空
admin_addr RESTful API 端口

启动 codis-proxy

codis-proxy 配置

1
2
3
4
# vim config/proxy.toml
product_name = "codis-demo"
jodis_name = "zookeeper"
jodis_addr = "127.0.0.1:2181"
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
$ nohup ./codis-proxy --ncpu=4 --config=config/proxy.toml --log=logs/proxy.log --log-level=WARN &

# 如果开启多个shell tab,则直接以实时查看Log
$ ./codis-proxy --ncpu=4 --config=config/proxy.toml
2020/07/27 22:36:28 main.go:104: [WARN] set ncpu = 4, max-ncpu = 8
2020/07/27 22:36:28 zkclient.go:23: [INFO] zookeeper - zkclient setup new connection to 127.0.0.1:2181
2020/07/27 22:36:28 proxy.go:91: [WARN] [0xc4200a6e70] create new proxy:
{
"token": "620204800e7d3a781457f23ca974dfcb",
"start_time": "2020-07-27 22:36:28.056420238 +0800 +08",
"admin_addr": "192.168.2.204:11080",
"proto_type": "tcp4",
"proxy_addr": "192.168.2.204:19000",
"jodis_path": "/jodis/codis-demo/proxy-620204800e7d3a781457f23ca974dfcb",
"product_name": "codis-demo",
"pid": 21563,
"pwd": "/home/parallels/codis3.2.2-go1.8.5-linux",
"sys": "Linux parallels-Parallels-Virtual-Platform 4.15.0-112-generic #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux",
"hostname": "parallels-Parallels-Virtual-Platform",
"datacenter": ""
}
2020/07/27 22:36:28 zkclient.go:23: [INFO] zookeeper - Connected to 127.0.0.1:2181
2020/07/27 22:36:28 proxy.go:378: [WARN] [0xc4200a6e70] admin start service on [::]:11080
2020/07/27 22:36:28 proxy.go:402: [WARN] [0xc4200a6e70] proxy start service on 0.0.0.0:19000
2020/07/27 22:36:28 main.go:193: [WARN] create proxy with config
...
2020/07/27 22:36:28 main.go:229: [WARN] [0xc4200a6e70] proxy waiting online ...
2020/07/27 22:36:28 zkclient.go:23: [INFO] zookeeper - Authenticated: id=72070581688008724, timeout=20000
2020/07/27 22:36:28 zkclient.go:23: [INFO] zookeeper - Re-submitting `0` credentials after reconnect
2020/07/27 22:36:29 main.go:229: [WARN] [0xc4200a6e70] proxy waiting online ...
2020/07/27 22:36:30 main.go:229: [WARN] [0xc4200a6e70] proxy waiting online ...
2020/07/27 22:36:31 main.go:229: [WARN] [0xc4200a6e70] proxy waiting online ...
2020/07/27 22:36:32 main.go:229: [WARN] [0xc4200a6e70] proxy waiting online ...

我们会发现proxy一直处于waiting online状态,这是因为没有将proxy 与 dashboard关联起来(而将proxy 与 dashboard关联需要我们显式地去操作)。

端口使用

一个codis-proxy 会使用两个端口,一个用于被 redis-cli直接连接(proxy_addr,默认为19000),一个用于管理这个proxy(admin_addr,默认为11080)

1
2
$ redis-cli -h 192.168.2.204 -p 19000
192.168.2.204:19000>
1
2
3
$ lsof -i -P | grep -i "listen" | grep "codis-proxy"
codis-pro 20014 parallels 3u IPv4 2246306 0t0 TCP *:19000 (LISTEN)
codis-pro 20014 parallels 5u IPv6 2246307 0t0 TCP *:11080 (LISTEN)

帮助

1
2
3
4
5
6
7
8
9
10
11
12
$ ./codis-proxy -h
Usage:
codis-proxy [--ncpu=N [--max-ncpu=MAX]] [--config=CONF] [--log=FILE] [--log-level=LEVEL] [--host-admin=ADDR] [--host-proxy=ADDR] [--dashboard=ADDR|--zookeeper=ADDR [--zookeeper-auth=USR:PWD]|--etcd=ADDR [--etcd-auth=USR:PWD]|--filesystem=ROOT|--fillslots=FILE] [--ulimit=NLIMIT] [--pidfile=FILE] [--product_name=NAME] [--product_auth=AUTH] [--session_auth=AUTH]
codis-proxy --default-config
codis-proxy --version

Options:
--ncpu=N set runtime.GOMAXPROCS to N, default is runtime.NumCPU().
-c CONF, --config=CONF run with the specific configuration.
-l FILE, --log=FILE set path/name of daliy rotated log file.
--log-level=LEVEL set the log-level, should be INFO,WARN,DEBUG or ERROR, default is INFO.
--ulimit=NLIMIT run 'ulimit -n' to check the maximum number of open file descriptors.

默认配置文件 proxy.toml

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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
$ ./codis-proxy --default-config | tee proxy.toml

##################################################
# #
# Codis-Proxy #
# #
##################################################

# Set Codis Product Name/Auth.
product_name = "codis-demo"
product_auth = ""

# Set auth for client session
# 1. product_auth is used for auth validation among codis-dashboard,
# codis-proxy and codis-server.
# 2. session_auth is different from product_auth, it requires clients
# to issue AUTH <PASSWORD> before processing any other commands.
session_auth = ""

# Set bind address for admin(rpc), tcp only.
admin_addr = "0.0.0.0:11080"

# Set bind address for proxy, proto_type can be "tcp", "tcp4", "tcp6", "unix" or "unixpacket".
proto_type = "tcp4"
proxy_addr = "0.0.0.0:19000"

# Set jodis address & session timeout
# 1. jodis_name is short for jodis_coordinator_name, only accept "zookeeper" & "etcd".
# 2. jodis_addr is short for jodis_coordinator_addr
# 3. jodis_auth is short for jodis_coordinator_auth, for zookeeper/etcd, "user:password" is accepted.
# 4. proxy will be registered as node:
# if jodis_compatible = true (not suggested):
# /zk/codis/db_{PRODUCT_NAME}/proxy-{HASHID} (compatible with Codis2.0)
# or else
# /jodis/{PRODUCT_NAME}/proxy-{HASHID}
jodis_name = ""
jodis_addr = ""
jodis_auth = ""
jodis_timeout = "20s"
jodis_compatible = false

# Set datacenter of proxy.
proxy_datacenter = ""

# Set max number of alive sessions.
proxy_max_clients = 1000

# Set max offheap memory size. (0 to disable)
proxy_max_offheap_size = "1024mb"

# Set heap placeholder to reduce GC frequency.
proxy_heap_placeholder = "256mb"

# Proxy will ping backend redis (and clear 'MASTERDOWN' state) in a predefined interval. (0 to disable)
backend_ping_period = "5s"

# Set backend recv buffer size & timeout.
backend_recv_bufsize = "128kb"
backend_recv_timeout = "30s"

# Set backend send buffer & timeout.
backend_send_bufsize = "128kb"
backend_send_timeout = "30s"

# Set backend pipeline buffer size.
backend_max_pipeline = 20480

# Set backend never read replica groups, default is false
backend_primary_only = false

# Set backend parallel connections per server
backend_primary_parallel = 1
backend_replica_parallel = 1

# Set backend tcp keepalive period. (0 to disable)
backend_keepalive_period = "75s"

# Set number of databases of backend.
backend_number_databases = 16

# If there is no request from client for a long time, the connection will be closed. (0 to disable)
# Set session recv buffer size & timeout.
session_recv_bufsize = "128kb"
session_recv_timeout = "30m"

# Set session send buffer size & timeout.
session_send_bufsize = "64kb"
session_send_timeout = "30s"

# Make sure this is higher than the max number of requests for each pipeline request, or your client may be blocked.
# Set session pipeline buffer size.
session_max_pipeline = 10000

# Set session tcp keepalive period. (0 to disable)
session_keepalive_period = "75s"

# Set session to be sensitive to failures. Default is false, instead of closing socket, proxy will send an error response to client.
session_break_on_failure = false

# Set metrics server (such as http://localhost:28000), proxy will report json formatted metrics to specified server in a predefined period.
metrics_report_server = ""
metrics_report_period = "1s"

# Set influxdb server (such as http://localhost:8086), proxy will report metrics to influxdb.
metrics_report_influxdb_server = ""
metrics_report_influxdb_period = "1s"
metrics_report_influxdb_username = ""
metrics_report_influxdb_password = ""
metrics_report_influxdb_database = ""

# Set statsd server (such as localhost:8125), proxy will report metrics to statsd.
metrics_report_statsd_server = ""
metrics_report_statsd_period = "1s"
metrics_report_statsd_prefix = ""
参数 说明
product_name 集群名称,参考 dashboard 参数说明
product_auth 集群密码,默认为空
admin_addr RESTful API 端口
proto_type Redis 端口类型,接受 tcp/tcp4/tcp6/unix/unixpacket
proxy_addr Redis 端口地址或者路径
jodis_addr Jodis 注册 zookeeper 地址
jodis_timeout Jodis 注册 session timeout 时间,单位 second
jodis_compatible Jodis 注册 zookeeper 的路径
backend_ping_period 与 codis-server 探活周期,单位 second,0 表示禁止
session_max_timeout 与 client 连接最大读超时,单位 second,0 表示禁止
session_max_bufsize 与 client 连接读写缓冲区大小,单位 byte
session_max_pipeline 与 client 连接最大的 pipeline 大小
session_keepalive_period 与 client 的 tcp keepalive 周期,仅 tcp 有效,0 表示禁止

添加 Proxy方法

codis-proxy 启动后,处于 waiting 状态,监听 proxy_addr 地址,但是不会 accept 连接,添加到集群并完成集群状态的同步,才能改变状态为 online。添加的方法有以下两种:

  • 通过 codis-fe 添加:通过 Add Proxy 按钮,将 admin_addr 加入到集群中;
  • 通过 codis-admin 命令行工具添加,方法如下:
1
$ ./bin/codis-admin --dashboard=127.0.0.1:18080 --create-proxy -x 127.0.0.1:11080

其中 127.0.0.1:18080 以及 127.0.0.1:11080 分别为 dashboard 和 proxy 的 admin_addr 地址;

在本Demo中,我们在Codis FE启动后,再对proxy进行处理。

启动 codis-server

codis-server 配置

1
2
3
4
5
6
# vim config/redis.conf
bind 0.0.0.0
port 6379
daemonize yes
pidfile /var/run/redis-6379.pid
dir /data/redis-data/redis-6379/
1
2
3
4
5
6
$ cd /data
$ sudo mkdir redis-data
$ ./codis-server ./config/redis.conf --log=logs/server.log --log-level=WARN

# 只指定端口
$ ./codis-server --port 6380
  • 启动 ./bin/codis-server,与启动普通 redis 的方法一致(这意味着)。
  • 启动完成后,可以通过 codis-fe 提供的界面或者 codis-admin 命令行工具添加到集群中。

帮助

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
$ ./codis-server -h
Usage: ./redis-server [/path/to/redis.conf] [options]
./redis-server - (read config from stdin)
./redis-server -v or --version
./redis-server -h or --help
./redis-server --test-memory <megabytes>

Examples:
./redis-server (run the server with default conf)
./redis-server /etc/redis/6379.conf
./redis-server --port 7777
./redis-server --port 7777 --slaveof 127.0.0.1 8888
./redis-server /etc/myredis.conf --loglevel verbose

Sentinel mode:
./redis-server /etc/sentinel.conf --sentinel

启动 codis-fe

codis-fe 启动

1
$ nohup ./codis-fe --ncpu=4 --log=logs/fe.log --log-level=WARN --zookeeper=127.0.0.1:2181 --listen=0.0.0.0:8081 &

启动参数说明

1
2
3
4
5
6
7
8
9
10
11
$ ./bin/codis-fe -h
Usage:
codis-fe [--ncpu=N] [--log=FILE] [--log-level=LEVEL] [--assets-dir=PATH] (--dashboard-list=FILE|--zookeeper=ADDR|--etcd=ADDR|--filesystem=ROOT) --listen=ADDR
codis-fe --version

Options:
--ncpu=N 最大使用 CPU 个数
-d LIST, --dashboard-list=LIST 配置文件,能够自动刷新
-l FILE, --log=FILE 设置 log 输出文件
--log-level=LEVEL 设置 log 输出等级:INFO,WARN,DEBUG,ERROR;默认INFO,推荐WARN
--listen=ADDR HTTP 服务端口

配置文件 codis.json 可以手动编辑,也可以通过 codis-admin 从外部存储中拉取,例如:

1
2
3
4
5
6
7
8
9
10
11
$ ./bin/codis-admin --dashboard-list --zookeeper=127.0.0.1:2181 | tee codis.json
[
{
"name": "codis-demo",
"dashboard": "127.0.0.1:18080"
},
{
"name": "codis-demo2",
"dashboard": "127.0.0.1:28080"
}
]

访问 http://192.168.2.204:8081/ ,选择 codis-demo,即我们的 product name(这其实是因为一个 Codis FE 可以管理多个 Codis Dashboard )

image-20200727221144837

添加 proxy

通过web浏览器访问集群管理页面(即 codis-fe,http://192.168.2.204:8081/ ),在 Proxy 栏我们并不能看到任何codis-proxy。

这其实是由于前面说的,即:

codis-proxy 启动后,处于 waiting 状态,监听 proxy_addr 地址,但是不会 accept 连接。

只要添加到集群并完成集群状态的同步,才能改变状态为 online。添加的方法有以下两种:

  • 通过 codis-fe 添加:通过 Add Proxy 按钮,将 admin_addr 加入到集群中;
  • 通过 codis-admin 命令行工具添加,方法如下:
    1
    2
    > $ ./bin/codis-admin --dashboard=127.0.0.1:18080 --create-proxy -x 127.0.0.1:11080
    >

其中 127.0.0.1:18080 以及 127.0.0.1:11080 分别为 dashboard 和 proxy 的 admin_addr 地址;

在添加完成后,就可以看到这个proxy的状态了:

image-20200727225339947

同时,在codis-proxy的log中,也能看到对应的变化

1
2020/07/27 22:53:17 main.go:233: [WARN] [0xc4200a9340] proxy is working ...

添加 codis-group (即codis-server)

Proxy已经设置成功了,但是 Group 栏为空,因为我们启动的 codis-server 并未加入到集群。

image-20200727231701198

GROUP 输入 1,Add Server 输入我们刚刚启动的 codis-server 地址(127.0.0.1:6380),添加到我们刚新建的 Group,然后再点击 Add Server 按钮即可,如上图所示。

image-20200727232156783

这样以后,整个cluster只有一个Group(即codis-group),即 Group 1。

当然,我们可以将更多个codis-server添加到cluster中,并将这些 codis-server 添加到不同的group中,这就是真正意义上的cluster了。

architecture

通过codis-fe初始化slot

新增的集群 slot 状态是 offline,因此我们需要对它进行初始化(将 1024 个 slot 分配到各个 group),而初始化最快的方法可通过 fe 提供的 Rebalance All Slots按钮来做,如下图所示,点击此按钮,我们即快速完成了一个集群的搭建。

image-20200727232802590

连接到codis-proxy

1
2
3
4
5
$ redis-cli -h 192.168.2.204 -p 19000
192.168.2.204:19000> set 1 a
OK
192.168.2.204:19000> set 2 b
OK

当我们进行set 时,就能看到keys的变化:

image-20200727233000059

扩展

添加codis-proxy

1
2
3
4
5
6
7
8
9
10
$ cp config/proxy.toml config/proxy2.toml
$ vim config/proxy2.toml
product_name = "codis-demo"
jodis_name = "zookeeper"
jodis_addr = "127.0.0.1:2181"
admin_addr = "0.0.0.0:11081"
proxy_addr = "0.0.0.0:19001"
$ ./codis-proxy --ncpu=4 --config=config/proxy2.toml
...
2020/07/28 20:49:37 main.go:229: [WARN] [0xc42034c2c0] proxy waiting online ...

启动一个新的codis-proxy,添加其到当前 cluster中:

image-20200728205111235

添加codis-server 作为一个已经存在的codis-group 中的slave节点

1
2
$ ./codis-server --port 6381
...

添加该 codis-server 到 Group 1(这也是 codis-server 6380 位于的 Group)中:

image-20200728210208945

点击 127.0.0.1:6381 那一行对应的小扳手,以将数据从 127.0.0.1:6380 复制到 127.0.0.1:6381,即127.0.0.1:6381 作为 127.0.0.1:6380 的 slave节点。

点击后,会有如下Log:

1
2
3
4
5
6
7
8
9
10
11
17816:S 28 Jul 21:15:47.703 * SLAVE OF 127.0.0.1:6380 enabled (user request from 'id=36 addr=127.0.0.1:53494 fd=40 name= age=0 idle=0 flags=x db=0 sub=0 psub=0 multi=4 qbuf=0 qbuf-free=32768 obl=50 oll=0 omem=0 events=r cmd=exec')
17816:S 28 Jul 21:15:47.908 * Connecting to MASTER 127.0.0.1:6380
17816:S 28 Jul 21:15:47.909 * MASTER <-> SLAVE sync started
17816:S 28 Jul 21:15:47.909 * Non blocking connect for SYNC fired the event.
17816:S 28 Jul 21:15:47.909 * Master replied to PING, replication can continue...
17816:S 28 Jul 21:15:47.910 * Partial resynchronization not possible (no cached master)
17816:S 28 Jul 21:15:47.911 * Full resync from master: 0ee00b25600eef5b71196377532b70e70fdbbe5a:438
17816:S 28 Jul 21:15:48.006 * MASTER <-> SLAVE sync: receiving 87 bytes from master
17816:S 28 Jul 21:15:48.007 * MASTER <-> SLAVE sync: Flushing old data
17816:S 28 Jul 21:15:48.007 * MASTER <-> SLAVE sync: Loading DB in memory
17816:S 28 Jul 21:15:48.008 * MASTER <-> SLAVE sync: Finished with success

可以看到,数据会被同步:

image-20200728211949221

添加codis-server到一个新的codis-group

添加一个新的group,我们设为group 2:

image-20200728212317411

1
2
$ ./codis-server --port 6382
...

添加该 codis-server 到 Group 2中:

image-20200728212347936

这时,所以的数据还只会被存储到 Group 1,因为我们目前还是把所有的slot(slot [0, 1023])分配给了 Group 1,点击”Rebalance All Slots”,以重新分配 slots:

image-20200728214530479

我们随便插入一些数据以做测试:

1
2
3
4
5
6
7
8
9
10
$ 192.168.2.204:19000> set 1 1
OK
192.168.2.204:19000> set 2 2
OK
192.168.2.204:19000> set 3 3
OK
192.168.2.204:19000> set 4 4
OK
192.168.2.204:19000> set sw sw
OK

image-20200728214945256

image-20200728215035940

“Rebalance All Slots”可以帮我们很快的完成 cluster的横向扩展(当cluster的容量或者是CPU 成为 bottleneck时),即通过增加codis-group(每个codis-group中只包含一个 master codis-server),并将 slot 重分配到所有 Group 中(这个过程也称为”Rebalance”)。

Observation

codis-proxy 到codis-server 的connection

codis-proxy 会建立多条连接到codis-server,

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
$ lsof -i -P | grep "codis-pr"

codis-pro 21100 parallels 8u IPv4 2250487 0t0 TCP localhost:60636->localhost:6379 (ESTABLISHED)
codis-pro 21100 parallels 9u IPv4 2252281 0t0 TCP localhost:60638->localhost:6379 (ESTABLISHED)
codis-pro 21100 parallels 10u IPv4 2254068 0t0 TCP localhost:60640->localhost:6379 (ESTABLISHED)
codis-pro 21100 parallels 11u IPv4 2252282 0t0 TCP localhost:60642->localhost:6379 (ESTABLISHED)
codis-pro 21100 parallels 12u IPv4 2252283 0t0 TCP localhost:60644->localhost:6379 (ESTABLISHED)
codis-pro 21100 parallels 13u IPv4 2252284 0t0 TCP localhost:60646->localhost:6379 (ESTABLISHED)
codis-pro 21100 parallels 14u IPv4 2252285 0t0 TCP localhost:60648->localhost:6379 (ESTABLISHED)
codis-pro 21100 parallels 15u IPv4 2254069 0t0 TCP localhost:60650->localhost:6379 (ESTABLISHED)
codis-pro 21100 parallels 16u IPv4 2252286 0t0 TCP localhost:60652->localhost:6379 (ESTABLISHED)
codis-pro 21100 parallels 17u IPv4 2250488 0t0 TCP localhost:60654->localhost:6379 (ESTABLISHED)
codis-pro 21100 parallels 18u IPv4 2253039 0t0 TCP localhost:60656->localhost:6379 (ESTABLISHED)
codis-pro 21100 parallels 19u IPv4 2253040 0t0 TCP localhost:60658->localhost:6379 (ESTABLISHED)
codis-pro 21100 parallels 20u IPv4 2250489 0t0 TCP localhost:60660->localhost:6379 (ESTABLISHED)
codis-pro 21100 parallels 21u IPv4 2250490 0t0 TCP localhost:60662->localhost:6379 (ESTABLISHED)
codis-pro 21100 parallels 22u IPv4 2250491 0t0 TCP localhost:60664->localhost:6379 (ESTABLISHED)
codis-pro 21100 parallels 23u IPv4 2250492 0t0 TCP localhost:60666->localhost:6379 (ESTABLISHED)

而且,可以看到,每启动一个codis-proxy,这个proxy都会和当前active的所有的codis-server建立16个connection:

image-20200728205334109

master codis-server 异常时

当master挂了的时候(这里master node是127.0.0.1:6380),slave在默认情况下并不会主动promote成为master(如果设置了sentinel,则会在出现故障时,自动将 Slave Redis node 转换为 Master Redis node)。

虽然我们可以在dashboard中看到error:

image-20200728214234283

同样,通过proxy 来get 数据也会有error:

1
2
192.168.2.204:19000> get 1
(error) ERR handle response, backend conn reset

master codis-server 增加后

当 master codis-server 增加后,如预期的,codis-proxy会自动和这个 master codis-server 建立连接,以下是在增加了 127.0.0.1:6382 节点之后,且在”rebalance”之后:

1
2
3
$ lsof -i -P | grep "codis-pro" | grep 12955 | grep 6382 | wc -l

16

错误

Codis异常关闭后启动出错

Situation

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
2020/07/27 21:25:06 main.go:171: [WARN] [0xc4202d1680] dashboard online failed [15]
2020/07/27 21:25:08 topom.go:189: [ERROR] store: acquire lock of codis-demo failed
[error]: zk: node already exists
6 /home/travis/gopath/src/github.com/CodisLabs/codis/pkg/models/zk/zkclient.go:247
github.com/CodisLabs/codis/pkg/models/zk.(*Client).create
5 /home/travis/gopath/src/github.com/CodisLabs/codis/pkg/models/zk/zkclient.go:196
github.com/CodisLabs/codis/pkg/models/zk.(*Client).Create.func1
4 /home/travis/gopath/src/github.com/CodisLabs/codis/pkg/models/zk/zkclient.go:129
github.com/CodisLabs/codis/pkg/models/zk.(*Client).shell
3 /home/travis/gopath/src/github.com/CodisLabs/codis/pkg/models/zk/zkclient.go:198
github.com/CodisLabs/codis/pkg/models/zk.(*Client).Create
2 /home/travis/gopath/src/github.com/CodisLabs/codis/pkg/models/store.go:119
github.com/CodisLabs/codis/pkg/models.(*Store).Acquire
1 /home/travis/gopath/src/github.com/CodisLabs/codis/pkg/topom/topom.go:188
github.com/CodisLabs/codis/pkg/topom.(*Topom).Start
0 /home/travis/gopath/src/github.com/CodisLabs/codis/cmd/dashboard/main.go:169
main.main
... ...
[stack]:
1 /home/travis/gopath/src/github.com/CodisLabs/codis/pkg/topom/topom.go:189
github.com/CodisLabs/codis/pkg/topom.(*Topom).Start
0 /home/travis/gopath/src/github.com/CodisLabs/codis/cmd/dashboard/main.go:169
main.main
... ...
2020/07/27 21:25:08 main.go:173: [PANIC] dashboard online failed, give up & abort :'(
[stack]:
0 /home/travis/gopath/src/github.com/CodisLabs/codis/cmd/dashboard/main.go:173
main.main
... ...

codis-dashboard 异常退出的修复

当 codis-dashboard 启动时,会在外部存储上存放一条数据,用于存储 dashboard 信息,同时作为 LOCK 存在。当 codis-dashboard 安全退出时,会主动删除该数据。当 codis-dashboard 异常退出时,由于之前 LOCK 未安全删除,重启往往会失败。因此 codis-admin 提供了强制删除工具:

  1. 确认 codis-dashboard 进程已经退出(很重要);
  2. 运行 codis-admin 删除 LOCK:
1
2
$ ./codis-admin --remove-lock --product=<product name> --zookeeper=<zk address>
# e.g., ./codis-admin --remove-lock --product=codis-demo --zookeeper=127.0.0.1:2181

codis-proxy 异常退出的修复

通常 codis-proxy 都是通过 codis-dashboard 进行移除,移除过程中 codis-dashboard 为了安全会向 codis-proxy 发送 offline 指令,成功后才会将 proxy 信息从外部存储中移除。如果 codis-proxy 异常退出,该操作会失败。此时可以使用 codis-admin 工具进行移除:

  1. 确认 codis-proxy 进程已经退出(很重要);
  2. 运行 codis-admin 删除 proxy:
1
$ ./bin/codis-admin --dashboard=127.0.0.1:18080 --remove-proxy --addr=127.0.0.1:11080 --force

选项 --force 表示,无论 offline 操作是否成功,都从外部存储中将该节点删除。所以操作前,一定要确认该 codis-proxy 进程已经退出。

操作

移除一个 group

1
$ codis-admin --dashboard=codis-dashboard:18080 --group-del --gid=1 --addr=172.17.0.14:6379

当然也可以通过codis-fe来操作:

image-20200727231047140

使所有slot是offline状态

要保证所有slot是offline状态,让所有slot offline命令如下:

1
2
3
4
$ ./codis-admin --dashboard=0.0.0.0:18080 --slots-assign --beg=0 --end=1023 --offline --confirm

# 然后再移除这个 group
$ codis-admin --dashboard=codis-dashboard:18080 --group-del --gid=1 --addr=172.17.0.14:6379

总结

architecture

  • Codis 最大的优点,就是当cluster的容量或者是CPU 成为 bottleneck时,Codis可以帮我们很快的完成 cluster的横向扩展(通过 “Rebalance All Slots”),即通过增加codis-group(每个codis-group中只包含一个 master codis-server),并将 slot 重分配到所有 Group 中(这个过程也称为”Rebalance”)。

  • 每个codis-group中只包含一个 master codis-server,当然可以包含0或多个 slave codis-server

Reference

  • https://github.com/CodisLabs/codis/blob/release3.2/doc/tutorial_zh.md
  • https://blog.csdn.net/u010383937/article/details/83987875
  • https://github.com/CodisLabs/codis/issues/1631
  • Cache System
  • Redis
  • Codis
  • CacheSystem
  • Redis
  • Codis

扫一扫,分享到微信

【Java】安装
【Golang】Golang 安装
© 2020 西维蜀黍
  • Tag
  • Friends

tag:

  • Algorithm Problem
  • AWS
  • Algorithm
  • Architectural Pattern
  • Architecture
  • ArchitectureDesign
  • Nginx
  • Frontend
  • Cache
  • Browser
  • C#
  • Debug
  • Visual Studio
  • Cache System
  • Compile
  • Data Structure
  • JavaScript
  • Data Format
  • Database
  • Design Pattern
  • Distributed System
  • Microservices
  • Django
  • Redis
  • Docker
  • ELK
  • Format
  • Git
  • Version Control
  • Golang
  • HTTP
  • Network
  • Hardware
  • Interview
  • JQuery
  • Java EE
  • Software Testing
  • Java
  • Network Programming
  • LaTeX
  • Linux
  • Operating System
  • Linxu
  • Lock
  • macOS
  • Markdown
  • Lucene
  • Mattermost
  • MySQL
  • Netwok
  • Netwrok
  • Node.js
  • nvm
  • NPM
  • npm
  • OOP
  • OpenWrt
  • Operating Systems
  • Performancede
  • Performance
  • Programming
  • Protobuf
  • Python
  • RaspbeeryPi
  • Codis
  • SQL
  • Regular Expression
  • Security
  • Spring
  • TypeScript
  • VMware
  • Vmware
  • Windows
  • WordPress
  • VPN
  • hexo
  • ZooKeeper
  • iOS
  • hugo

    缺失模块。
    1、在博客根目录(注意不是yilia根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    2、在根目录_config.yml里添加配置:

      jsonContent:
        meta: false
        pages: false
        posts:
          title: true
          date: true
          path: true
          text: true
          raw: false
          content: false
          slug: false
          updated: false
          comments: false
          link: false
          permalink: false
          excerpt: false
          categories: false
          tags: true
    

  • 【Microservices】Service Mesh(服务网格)

    2020-08-22

    #Microservices

  • 【Golang】性能分析 - 监控Golang程序的垃圾回收

    2020-08-22

    #Golang

  • 【Golang】性能分析 - PProf

    2020-08-15

    #Golang

  • 【Linux】命令-date

    2020-08-09

    #Linux

  • 【Python】Python3 的时间

    2020-08-09

    #Python

  • 【Python】Log Framework - logging

    2020-08-09

    #Python

  • 【hugo】使用

    2020-08-09

    #hugo

  • 【Python】Django - Django Shell

    2020-08-09

    #Python

  • 【Python】安装Python

    2020-08-06

    #Python

  • 【Python】升级Python版本

    2020-08-06

    #Python

  • 【Golang】关键字 - defer

    2020-08-02

    #Golang

  • 【Golang】初始化(Intialization)

    2020-08-02

    #Golang

  • 【Golang】类型-string

    2020-08-02

    #Golang

  • 【Golang】文档

    2020-08-02

    #Golang

  • 【Golang】编译 - 交叉编译(Cross Compilation)

    2020-08-02

    #Golang

  • 【Golang】关键字 - const

    2020-08-02

    #Golang

  • 【Protobuf】Protocol Buffers 性能

    2020-07-31

    #Protobuf

  • 【Protobuf】Protocol Buffers Demo

    2020-07-31

    #Protobuf

  • 【Golang】位运算

    2020-07-31

    #Golang

  • 【Protobuf】Protocol Buffers Convention Guide

    2020-07-29

    #Protobuf

  • 【Protobuf】Protocol Buffers 深入

    2020-07-28

    #Protobuf

  • 【Linux】命令-nohup命令

    2020-07-28

    #Linux

  • 【Microservices】服务调用

    2020-07-26

    #Microservices

  • 【Microservices】常见服务注册/发现实现框架

    2020-07-26

    #Microservices

  • 【VPN】Terminal 运行 Cisco AnyConnect VPN

    2020-07-26

    #VPN

  • 【Microservices】微服务 - 服务注册(Service Registry)和服务发现(Service Discovery)

    2020-07-26

    #Microservices

  • 【ZooKeeper】学习

    2020-07-25

    #ZooKeeper

  • 【ZooKeeper】安装

    2020-07-25

    #ZooKeeper

  • 【Java】安装

    2020-07-25

    #Java

  • 【Redis】Codis 安装

    2020-07-25

    #Cache System#Redis#Codis

  • 【Golang】Golang 安装

    2020-07-23

    #Golang

  • 【Performance】Prometheus - Exporter - Redis Exporter

    2020-07-23

    #Performancede

  • 【Performance】Prometheus 深入

    2020-07-23

    #Performance

  • 【Linux】安装 oh-my-zsh

    2020-07-23

    #Linux

  • 【Performance】Promethues - Exporter

    2020-07-22

    #Performance

  • 【Performance】Prometheus - Node Exporter

    2020-07-22

    #Performance

  • 【Performance】Prometheus 初入

    2020-07-22

    #Performance

  • 【Performance】Grafana 学习

    2020-07-22

    #Performance

  • 【Software Testing】App 自动化测试框架 - Appium

    2020-07-15

    #Software Testing

  • 【Software Testing】App 自动化测试框架

    2020-07-15

    #Software Testing

  • 【Protobuf】Protocol Buffers 2中使用map

    2020-07-12

    #Protobuf

  • 【Cache System】Redis Cluster

    2020-07-10

    #Cache System#Redis

  • 【Cache System】Redis 集群方案

    2020-07-10

    #Cache System#Redis

  • 【Redis】Codis Pipeline

    2020-07-10

    #Cache System#Redis#Codis

  • 【Mattermost】webhook

    2020-07-09

    #Mattermost

  • 【ELK】ELK(Elasticsearch+Logstash+Kibana)学习

    2020-07-07

    #ELK

  • 【Lucene】Lucene 语法

    2020-07-06

    #Lucene

  • 【MySQL】将执行结果输出到文件

    2020-07-06

    #MySQL

  • 【Golang】通过私有库安装依赖

    2020-07-06

    #Golang

  • 【Golang】生成随机数

    2020-07-06

    #Golang

  • 【Git】忽略已经提交的文件

    2020-07-06

    #Git

  • 【Golang】gvm - Golang 版本管理

    2020-07-06

    #Golang

  • 【Golang】代码检查

    2020-07-06

    #Golang

  • 【Golang】幽灵变量(Shadowed Variables)

    2020-07-06

    #Golang

  • 【OpenWrt】OpenWrt学习

    2020-07-03

    #OpenWrt

  • 【Network】路由(Route)

    2020-06-27

    #Network

  • 【macOS】移除默认输入法

    2020-06-27

    #macOS

  • 【Network】NAT

    2020-06-27

    #Network

  • 【Vmware】安装 VMware EXSI 6.7

    2020-06-27

    #Vmware

  • 【OpenWrt】查看 CPU 温度

    2020-06-21

    #OpenWrt

  • 【Network】tcpdump 抓包

    2020-06-20

    #Network

  • 【Linux】修改 MAC 地址

    2020-06-20

    #Linux

  • 【Linux】查看网络信息

    2020-06-20

    #Linux

  • 【Linux】查看网络接口(Network Interface)

    2020-06-20

    #Linux

  • 【OpenWrt】MacOS 下红米路由器 AC2100 刷 OpenWrt

    2020-06-20

    #OpenWrt

  • 【Golang】Golang 遍历 map 时 key 随机化问题

    2020-06-14

    #Golang

  • 【hexo】使用 node 14 运行 hexo 报错

    2020-06-13

    #hexo

  • 【Linux】Oh-my-zsh 启动慢

    2020-06-13

    #Linux

  • 【Linux】查看当前所有进程

    2020-06-13

    #Linux

  • 【Linux】shell 和 shell 脚本的执行

    2020-06-13

    #Linux

  • 【Linux】Shell 和 Bash

    2020-06-13

    #Linux

  • 【Linux】bash 和 zsh 的启动脚本(.zshrc,.bash_profile,~/.profile 等区别)

    2020-06-13

    #Linux

  • 【Golang】go-redis Redis 连接库学习

    2020-05-24

    #Golang

  • 【Redis】Wireshark 分析 Redis 通讯

    2020-05-24

    #Redis

  • 【Docker】Docker Compose

    2020-05-24

    #Docker

  • 【macOS】brew 使用

    2020-05-24

    #macOS

  • 【Docker】Docker 常用命令

    2020-05-23

    #Docker

  • 【Redis】Codis

    2020-05-12

    #Cache System#Redis#Codis

  • 【Redis】Redis pipeline

    2020-05-09

    #Redis

  • 【Redis】Redis 性能分析 Insight

    2020-05-09

    #Redis

  • 【Redis】Redis 性能测试(redis-benchmark)

    2020-05-09

    #Redis

  • 【Redis】Redis High-availability

    2020-05-07

    #Redis

  • 【Redis】Redis 持久化(Persistence)

    2020-05-07

    #Redis

  • 【Redis】Redis 事务(Transaction)

    2020-05-07

    #Redis

  • 【Redis】Redis Key长度与性能

    2020-05-07

    #Redis

  • 【Linux】Crontab

    2020-05-05

    #Linux

  • 【WordPress】使用Docker创建WordPress 实例

    2020-05-05

    #WordPress

  • 【AWS】AWS CLI - s3 使用

    2020-05-05

    #AWS

  • 【Compile】交叉编译(Cross compiler)

    2020-05-05

    #Compile

  • 【Linux】Ubuntu安装Docker

    2020-05-01

    #Linux

  • 【Linux】shell变量

    2020-04-26

    #Linux

  • 【Linux】makefile

    2020-04-25

    #Linux

  • 【MySQL】Out of range value for column

    2020-04-25

    #MySQL

  • 【Architecture】连接池(Connection Pool)

    2020-04-21

    #Architecture

  • 【MySQL】Too many connections

    2020-04-21

    #MySQL

  • 【Redis】查看连接信息

    2020-04-21

    #Redis

  • 【Redis】设置密码

    2020-04-21

    #Redis

  • 【Linux】iostat - 查看IO实时监控

    2020-04-21

    #Linux

  • 【MySQL】学习

    2020-04-12

    #MySQL

  • 【Architecture】架构学习

    2020-04-11

    #Architecture

  • 【Distributed System】无服务器(Serverless)

    2020-04-11

    #Distributed System

  • 【Network】网络测速工具 - iperf3

    2020-04-11

    #Network

  • 【Golang】JSON序列化与反序列化

    2020-03-30

    #Golang

  • 【MySQL】用户和权限管理

    2020-03-29

    #MySQL

  • 【MySQL】MySQL安全性设置

    2020-03-29

    #MySQL

  • 【MySQL】查看log

    2020-03-29

    #MySQL

  • 【MySQL】Establishing a Database Connection

    2020-03-29

    #MySQL

  • 【Golang】Set实现

    2020-03-22

    #Golang

  • 【Golang】go-redis 连接Redis

    2020-03-22

    #Golang

  • 【Netwok】通过反向代理实现内网穿透

    2020-03-22

    #Netwok

  • 【Golang】内置函数

    2020-03-15

    #Golang

  • 【Golang】数据类型

    2020-03-15

    #Golang

  • 【Golang】循环

    2020-03-15

    #Golang

  • 【Golang】异常处理

    2020-03-15

    #Golang

  • 【Golang】静态数组(Array)和切片(slices)

    2020-03-15

    #Golang

  • 【Golang】函数

    2020-03-15

    #Golang

  • 【Golang】模块管理与引用

    2020-03-15

    #Golang

  • 【Golang】变量

    2020-03-15

    #Golang

  • 【Golang】枚举(enumeration)

    2020-03-15

    #Golang

  • 【Golang】变量访问域

    2020-03-15

    #Golang

  • 【Golang】map

    2020-03-15

    #Golang

  • 【Golang】struct

    2020-03-15

    #Golang

  • 【Golang】interface 和 interface{} 类型

    2020-03-15

    #Golang

  • 【Golang】类型转换 - 类型断言(Type Assertion)和强制类型转换

    2020-03-15

    #Golang

  • 【Hardware】ID 卡和 IC 卡

    2020-02-09

    #Hardware

  • 【MySQL】数据类型

    2020-01-31

    #MySQL

  • 【MySQL】MySQL 中的各种数据类型转换

    2020-01-31

    #MySQL

  • 【MySQL】命名习惯

    2020-01-31

    #MySQL

  • 【Golang】Golang 命令

    2020-01-30

    #Golang

  • 【Golang】指针(Pointers)

    2020-01-30

    #Golang

  • 【Golang】类型转换 - 获取变量类型

    2020-01-30

    #Golang

  • 【Linux】CentOS 安装Docker

    2020-01-30

    #Linux

  • 【Protobuf】Protocol Buffers 入门

    2020-01-29

    #Protobuf

  • 【Golang】上传文件

    2020-01-29

    #Golang

  • 【Raspbeery Pi】树莓派玩耍

    2020-01-29

    #RaspbeeryPi

  • 【Network】电信光猫内网穿透

    2020-01-29

    #Network

  • 【Golang】Golang 使用 UUID

    2020-01-12

    #Golang

  • 【Golang】Golang 的环境变量

    2020-01-12

    #Golang

  • 【Golang】Golang 依赖管理 - go module

    2020-01-12

    #Golang

  • 【Golang】Golang 使用 gRPC

    2020-01-12

    #Golang

  • 【Golang】Golang 连接 MySQL

    2020-01-12

    #Golang

  • 【Golang】修改代码后自动重新编译并启动

    2020-01-12

    #Golang

  • 【Golang】使用 gorm(ORM 框架)

    2020-01-12

    #Golang

  • 【Golang】Web Framework - Gin 使用

    2020-01-12

    #Golang

  • 【Golang】Print

    2020-01-12

    #Golang

  • 【Format】csv

    2020-01-12

    #Format

  • 【Software Testing】Postman 深入

    2019-12-09

    #Software Testing

  • 【Linux】资源使用问题排查

    2019-12-09

    #Linux

  • 【Python】显示对象的所有 Attribute

    2019-12-06

    #Python

  • 【Python】print

    2019-12-01

    #Python

  • 【Python】断言(assert)

    2019-12-01

    #Python

  • 【WordPress】修改站点域名

    2019-12-01

    #WordPress

  • 【Python】常见错误

    2019-11-28

    #Python

  • 【SQL】select for update

    2019-11-26

    #SQL

  • 【Python】Basics - 特殊变量(Special Variables)

    2019-11-26

    #Python

  • 【Python】魔术方法(Magic Methods)

    2019-11-24

    #Python

  • 【Python】import 问题排查

    2019-11-23

    #Python

  • 【Python】pytest - 运行错误

    2019-11-18

    #Python

  • 【Python】 单元测试框架 - pytest

    2019-11-18

    #Python

  • 【Django】Django ORM - 文档整理

    2019-11-17

    #Django

  • 【Django】Django ORM - 性能优化

    2019-11-17

    #Django

  • 【Django】Django ORM - 使 DB Schema 生效

    2019-11-17

    #Django

  • 【Django】使用 Template

    2019-11-17

    #Django

  • 【MySQL】日志记录

    2019-11-17

    #MySQL

  • 【Python】枚举

    2019-11-17

    #Python

  • 【Python】is 和 ==

    2019-11-16

    #Python

  • 【Django】Django 静态资源和 HTML 文件管理

    2019-11-13

    #Django

  • 【Architectural Pattern】前端框架中的 MVC、MVP 和 MVVM

    2019-11-10

    #Architectural Pattern

  • 【Distributed System】分布式 session(Distributed Seesion)

    2019-11-10

    #Distributed System

  • 【hexo】使用 AWS s3 作为 hexo 图库

    2019-11-10

    #hexo

  • 【JQuery】获取对象

    2019-11-10

    #JQuery

  • 【Python】闭包和匿名函数

    2019-11-10

    #Python

  • 【Python】装饰器(Wrapper)

    2019-11-10

    #Python

  • 【Django】Django 路由规则

    2019-11-10

    #Django

  • 【Django】Django 创建 Django 项目或应用

    2019-11-10

    #Django

  • 【Django】template - 插入 Python 代码

    2019-11-10

    #Django

  • 【Django】Django ORM - QuerySet 序列化

    2019-11-10

    #Django

  • 【Django】Django ORM - 查询数据

    2019-11-10

    #Django

  • 【Django】Django ORM - CRUD

    2019-11-10

    #Django

  • 【Django】Django ORM - Define Model

    2019-11-10

    #Django

  • 【macOS】清除 DNS 缓存

    2019-11-06

    #macOS

  • 【Django】错误汇总

    2019-11-05

    #Django

  • 【Python】前缀

    2019-11-04

    #Python

  • 【MySQL】MySQL 错误记录

    2019-11-04

    #MySQL

  • 【Python】Comprehensions

    2019-11-01

    #Python

  • 【Python】Python 一切皆对象

    2019-11-01

    #Python

  • 【Python】I/O - 输入

    2019-11-01

    #Python

  • 【Python】Basics - Built-in Function(内置函数)

    2019-11-01

    #Python

  • 【Python】String

    2019-11-01

    #Python

  • 【Python】Collection - dict

    2019-11-01

    #Python

  • 【Python】Collection - list

    2019-11-01

    #Python

  • 【Python】Python Style Guide

    2019-11-01

    #Python

  • 【JavaEE】Java Servlet和 JSP(JavaServer Pages)

    2019-11-01

    #Java EE

  • 【Database】聚集索引(Clustered Index)与非聚集索引(Non-clustered Index)

    2019-10-31

    #Database

  • 【Django】通过 ORM 访问 MySQL,插入 Emoji 报错

    2019-10-31

    #Django

  • 【MySQL】MySQL 的存储引擎(Storage Engines)- MyISAM 与 InnoDB

    2019-10-31

    #MySQL

  • 【Django】Django 项目部署到 uWSGI + Nginx 作为生产环境

    2019-10-28

    #Nginx#Django

  • 【HTTP】Web Server(Web 服务器)、Web Application Server(Web 应用服务器)和 CGI(Common Gateway Interface)的故事

    2019-10-28

    #HTTP#Network

  • 【Python】WSGI(Web Server Gateway Interface)、uWSGI Server、uwsgi、WSGI Application 的故事

    2019-10-28

    #Python

  • 【Python】Error Handling

    2019-10-28

    #Python

  • 【Architecture】Design - Error Handling

    2019-10-28

    #Architecture#ArchitectureDesign

  • 【Architecture】Design - Database Schema Design

    2019-10-28

    #Architecture#ArchitectureDesign

  • 【Architecture】Design - API Design

    2019-10-28

    #Architecture#ArchitectureDesign

  • 【Django】Django 使用 Redis

    2019-10-28

    #Django#Redis

  • 【Redis】自动过期

    2019-10-28

    #Redis

  • 【Python】变量作用域

    2019-10-27

    #Python

  • 【Redis】Redis 操作

    2019-10-27

    #Redis

  • 【Redis】安装 Redis

    2019-10-27

    #Redis

  • 【Python】PyCharm 中的 import 问题

    2019-10-27

    #Python

  • 【Python】Basics - 函数返回值

    2019-10-27

    #Python

  • 【Python】Exception

    2019-10-20

    #Python

  • 【Django】Error - Django : Table doesn't exist

    2019-10-20

    #Django

  • 【Python】import

    2019-10-20

    #Python

  • 【Django】Django 读写 Cookie

    2019-10-20

    #Django

  • 【HTTP】Cookie

    2019-10-20

    #HTTP

  • 【Python】Collection - set

    2019-10-20

    #Python

  • 【Python】Basics - 函数参数

    2019-10-20

    #Python

  • 【Django】Django Form

    2019-10-20

    #Django

  • 【SQL】清空表数据后如何让自增 ID 从 1 开始

    2019-10-20

    #MySQL#SQL

  • 【MySQL】ERROR 1701 (42000): Cannot truncate a table referenced in a foreign key

    2019-10-20

    #MySQL

  • 【Django】Django 中的时间获取与相关问题

    2019-10-19

    #Django

  • 【Django】Django Shell

    2019-10-19

    #Django

  • 【Software Testing】Postman 中的 Cookies 设置

    2019-10-19

    #Software Testing

  • 【Nginx】MacOS 下安装 Nginx

    2019-10-19

    #Nginx#macOS

  • 【Node.js】 使用 nvm 管理本地 Node.js 版本

    2019-10-19

    #Node.js#nvm

  • 【Django】处理 PUT 和 DELETE 方法

    2019-10-08

    #Django

  • 【Python】杂 - virtualenv 管理 Python 项目依赖

    2019-10-08

    #Python

  • 【Python】Django - 连接 MySQL

    2019-10-08

    #Django

  • 【Python】杂 - 通过 pyenv 快速切换当前系统 Python 版本

    2019-10-06

    #Python

  • 【Python】杂 - macOS 下设置 Python 默认版本

    2019-10-06

    #Python

  • 【Python】API - 时间表示

    2019-10-06

    #Python

  • 【MySQL】MySQL 8 + macOS 错误:Authentication plugin 'caching_sha2_password' cannot be loaded

    2019-10-06

    #MySQL

  • 【Python】I/O - 异步 I/O

    2019-09-24

    #Python

  • 【Python】线程 - ThreadLocal

    2019-09-24

    #Python

  • 【Python】Basics - 类

    2019-09-23

    #Python

  • 【Python】线程 - 锁

    2019-09-23

    #Python

  • 【Python】线程 - 多线程(Multithreading)

    2019-09-23

    #Python

  • 【Python】线程 - 多进程

    2019-09-23

    #Python

  • 【Linux】命令 - cut命令

    2019-09-17

    #Linux

  • 【Linux】Shell/Bash - 多命令执行、管道(pipeline)和重定向(redirection)

    2019-09-17

    #Linux

  • 【Linux】命令 - grep 命令

    2019-09-16

    #Linux

  • 【HTTP】RESTful

    2019-08-26

    #HTTP

  • 【HTTP】HTTP 请求方法(Methods)

    2019-08-26

    #HTTP

  • 【SQL】约束(Constraints)

    2019-08-22

    #SQL

  • 【SQL】常用 SQL 语句

    2019-08-22

    #SQL

  • 【Network】IPv4 地址

    2019-08-21

    #Network

  • 【Algorithm】算法思想 - 二分法(Binary Search)

    2019-08-16

    #Algorithm

  • 【Markdown】Markdown 使用中 HTML

    2019-08-15

    #Markdown

  • 【Java】运算符 - 乘法除法问题

    2019-08-14

    #Java

  • 【Java】源码 - BitSet

    2019-08-14

    #Java

  • 【Algorithm】动态规划 - 背包问题

    2019-08-13

    #Algorithm

  • 【Linxu】磁盘管理

    2019-08-08

    #Linxu

  • 【Python】协程(Coroutine)

    2019-08-08

    #Python

  • 【Python】Python 的单线程

    2019-08-06

    #Python

  • 【Python】Python 几种常用的测试框架

    2019-08-06

    #Python

  • 【Architecture】高并发

    2019-08-06

    #Architecture

  • 【Architecture】中台概念

    2019-08-06

    #Architecture

  • 【Algorithm】算法思想 - 分治算法(Divide and Conquer)

    2019-08-05

    #Algorithm

  • 【Algorithm】算法思想 - 贪心算法(Greedy Algorithm)

    2019-08-05

    #Algorithm

  • 【Algorithm】排序算法 - 计数排序(Counting Sort)

    2019-08-05

    #Algorithm

  • 【Architecture】系统架构考虑

    2019-08-05

    #Architecture

  • 【Distributed System】微服务 - Kubernetes 初步

    2019-08-04

    #Microservices

  • 【Distributed System】SOA 与 MicroServices

    2019-08-04

    #Distributed System#Microservices

  • 【Docker】减小 Docker 镜像体积

    2019-08-04

    #Docker

  • 【Performance】 性能指标(Performance Indicator)

    2019-08-04

    #Performance

  • 【Java】集合类 - PriorityQueue类(优先队列)

    2019-08-02

    #Java

  • 【Linux】命令 - sed命令

    2019-08-02

    #Linux

  • 【Linux】命令 - lsof 命令

    2019-08-01

    #Linux

  • 【Distributed System】云计算(Cloud Computing)

    2019-08-01

    #Distributed System

  • 【Data Structure】树 - 平衡二叉搜索树 - 有了二叉查找树、AVL 树为啥还需要红黑树?

    2019-08-01

    #Data Structure

  • 【Distributed System】消息队列-RabbitMQ

    2019-08-01

    #Distributed System

  • 【Microservices】微服务(Microservice Architecture)

    2019-07-31

    #Microservices

  • 【Spring】Spring 框架

    2019-07-31

    #Spring

  • 【Database】读写分离(Read/Write Splitting)

    2019-07-31

    #Database

  • 【Data Structure】优先队列(Priority Queue)

    2019-07-31

    #Data Structure

  • 【Algorithm】排序算法 - 桶排序(Bucket Sort)

    2019-07-30

    #Algorithm

  • 【Algorithm】TopK 问题

    2019-07-30

    #Algorithm

  • 【Java】I/O - 读取数据

    2019-07-30

    #Java

  • 【Algorithm】排序算法 - 堆排序(Heap Sort)

    2019-07-30

    #Algorithm

  • 【Data Structure】堆(Heap)/ 二叉堆(binary heap)

    2019-07-29

    #Data Structure

  • 【Algorithm】算法思想 - 动态规划(Dynamic Programming)

    2019-07-29

    #Algorithm

  • 【Algorithm】递归(Recursion)

    2019-07-29

    #Algorithm

  • 【Algorithm】BigNum 原理

    2019-07-29

    #Algorithm

  • 【Algorithm】算法的时间复杂度(Time complexity)

    2019-07-27

    #Algorithm

  • 【Distributed System】负载均衡(Load balancing)

    2019-07-26

    #Distributed System

  • 【Algorithm】排序算法 - 归并排序(Merge Sort)

    2019-07-25

    #Algorithm

  • 【Netwrok】输入一个 URL 会发生什么

    2019-07-24

    #Netwrok

  • 【LaTeX】支持中文

    2019-07-24

    #LaTeX

  • 【Operating System】进程 - Linux启动进程的几种方式

    2019-07-18

    #Linux#Operating Systems

  • 【Java】集合类 - LinkedHashMap

    2019-07-16

    #Java

  • 【Operating System】LRU(Least Recently Used)算法

    2019-07-15

    #Algorithm#Operating System

  • 【Network】HTTP 常用响应码

    2019-07-15

    #HTTP#Network

  • 【Database】分库分表

    2019-07-12

    #Database

  • 【Distributed System】柔性事务(Flexible Transactions)

    2019-07-12

    #Distributed System

  • 【Distributed System】一致性哈希(Consistent Hashing)

    2019-07-12

    #Distributed System

  • 【Distributed System】分布式事务(Distributed Transaction)

    2019-07-12

    #Distributed System

  • 【Java】锁 - Lock 接口

    2019-07-12

    #Java

  • 【Java】Java关键字 - synchronized关键字中的锁状态

    2019-07-12

    #Java

  • 【Lock】独享锁(Exclusive Lock) VS 共享锁(Shared Lock)

    2019-07-12

    #Java#Lock

  • 【Distributed System】分布式锁(Distributed Lock)

    2019-07-11

    #Distributed System

  • 【Distributed System】分布式系统

    2019-07-11

    #Distributed System

  • 【Operating System】I/O - 零拷贝(Zero-copy)

    2019-07-11

    #Operating System

  • 【Java】JVM - Java内存模型中的缓存一致性(Cache Coherency)问题

    2019-07-11

    #Java

  • 【Java】Netty入门

    2019-07-10

    #Java#Network Programming

  • 【Regular Expression】正则表达式(Regular Expression)

    2019-07-10

    #Regular Expression

  • 【Java EE】Jetty入门

    2019-07-10

    #Java EE

  • 【Operating System】死锁(deadlock)

    2019-07-10

    #Operating System

  • 【Distributed System】消息队列(Message Queue)

    2019-07-10

    #Distributed System

  • 【Distributed System】Dubbo 入门

    2019-07-10

    #Microservices

  • 【Java】值传递与引用传递

    2019-07-10

    #Java

  • 【Linux】统计某文件/文件夹个数

    2019-07-10

    #Linux

  • 【Database】数据库连接池

    2019-07-09

    #Database

  • 【Operating System】I/O - 磁盘I/O相关概念

    2019-07-09

    #Operating System

  • 【Cache System】缓存穿透(Cache Penetration)、缓存雪崩(Cache Avalanche)与缓存击穿(Cache Breakdown)

    2019-07-08

    #Cache System

  • 【Algorithm】海量数据处理 - 布隆过滤器(Bloom Filter)

    2019-07-05

    #Algorithm

  • 【Algorithm】海量数据处理 - 位图(Bitmap)

    2019-07-05

    #Algorithm

  • 【Algorithm】海量数据处理 - MapReduce

    2019-07-05

    #Algorithm

  • 【Algorithm】海量数据处理 - hash映射再取模 + hashmap统计 + 排序

    2019-07-05

    #Algorithm

  • 【Algorithm】海量数据处理

    2019-07-05

    #Algorithm

  • 【Algorithm Problem】海量数据处理 - 10亿int型数,统计只出现一次的数

    2019-07-05

    #Algorithm Problem

  • 【Security】Web安全

    2019-07-04

    #Security

  • 【OOP】什么是多态

    2019-07-03

    #OOP

  • 【Java】基本数据类型 - 基本数据类型的类型转换

    2019-06-28

    #Java

  • 【Java】基本数据类型 - Java支持的8种基本数据类型

    2019-06-28

    #Java

  • 【Algorithm】计算斐波纳契数(Fibonacci Number)

    2019-06-27

    #Algorithm

  • 【Algorithm】排序算法 - 希尔排序(Shell Sort)

    2019-06-26

    #Algorithm

  • 【Algorithm】排序算法 - 插入排序(Insertion Sort)

    2019-06-25

    #Algorithm

  • 【Algorithm】排序(Sorting)算法

    2019-06-25

    #Algorithm

  • 【Algorithm】排序算法 - 冒泡排序(Bubble Sort)

    2019-06-25

    #Algorithm

  • 【Algorithm】排序算法 - 快速排序(Quick Sort)

    2019-06-25

    #Algorithm

  • 【Interview】应聘者提问

    2019-06-19

    #Interview

  • 【Network】Shadowsocks总结

    2019-06-19

    #Network

  • 【Data Structure】图(Graph) - 图的物理存储

    2019-06-14

    #Data Structure

  • 【Data Structure】图(Graph) - 图的深度优先搜索(Depth First Search)

    2019-06-14

    #Data Structure

  • 【Data Structure】多叉搜索树 - Trie树(字典树)

    2019-06-13

    #Data Structure

  • 【Database】数据库索引(Index)

    2019-06-10

    #Database

  • 【Database】数据库索引为什么使用 B+ 树

    2019-06-10

    #Database

  • 【Data Structure】多路平衡查找树 - B+ 树(B+ Tree)

    2019-06-05

    #Data Structure

  • 【Data Structure】多路平衡查找树 - B树(B-Tree)

    2019-06-04

    #Data Structure

  • 【Data Structure】多路平衡查找树 - 2-3 查找树和 2-4 查找树

    2019-06-04

    #Data Structure

  • 【Algorithm】查找算法

    2019-06-03

    #Algorithm

  • 【Network】Charles 为什么可以获取 HTTPS 包内容

    2019-05-31

    #Network

  • 【Data Structure】哈希表(Hash table)

    2019-05-30

    #Data Structure

  • 【Data Structure】常用数据结构的时间复杂度

    2019-05-30

    #Data Structure

  • 【Data Structure】哈夫曼树(Huffman Tree)

    2019-05-30

    #Data Structure

  • 【Data Structure】平衡二叉搜索树 - 红黑树(Red-Black Tree)

    2019-05-30

    #Data Structure

  • 【Data Structure】平衡二叉搜索树 - AVL树

    2019-05-30

    #Data Structure

  • 【Data Structure】自平衡二叉搜索树(Self-balancing Binary Search Tree)

    2019-05-29

    #Data Structure

  • 【Data Structure】二叉搜索树(Binary Search Tree)

    2019-05-29

    #Data Structure

  • 【Data Structure】线索二叉树(Threaded Binary Tree)

    2019-05-28

    #Data Structure

  • 【Data Structure】二叉树的遍历(Traversal)

    2019-05-27

    #Data Structure

  • 【Data Structure】二叉树(Binary Tree)

    2019-05-27

    #Data Structure

  • 【Network】OpenWrt的路由器ssh访问

    2019-05-27

    #Network

  • 【Data Structure】广义表

    2019-05-24

    #Data Structure

  • 【Data Structure】矩阵

    2019-05-24

    #Data Structure

  • 【Data Structure】树(Tree)

    2019-05-24

    #Data Structure

  • 【Algorithm】字符串匹配算法 - 朴素的字符串匹配算法(Naive String Matching Algorithm)

    2019-05-23

    #Algorithm

  • 【Algorithm】字符串匹配算法 - KMP 算法

    2019-05-22

    #Algorithm

  • 【Data Structure】串(String)

    2019-05-21

    #Data Structure

  • 【Data Structure】队列(Queue)

    2019-05-21

    #Data Structure

  • 【Data Structure】栈的应用

    2019-05-17

    #Data Structure

  • 【Java】集合类-Stack

    2019-05-16

    #Java

  • 【Data Structure】栈(Stack)

    2019-05-16

    #Data Structure

  • 【Java】运算符-位运算符

    2019-05-16

    #Java

  • 【Data Structure】循环链表(Circular Linked List)

    2019-05-16

    #Data Structure

  • 【Data Structure】双向链表(Doubly Linked List)

    2019-05-16

    #Data Structure

  • 【Java】集合类 - LinkedList

    2019-05-16

    #Java

  • 【Data Structure】链表(Linked List)

    2019-05-16

    #Data Structure

  • 【Java】集合类 - ArrayList

    2019-05-15

    #Java

  • 【Data Structure】顺序表

    2019-05-15

    #Data Structure

  • 【Algorithm】什么是算法(Algorithm)

    2019-05-15

    #Algorithm

  • 【Data Structure】什么是数据结构

    2019-05-14

    #Data Structure

  • 【Data Structure】线性表(Linear List)

    2019-05-14

    #Data Structure

  • 【Data Structure】图(Graph)

    2019-05-14

    #Data Structure

  • 【Algorithm Problem】统计文章中每个单词出现的次数

    2019-05-14

    #Algorithm Problem

  • 【Algorithm】排序算法 - 选择排序(Selection Sort)

    2019-05-14

    #Algorithm

  • 【Algorithm】查找算法(Search) - 二分搜索算法(Binary Search)

    2019-05-13

    #Algorithm

  • 【Security】Wireshake抓包分析HTTPS

    2019-05-13

    #Security

  • 【Security】HTTPS

    2019-05-13

    #Security

  • 【Security】安全的HTTP的演化

    2019-05-13

    #Security

  • 【Security】密码学基础

    2019-05-13

    #Security

  • 【Network】HTTP协议的演变

    2019-05-08

    #HTTP#Network

  • 【Network】IP 协议(网际协议)

    2019-05-08

    #Network

  • 【Network】UDP

    2019-05-08

    #Network

  • 【Network】TCP/IP

    2019-05-08

    #Network

  • 【Network】TCP 的拥塞控制(Congestion Handling)

    2019-05-08

    #Network

  • 【Network】TCP 的流量控制(Traffic Control) - 滑动窗口(Sliding Window)

    2019-05-07

    #Network

  • 【Network】TCP 为什么是三次握手,而不是两次或四次?

    2019-05-06

    #Network

  • 【Network】TCP 四次挥手(TCP Four-way Wavehand)

    2019-05-06

    #Network

  • 【Network】Wireshark 抓包学习TCP通讯

    2019-05-03

    #Network

  • 【Network】TCP(Transmission Control Protocol)

    2019-05-03

    #Network

  • 【Network】TCP 三次握手(TCP Three-way Handshake)

    2019-05-03

    #Network

  • 【Design Pattern】结构类模式 — 装饰器模式(Decorator Pattern)

    2019-04-09

    #Design Pattern

  • 【Spring】Spring中的IoC

    2019-04-08

    #Spring

  • 【Spring】面向切面编程(AOP) 与Spring

    2019-04-08

    #Spring

  • 【Design Pattern】结构类模式 —- 代理模式(Proxy Pattern)

    2019-04-05

    #Design Pattern

  • 【Java】泛型(Generics)

    2019-04-02

    #Java

  • 【Java】Java对象的生命周期

    2019-04-02

    #Java

  • 【Java】Java关键字-transient关键字

    2019-04-02

    #Java

  • 【Java】反射(Reflection)

    2019-04-02

    #Java

  • 【Java】instanceof关键字与 isInstance方法

    2019-04-01

    #Java

  • 【Java】类的访问修饰符(Access Qualifier)

    2019-04-01

    #Java

  • 【Java】Java中的引用与如何避免OutOfMemory

    2019-04-01

    #Java

  • 【Java】内部类(Inner Class)

    2019-04-01

    #Java

  • 【Java】Java关键字-static 关键字

    2019-04-01

    #Java

  • 【Java】抽象类(Abstract Class)与接口(Interface)

    2019-04-01

    #Java

  • 【OOP】重写(Overriding)与重载(Overloading)

    2019-04-01

    #OOP

  • 【Java】类(Class)与继承(Inheritance)

    2019-03-29

    #Java

  • 【Java】访问修饰符(Access Modifier)

    2019-03-29

    #Java

  • 【Java】Java 动态代理(Dynamic Proxy)

    2019-03-28

    #Java

  • 【Java】对象的序列化(Serialization)与反序列化(Deserialization)

    2019-03-28

    #Java

  • 【Java】枚举Enum

    2019-03-27

    #Java

  • 【Java】枚举实现单例模式

    2019-03-26

    #Java

  • 【Java】同步容器与线程安全问题

    2019-03-26

    #Java

  • 【Java】String - String.intern()方法

    2019-03-26

    #Java

  • 【Java】垃圾回收 - 分代垃圾回收

    2019-03-26

    #Java

  • 【Java】对象的内存分配 - 垃圾回收过程

    2019-03-26

    #Java

  • 【Java】垃圾收集(Garbage Collection)

    2019-03-26

    #Java

  • 【Java】Java关键字-final关键字

    2019-03-19

    #Java

  • 【Java】集合类 - 并发容器(Concurrent Container)

    2019-03-18

    #Java

  • 【Java】集合类 - CopyOnWriteArrayList

    2019-03-18

    #Java

  • 【Java】hashCode()

    2019-03-18

    #Java

  • 【Java】集合类 - ConcurrentHashMap

    2019-03-18

    #Java

  • 【Java】集合类-Map

    2019-03-18

    #Java

  • 【Java】集合类-遍历Map对象的几种方式

    2019-03-18

    #Java

  • 【Java】集合类-集合框架

    2019-03-15

    #Java

  • 【Java】集合类-Set

    2019-03-15

    #Java

  • 【Java】集合类-List

    2019-03-15

    #Java

  • 【Java】集合类-Iterable接口的Fail-Fast机制

    2019-03-15

    #Java

  • 【Java】集合类 - HashSet

    2019-03-15

    #Java

  • 【Java】集合类-Queue

    2019-03-15

    #Java

  • 【Java】集合类-TreeSet

    2019-03-15

    #Java

  • 【Java】集合类-HashMap的并发问题

    2019-03-14

    #Java

  • 【Java】集合类 - HashMap

    2019-03-14

    #Java

  • 【Java】集合类-Collection接口的三种遍历方法

    2019-03-14

    #Java

  • 【Java】集合类-HashSet、HashMap 和 HashTable

    2019-03-13

    #Java

  • 【Java】==与equals()

    2019-03-12

    #Java

  • 【Java】String - String,StringBuilder 和 StringBuffer

    2019-03-11

    #Java

  • 【Java】装箱(Boxing)与拆箱(Unboxing)

    2019-03-11

    #Java

  • 【Java】String - String 类和常量池

    2019-03-11

    #Java

  • 【Java】多线程-Callable、Future 和 FutureTask

    2019-03-08

    #Java

  • 【Java】JVM-双亲委派模型(Parents Delegation model)

    2019-03-07

    #Java

  • 【Java】JVM-自定义类加载器

    2019-03-07

    #Java

  • 【Java】JVM - 对象访问

    2019-03-06

    #Java

  • 【Java】JVM - JVM 内存区域

    2019-03-06

    #Java

  • 【Java】JVM-类加载机制(ClassLoad Mechanism)

    2019-03-06

    #Java

  • 【Java】JVM-类加载器(Class Loader)

    2019-03-06

    #Java

  • 【Java】JVM 入门

    2019-03-06

    #Java

  • 【Java】JVM - HotSpot VM

    2019-03-05

    #Java

  • 【Java】JVM - Java 对象头(Header)

    2019-03-04

    #Java

  • 【Java】锁 - JVM 对内部锁的优化

    2019-03-04

    #Java

  • 【Java】I/O - I/O 模型与服务端编程

    2019-03-04

    #Java#Network Programming

  • 【Java】I/O - NIO 使用

    2019-03-04

    #Java

  • 【Java】字符(char)

    2019-03-03

    #Java

  • 【Java】 I/O - I/O 基本操作

    2019-03-03

    #Java

  • 【Java】 字符(串)编码与解码

    2019-03-02

    #Java

  • 【Java】多线程-线程间通信工具CountDownLatch、CyclicBarrier 和 Phaser 类

    2019-03-01

    #Java

  • 【Lock】锁的几种特性

    2019-03-01

    #Java#Lock

  • 【Java】锁 - AQS

    2019-02-28

    #Java

  • 【Java】锁 - ReentrantLock 类

    2019-02-28

    #Java

  • 【Java】多线程-Java 锁的演化

    2019-02-28

    #Java

  • 【Java】多线程-Java 保证原子性、有序性、可见性

    2019-02-28

    #Java

  • 【Java】多线程 - 原子类(Atomic Classes)

    2019-02-27

    #Java

  • 【Java】锁 - CAS 无锁算法

    2019-02-27

    #Java

  • 【Java】多线程 - Happens-before 原则

    2019-02-27

    #Java

  • 【Java】多线程 - 线程安全(Thread Safety)

    2019-02-27

    #Java

  • 【Java】多线程 - ThreadLocal

    2019-02-27

    #Java

  • 【Java】多线程 - 守护线程(Daemon Thread)

    2019-02-26

    #Java

  • 【Network】两种高性能I/O设计模式(Reactor/Proactor)

    2019-02-26

    #Network#Network Programming

  • 【Java】多线程 - 线程状态切换函数

    2019-02-25

    #Java

  • 【Java】多线程 - 线程池(Thread Pool)

    2019-02-25

    #Java

  • 【Operating System】进程 - 协程(Coroutines)

    2019-02-25

    #Operating System

  • 【Java】JVM - Java 内存模型(Java Memory Model)

    2019-02-25

    #Java

  • 【Lock】锁的可重入性(Reentrancy)

    2019-02-25

    #Lock

  • 【Java】Java关键字 - volatile 关键字

    2019-02-25

    #Java

  • 【Operating System】文件描述符(File Descriptor)

    2019-02-22

    #Operating System

  • 【Database】两阶段锁(Two-phase locking)

    2019-02-21

    #Database

  • 【Programming】并发编程(Concurrent Programming)

    2019-02-19

    #Programming

  • 【并发控制】乐观并发控制(Optimistic Concurrency Control)与悲观并发控制(Pessimistic Concurrency Control)

    2019-02-17

    #Operating System

  • 【Operating System】进程 - 进程与线程

    2019-02-14

    #Operating System

  • 【Operating System】系统调用

    2019-02-14

    #Operating System

  • 【Operating System】进程 - 进程/线程间通信

    2019-02-13

    #Operating System

  • 【Operating System】进程 - 进程/线程调度

    2019-02-10

    #Operating Systems

  • 【Linux】iptables防火墙

    2019-02-02

    #Linux

  • 【Java】多线程-线程优先级

    2019-02-01

    #Java

  • 【Java】Java关键字 - synchronized关键字

    2019-01-31

    #Java

  • 【Java】多线程-线程基础

    2019-01-31

    #Java

  • 【Java】多线程 - Java中的线程状态及状态切换

    2019-01-31

    #Java

  • 【Linux】SSH登录与管理

    2019-01-31

    #Linux

  • 【Linux】命令 - scp 命令

    2019-01-30

    #Linux

  • 【Linux】命令 - dig 命令

    2019-01-30

    #Linux

  • 【Network】dnsmasq初学

    2019-01-30

    #Network

  • 【Linux】定时任务

    2019-01-30

    #Linux

  • 【Network】Shadowsocks + OpenWRT + dnsmasq-full + ipset + gfwList 实现路由器(小米路由器mini)自动翻墙

    2019-01-30

    #Network

  • 【OpenWrt】小米路由器mini刷OpenWRT

    2019-01-30

    #OpenWrt

  • 【Network】C10K问题与高性能网络编程入门

    2019-01-20

    #Network#Network Programming

  • 【Linux】Linux中的I/O轮询技术

    2019-01-19

    #Linux#Operating System

  • 【Java】Java关键字 - finally关键字

    2019-01-18

    #Java

  • 【Architecture】Nginx学习

    2019-01-18

    #Architecture#Nginx

  • 【Node.js】Node的模块定义和使用

    2019-01-17

    #Node.js

  • 【Linux】硬链接与软链接

    2019-01-10

    #Linux

  • 【Distributed System】分布式系统的数据一致性(Data Consistency)

    2019-01-09

    #Distributed System

  • 【Distributed System】分布式事务 - 三阶段提交

    2019-01-09

    #Distributed System

  • 【Distributed System】分布式事务 - 两阶段提交

    2019-01-09

    #Distributed System

  • 【Distributed System】分布式理论 - BASE理论

    2019-01-08

    #Distributed System

  • 【Distributed System】分布式理论 - CAP理论

    2019-01-08

    #Distributed System

  • 【OOP】对象的深拷贝(Deep Copy)与浅拷贝(Shallow Copy)

    2019-01-07

    #OOP

  • 【Distributed System】远程过程调用(Remote Procedure Call,RPC)

    2019-01-07

    #Distributed System

  • 【Network】GFW学习

    2019-01-06

    #Network

  • 【Redis】Redis 入门

    2019-01-06

    #Cache System#Redis

  • 【WordPress】WordPress安全性设置

    2018-11-12

    #WordPress

  • 【Docker】Docker 的基本使用

    2018-11-12

    #Docker

  • 【Java】macOS下编译JDK8

    2018-11-12

    #Java

  • 【Node.js】Node.js 应用性能监测与分析

    2018-11-12

    #Node.js

  • 【Node.js】Node.js中的单线程模型与多线程/进程

    2018-11-12

    #Node.js

  • 【Linux】Shell 脚本

    2018-11-12

    #Linux

  • 【Architectural Pattern】MVVM与数据绑定

    2018-11-12

    #Architectural Pattern

  • 【Design Pattern】结构类模式 -- 模板方法模式 (Template Method Pattern)

    2018-11-12

    #Design Pattern

  • 【Design Pattern】结构类模式 -- 组合模式 (Composite Pattern)

    2018-11-12

    #Design Pattern

  • 【Design Pattern】结构类模式 -- 适配器模式 (Adapter Pattern)

    2018-11-12

    #Design Pattern

  • 【Design Pattern】结构类模式 -- 享元模式 (Flyweight Pattern)

    2018-11-11

    #Design Pattern

  • 【Design Pattern】行为类模式 -- 观察者模式 (Obsever Pattern)

    2018-11-11

    #Design Pattern

  • 【Design Pattern】行为类模式 -- 策略模式 (Strategy Pattern)

    2018-11-11

    #Design Pattern

  • 【Architectural Pattern】Model – View – Controller (MVC)

    2018-11-11

    #Architectural Pattern

  • 【Java】 Intellij调试程序断点进入JDK源码

    2018-11-11

    #Java

  • 【Java】Java程序的编译与运行

    2018-11-11

    #Java

  • 【JavaScript】JavaScript 单线程与异步

    2018-11-11

    #JavaScript

  • 【Python】Python调试技巧

    2018-11-11

    #Python

  • 【iOS】 iOS内存管理

    2018-11-11

    #iOS

  • 【Design Pattern】行为类模式 -- 备忘者模式(Memento Pattern)

    2018-11-11

    #Design Pattern

  • 【Design Pattern】创建类模式 -- 单例模式 (Singleton Pattern)

    2018-11-11

    #Design Pattern

  • 【Design Pattern】创建类模式 -- 建造者模式 (Builder Pattern)

    2018-11-11

    #Design Pattern

  • 【Design Pattern】创建类模式 -- 工厂模式 (Factory Pattern)

    2018-11-11

    #Design Pattern

  • 【Design Pattern】行为类模式 -- 状态模式 (State Pattern)

    2018-11-11

    #Design Pattern

  • 【Design Pattern】设计模式概念

    2018-11-11

    #Design Pattern

  • 【Markdown】Markdown中的数学符号与公式

    2018-11-10

    #Markdown

  • 【Linux】命令 - time命令

    2018-11-06

    #Linux

  • 【Operating System】I/O - 同步、异步与阻塞、非阻塞I/O问题

    2018-11-06

    #Operating System

  • 【Node.js】Node.js 的 Event Loop 与异步 I/O

    2018-11-06

    #Node.js

  • 【Linux】chmod/chown - Linux 文件/文件夹 权限

    2018-11-05

    #Linux

  • 【SQL】SQLite 命令

    2018-02-24

    #SQL

  • 【SQL】SQL中几个关键字

    2018-02-24

    #SQL

  • 【WordPress】WordPress安装插件时提示输入FTP账号信息

    2018-02-24

    #WordPress

  • 【WordPress】WordPress修改管理员用户名名称

    2018-02-24

    #WordPress

  • 【OOP】依赖反转原则(The Dependency Inversion Principle)、控制反转(Inversion of Control)与依赖注入 (Dependency Injection)

    2018-02-24

    #OOP

  • 【MySQL】MySQL 常用命令

    2018-02-23

    #MySQL

  • 【MySQL】Mac 下安装 MySQL

    2018-02-23

    #MySQL

  • 【Java】JavaBean、POJO和EJB

    2018-02-23

    #Java

  • 【macOS】 macOS下查看端口被哪个程序占用

    2018-02-23

    #macOS

  • 【Java】 集合类-Java中List的基本使用

    2018-02-23

    #Java

  • 【Security】用户验证及密码加密存储

    2018-02-23

    #Security

  • 【OOP】SOLID 原则

    2018-02-23

    #OOP

  • 【Operating System】换行符

    2018-02-23

    #Operating System

  • 【C#】 C# 委托

    2018-02-23

    #C#

  • 【C#】 C# 匿名函数

    2018-02-23

    #C#

  • 【Programming】函数式编程(Functional Programming)

    2018-02-23

    #Programming

  • 【Software Testing】软件测试的种类

    2018-02-23

    #Software Testing

  • 【iOS】通过Xcode任意指定iPhone/iPad的地理位置

    2017-09-27

    #iOS

  • 【Linux】Linux(CentOS 7)安全策略设置

    2017-09-27

    #Linux

  • 【Linux】命令 - curl 的使用

    2017-09-26

    #Linux

  • 【Linux】查看占用端口的进程

    2017-09-08

    #Linux

  • 【Nginx】Nginx 配置文件的语法检测与路径获取

    2017-09-08

    #Nginx

  • 【Java】javap(Java Class文件分解工具)

    2017-06-08

    #Java

  • 【Windows】Windows 10下在Cmder中使用Linux Bash

    2017-06-08

    #Windows

  • 【Java】Java反编译工具

    2017-06-04

    #Java

  • 【Network】Wireshark常用过滤命令

    2017-06-04

    #Network

  • 【Network】单播(Unicast)、多播(Multicast)与广播(Broadcast)

    2017-06-04

    #Network

  • 【Network】DHCP 介绍与工作原理

    2017-06-04

    #Network

  • 【Java】Java 开发环境配置及踩的坑

    2017-06-04

    #Java

  • 【iOS】 iOS不同操作系统兼容问题

    2017-05-15

    #iOS

  • 【Hardware】i386、x86和x64的故事

    2017-04-30

    #Hardware

  • 【iOS】 Apple移动设备处理器指令集与Xcode指令集相关设置

    2017-04-30

    #iOS

  • 【Linux】时间同步问题与Linux NTP

    2017-04-25

    #Linux

  • 【Linux】CentOS7/RedHat7 NTP服务无法开机自启动

    2017-04-25

    #Linux

  • 【Linux】查看Linux系统版本

    2017-04-24

    #Linux

  • 【VMware】 VMware中安装CentOS7

    2017-04-13

    #VMware

  • 【Linux】 Linux 包管理器

    2017-04-13

    #Linux

  • 【VMware】 VMware Workstation 与 Device/Credential Guard 不兼容

    2017-04-13

    #VMware

  • 【JavaScript】 JavaScript 单元测试框架:Jasmine

    2017-04-09

    #JavaScript#Software Testing

  • 【Operating System】环境变量(Environmental Variables)

    2017-04-09

    #Linux

  • 【Node.js】 Node.js 与 NPM 的模块版本管理

    2017-04-09

    #Node.js#npm

  • 【Network】DNS原理分析

    2017-04-04

    #Network

  • 【C#】Visual Studio 2017 一边Debug,一边修改代码

    2017-04-03

    #C##Debug#Visual Studio

  • 【Git】 Git之忽略文件(gitignore)

    2017-04-03

    #Git#Version Control

  • 【Software Testing】 持续集成(Continuous integration)之粗浅理解

    2017-04-02

    #Software Testing

  • 【Data Format】JSON

    2017-04-01

    #JavaScript#Data Format

  • 【JavaScript】 JavaScript定时器深入解析

    2017-03-31

    #JavaScript

  • 【HTTP】URL总结

    2017-03-31

    #HTTP

  • 【VMware】 VMware12中安装macOS Sierra 10.12.3

    2017-03-13

    #macOS#VMware

  • 【SQL】 SQL 通配符使用

    2017-03-12

    #SQL

  • 【Node.js】 Node.js与NPM入门

    2017-03-11

    #Node.js#NPM

  • 【Browser】 浏览器中的缓存机制

    2017-03-02

    #Frontend#Cache#Browser

  • 【TypeScript】 TypeScript动态调试方法总结

    2017-03-02

    #Debug#TypeScript

  • My English Blog
  • My OJ Blog
  • 西维蜀黍的健身 Blog