redis集群快速搭建

1 本文以redis6.2.6版本为例,快速搭建一套三主三从的redis集群,已经提前将脚本写好,只需要在节点上面进行执行即可安装

#!/bin/bash

install_redis() {
# 解压 Redis 源码包
tar -zxvf redis-6.2.6.tar.gz # 创建目录结构
mkdir -p /opt/redis/cluster/{conf,data,log,pid} # 编译并安装 Redis
cd redis-6.2.6 && make && make install PREFIX=/opt/redis
} generate_redis_config() {
local redis_host=$1
local redis_dir="/opt/redis/cluster" for port in 6379 6380; do
mkdir -p /opt/redis/cluster/data/${port}
config_file="$redis_dir/conf/redis_${port}.conf"
cat <<EOF > "$config_file"
# Redis 配置文件,端口 ${port}
daemonize yes
bind $redis_host
dir $redis_dir/data/${port}/
pidfile $redis_dir/pid/${port}.pid
logfile $redis_dir/log/redis-cluster-${port}.log
port ${port}
cluster-enabled yes
cluster-config-file $redis_dir/conf/redis-cluster-${port}.conf
cluster-node-timeout 10000
appendonly yes
requirepass Ebupt#202401f
masterauth Ebupt#202401f
EOF
echo "已生成配置文件: $config_file"
done
} start_redis_node() {
for port in 6379 6380; do
/opt/redis/bin/redis-server /opt/redis/cluster/conf/redis_${port}.conf
echo "已启动配置文件: /opt/redis/cluster/conf/redis_${port}.conf 的节点"
done
} main() {
# 安装 Redis
install_redis # 生成 Redis 配置文件
generate_redis_config $1 # 启动 Redis 集群节点
start_redis_node # 生成集群
# yes|/opt/redis/bin/redis-cli --cluster create $1:6379 $1:6380 $1:6381 $1:6382 $1:6383 $1:6384 --cluster-replicas 1 -a
Ebupt#202401f
} main "$@"

2 将该脚本以及redis-6.2.6.tar.gz同时放置到服务器任意目录之后执行即可,这个操作需要在配置的三台上面进行配置

bash install_redis_cluster.sh xx.xx.xx.xx
#xx.xx.xx.xx为主机的IP地址

3 安装包

  链接:https://pan.baidu.com/s/1GCFILWqIrUMm4HpUFbLV_g
  提取码:hpb9

4 组成集群

/opt/redis/bin/redis-cli --cluster create host1:6379 host2:6380 host2:6379 host3:6380 host3:6379 host1:6380 --cluster-replicas 1 -a Ebupt#202401f
#host1
#host2
#host3
分别为需要部署的主机123

5 集群扩缩容或者数据迁移

  已经部署完成了一个三主三从的redis集群,配置如下所示

0927e13c0fbb246d460df7137b9f3768901add9b 10.196.52.65:6379@16379 master - 0 1715416447083 1 connected 0-5460
c1f5acfe0347804e0b57c1e20e6c3480b3eac789 10.196.52.67:6379@16379 myself,slave bb1c16862396793a606ed8c0698f5ab7e8f9aeb6 0 1715416446000 2 connected
3ce35d77a25660a093c2d36cce0c95351705259f 10.196.52.65:6380@16380 master - 0 1715416446000 7 connected 10923-16383
ae2370096014cc8b9a3d6804906d34679f519f3d 10.196.52.66:6379@16379 slave 0927e13c0fbb246d460df7137b9f3768901add9b 0 1715416446882 1 connected
4511548d363153bb5b258df324a87538d222b100 10.196.52.67:6380@16380 slave 3ce35d77a25660a093c2d36cce0c95351705259f 0 1715416447885 7 connected
bb1c16862396793a606ed8c0698f5ab7e8f9aeb6 10.196.52.66:6380@16380 master - 0 1715416448888 2 connected 5461-10922

  5.1 向集群节点添加数据

[root@yp-bz-yj4a-04 fourb]# /opt/redis/bin/redis-cli -c -h 10.196.52.67 -p 6379 -a Ebupt#202401f set 4a 4aValue
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
OK

[root@yp-bz-yj4a-04 fourb]# /opt/redis/bin/redis-cli -c -h 10.196.52.67 -p 6379 -a Ebupt#202401f set 4b 4bValue
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
OK [root@yp-bz-yj4a-04 fourb]# /opt/redis/bin/redis-cli -c -h 10.196.52.67 -p 6379 -a Ebupt#202401f set 4c 4cValue
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
OK [root@yp-bz-yj4a-04 fourb]# /opt/redis/bin/redis-cli -c -h 10.196.52.67 -p 6379 -a Ebupt#202401f set 4d 4dValue
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
OK

  查看数据是不是根据slot平铺在集群上面

[root@yp-bz-yj4a-04 fourb]# /opt/redis/bin/redis-cli -c -h 10.196.52.67 -p 6379 -a Ebupt#202401f cluster keyslot 4a
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
(integer) 13782

[root@yp-bz-yj4a-04 fourb]# /opt/redis/bin/redis-cli -c -h 10.196.52.67 -p 6379 -a Ebupt#202401f cluster keyslot 4b
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
(integer) 1461

[root@yp-bz-yj4a-05 fourb]# /opt/redis/bin/redis-cli -c -h 10.196.52.67 -p 6379 -a Ebupt#202401f cluster keyslot 4c
  Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
  (integer) 5524

[root@yp-bz-yj4a-04 fourb]# /opt/redis/bin/redis-cli -c -h 10.196.52.67 -p 6379 -a Ebupt#202401f cluster keyslot 4d
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
(integer) 9587

  查看各个节点数据情况

[root@yp-bz-yj4a-05 fourb]# /opt/redis/bin/redis-cli  -h 10.196.52.65 -p 6380 -a Ebupt#202401f
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
10.196.52.65:6380> keys *
1) "4a"
10.196.52.65:6380>
[root@yp-bz-yj4a-05 fourb]# /opt/redis/bin/redis-cli -h 10.196.52.65 -p 6379 -a Ebupt#202401f
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
10.196.52.65:6379> keys *
1) "4b"
10.196.52.65:6379>
[root@yp-bz-yj4a-05 fourb]# /opt/redis/bin/redis-cli -h 10.196.52.66 -p 6379 -a Ebupt#202401f
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
10.196.52.66:6379>
10.196.52.66:6379> keys *
1) "4b"
10.196.52.66:6379>
[root@yp-bz-yj4a-05 fourb]# /opt/redis/bin/redis-cli -h 10.196.52.66 -p 6380 -a Ebupt#202401f
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
10.196.52.66:6380> keys *
1) "4d"
2) "4c"
10.196.52.66:6380>
[root@yp-bz-yj4a-05 fourb]# /opt/redis/bin/redis-cli -h 10.196.52.67 -p 6379 -a Ebupt#202401f
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
10.196.52.67:6379> keys *
1) "4d"
2) "4c"

  可以发现所有的数据全部平铺在整个集群上面并且各个主节点和从节点的数据一致

6 扩容步骤

  向该集群重新扩容一主一从,并且把集群的slot迁移上去,已经通过前面的脚本提前将redis集群的2个节点部署完成

/opt/redis/bin/redis-cli --cluster add-node 10.196.52.64:6379 10.196.52.65:6379 -a Ebupt#202401f
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
>>> Adding node 10.196.52.64:6379 to cluster 10.196.52.65:6379
>>> Performing Cluster Check (using node 10.196.52.65:6379)
M: 0927e13c0fbb246d460df7137b9f3768901add9b 10.196.52.65:6379
slots:[0-5460] (5461 slots) master
1 additional replica(s)
M: 3ce35d77a25660a093c2d36cce0c95351705259f 10.196.52.65:6380
slots:[10923-16383] (5461 slots) master
1 additional replica(s)
S: c1f5acfe0347804e0b57c1e20e6c3480b3eac789 10.196.52.67:6379
slots: (0 slots) slave
replicates bb1c16862396793a606ed8c0698f5ab7e8f9aeb6
S: ae2370096014cc8b9a3d6804906d34679f519f3d 10.196.52.66:6379
slots: (0 slots) slave
replicates 0927e13c0fbb246d460df7137b9f3768901add9b
M: bb1c16862396793a606ed8c0698f5ab7e8f9aeb6 10.196.52.66:6380
slots:[5461-10922] (5462 slots) master
1 additional replica(s)
S: 4511548d363153bb5b258df324a87538d222b100 10.196.52.67:6380
slots: (0 slots) slave
replicates 3ce35d77a25660a093c2d36cce0c95351705259f
[OK] All nodes agree about slots configuration.
>>> Check for open slots...
>>> Check slots coverage...
[OK] All 16384 slots covered.
>>> Send CLUSTER MEET to node 10.196.52.64:6379 to make it join the cluster.
[OK] New node added correctly.

  提示已经加入成功

  在将另外一个redis节点以该节点的从节点的角色形式加入该集群

[root@yp-bz-yj4a-05 fourb]# /opt/redis/bin/redis-cli --cluster add-node 10.196.52.64:6380 10.196.52.65:6379 -a Ebupt#202401f --cluster-slave --cluster-master-id 690583bf6464147c59b8b6be5051fc1ce6b1b29b
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
>>> Adding node 10.196.52.64:6380 to cluster 10.196.52.65:6379
>>> Performing Cluster Check (using node 10.196.52.65:6379)
M: 0927e13c0fbb246d460df7137b9f3768901add9b 10.196.52.65:6379
slots:[0-5460] (5461 slots) master
1 additional replica(s)
M: 690583bf6464147c59b8b6be5051fc1ce6b1b29b 10.196.52.64:6379
slots: (0 slots) master
M: 3ce35d77a25660a093c2d36cce0c95351705259f 10.196.52.65:6380
slots:[10923-16383] (5461 slots) master
1 additional replica(s)
S: c1f5acfe0347804e0b57c1e20e6c3480b3eac789 10.196.52.67:6379
slots: (0 slots) slave
replicates bb1c16862396793a606ed8c0698f5ab7e8f9aeb6
S: ae2370096014cc8b9a3d6804906d34679f519f3d 10.196.52.66:6379
slots: (0 slots) slave
replicates 0927e13c0fbb246d460df7137b9f3768901add9b
M: bb1c16862396793a606ed8c0698f5ab7e8f9aeb6 10.196.52.66:6380
slots:[5461-10922] (5462 slots) master
1 additional replica(s)
S: 4511548d363153bb5b258df324a87538d222b100 10.196.52.67:6380
slots: (0 slots) slave
replicates 3ce35d77a25660a093c2d36cce0c95351705259f
[OK] All nodes agree about slots configuration.
>>> Check for open slots...
>>> Check slots coverage...
[OK] All 16384 slots covered.
>>> Send CLUSTER MEET to node 10.196.52.64:6380 to make it join the cluster.
Waiting for the cluster to join >>> Configure node as replica of 10.196.52.64:6379.
[OK] New node added correctly.

  提示加入成功,可以看到集群已经变成四主四从了,但是此时新加入的节点没有slot,无法存储数据

0927e13c0fbb246d460df7137b9f3768901add9b 10.196.52.65:6379@16379 master - 0 1715420336980 1 connected 0-5460
c1f5acfe0347804e0b57c1e20e6c3480b3eac789 10.196.52.67:6379@16379 myself,slave bb1c16862396793a606ed8c0698f5ab7e8f9aeb6 0 1715420333000 2 connected
3ce35d77a25660a093c2d36cce0c95351705259f 10.196.52.65:6380@16380 master - 0 1715420336000 7 connected 10923-16383
ae2370096014cc8b9a3d6804906d34679f519f3d 10.196.52.66:6379@16379 slave 0927e13c0fbb246d460df7137b9f3768901add9b 0 1715420335000 1 connected
eeffd828d55d8f321c709ab16b91e13086c9d0ff 10.196.52.64:6380@16380 slave 690583bf6464147c59b8b6be5051fc1ce6b1b29b 0 1715420337983 0 connected
4511548d363153bb5b258df324a87538d222b100 10.196.52.67:6380@16380 slave 3ce35d77a25660a093c2d36cce0c95351705259f 0 1715420336000 7 connected
690583bf6464147c59b8b6be5051fc1ce6b1b29b 10.196.52.64:6379@16379 master - 0 1715420336000 0 connected #####新加入的节点,无slot
bb1c16862396793a606ed8c0698f5ab7e8f9aeb6 10.196.52.66:6380@16380 master - 0 1715420337000 2 connected 5461-10922

  迁移slot

/opt/redis/bin/redis-cli --cluster reshard 10.196.52.65:6379 -a Ebupt#202401
之后依次选择
接受的节点
slot数量
数据的节点
之后进行迁移
0927e13c0fbb246d460df7137b9f3768901add9b 10.196.52.65:6379@16379 master - 0 1715421403000 1 connected 0-5460
c1f5acfe0347804e0b57c1e20e6c3480b3eac789 10.196.52.67:6379@16379 myself,slave bb1c16862396793a606ed8c0698f5ab7e8f9aeb6 0 1715421402000 2 connected
3ce35d77a25660a093c2d36cce0c95351705259f 10.196.52.65:6380@16380 master - 0 1715421404392 7 connected 10923-16383
ae2370096014cc8b9a3d6804906d34679f519f3d 10.196.52.66:6379@16379 slave 0927e13c0fbb246d460df7137b9f3768901add9b 0 1715421406000 1 connected
eeffd828d55d8f321c709ab16b91e13086c9d0ff 10.196.52.64:6380@16380 slave 690583bf6464147c59b8b6be5051fc1ce6b1b29b 0 1715421406398 0 connected
4511548d363153bb5b258df324a87538d222b100 10.196.52.67:6380@16380 slave 3ce35d77a25660a093c2d36cce0c95351705259f 0 1715421404000 7 connected
690583bf6464147c59b8b6be5051fc1ce6b1b29b 10.196.52.64:6379@16379 master - 0 1715421404000 0 connected
bb1c16862396793a606ed8c0698f5ab7e8f9aeb6 10.196.52.66:6380@16380 master - 0 1715421403000 2 connected 5461-10922
10.196.52.67:6379> cluster nodes
0927e13c0fbb246d460df7137b9f3768901add9b 10.196.52.65:6379@16379 master - 0 1715422069775 1 connected 0-5460
c1f5acfe0347804e0b57c1e20e6c3480b3eac789 10.196.52.67:6379@16379 myself,slave 690583bf6464147c59b8b6be5051fc1ce6b1b29b 0 1715422065000 8 connected
3ce35d77a25660a093c2d36cce0c95351705259f 10.196.52.65:6380@16380 master - 0 1715422067063 7 connected 10923-16383
ae2370096014cc8b9a3d6804906d34679f519f3d 10.196.52.66:6379@16379 slave 0927e13c0fbb246d460df7137b9f3768901add9b 0 1715422067000 1 connected
eeffd828d55d8f321c709ab16b91e13086c9d0ff 10.196.52.64:6380@16380 slave 690583bf6464147c59b8b6be5051fc1ce6b1b29b 0 1715422068000 8 connected
4511548d363153bb5b258df324a87538d222b100 10.196.52.67:6380@16380 slave 3ce35d77a25660a093c2d36cce0c95351705259f 0 1715422068770 7 connected
690583bf6464147c59b8b6be5051fc1ce6b1b29b 10.196.52.64:6379@16379 master - 0 1715422069000 8 connected 5461-10922
bb1c16862396793a606ed8c0698f5ab7e8f9aeb6 10.196.52.66:6380@16380 slave 690583bf6464147c59b8b6be5051fc1ce6b1b29b 0 1715422067063 8 connected

可以看到完成了节点的所有slot的迁移

查验一下数据

Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
10.196.52.64:6379> keys *
1) "4d"
2) "4c"
10.196.52.64:6379>
[root@yp-bz-yj4a-04 fourb]# /opt/redis/bin/redis-cli -h 10.196.52.66 -p 6380 -a Ebupt#202401f
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
10.196.52.66:6380> keys *
1) "4d"
2) "4c"
10.196.52.66:6380> get 4d
(error) MOVED 9587 10.196.52.64:6379

数据以及slot全部迁移过去,但是原来的节点数据依然也还在 待续。。。

2024-05-13继续

  之前迁移的时候检查原来的数据还在,slot迁移完之后数据还是存在的,然后迁移走的slot的节点的主从都会自动成为接受slot节点的从节点,也就是接收端的redis会成为一主和三个从节点

的集群

0927e13c0fbb246d460df7137b9f3768901add9b 10.196.52.65:6379@16379 master - 0 1715567317229 1 connected 0-5460
c1f5acfe0347804e0b57c1e20e6c3480b3eac789 10.196.52.67:6379@16379 myself,slave 690583bf6464147c59b8b6be5051fc1ce6b1b29b 0 1715567314000 8 connected
3ce35d77a25660a093c2d36cce0c95351705259f 10.196.52.65:6380@16380 master - 0 1715567316000 7 connected 10923-16383
ae2370096014cc8b9a3d6804906d34679f519f3d 10.196.52.66:6379@16379 slave 0927e13c0fbb246d460df7137b9f3768901add9b 0 1715567315000 1 connected
eeffd828d55d8f321c709ab16b91e13086c9d0ff 10.196.52.64:6380@16380 slave 690583bf6464147c59b8b6be5051fc1ce6b1b29b 0 1715567317000 8 connected
4511548d363153bb5b258df324a87538d222b100 10.196.52.67:6380@16380 slave 3ce35d77a25660a093c2d36cce0c95351705259f 0 1715567316226 7 connected
690583bf6464147c59b8b6be5051fc1ce6b1b29b 10.196.52.64:6379@16379 master - 0 1715567315224 8 connected 5461-10922
bb1c16862396793a606ed8c0698f5ab7e8f9aeb6 10.196.52.66:6380@16380 slave 690583bf6464147c59b8b6be5051fc1ce6b1b29b 0 1715567314000 8 connected

  剔除迁移走的两个节点的数据

[root@yp-bz-yj4a-06 fourb]# /opt/redis/bin/redis-cli -h 10.196.52.67 -p 6379 -a Ebupt#202401f --cluster del-node 10.196.52.66:6380 bb1c16862396793a606ed8c0698f5ab7e8f9aeb6
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
>>> Removing node bb1c16862396793a606ed8c0698f5ab7e8f9aeb6 from cluster 10.196.52.66:6380
>>> Sending CLUSTER FORGET messages to the cluster...
>>> Sending CLUSTER RESET SOFT to the deleted node.
[root@yp-bz-yj4a-06 fourb]# /opt/redis/bin/redis-cli -h 10.196.52.65 -p 6379 -a Ebupt#202401f --cluster del-node 10.196.52.67:6379 c1f5acfe0347804e0b57c1e20e6c3480b3eac789
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
>>> Removing node c1f5acfe0347804e0b57c1e20e6c3480b3eac789 from cluster 10.196.52.67:6379
>>> Sending CLUSTER FORGET messages to the cluster...
>>> Sending CLUSTER RESET SOFT to the deleted node.

  迁移过之后的redis集群

[root@yp-bz-yj4a-05 fourb]# /opt/redis/bin/redis-cli -h 10.196.52.65 -p 6379 -a Ebupt#202401f
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
10.196.52.65:6379> cluster nodes
eeffd828d55d8f321c709ab16b91e13086c9d0ff 10.196.52.64:6380@16380 slave 690583bf6464147c59b8b6be5051fc1ce6b1b29b 0 1715568173000 8 connected
690583bf6464147c59b8b6be5051fc1ce6b1b29b 10.196.52.64:6379@16379 master - 0 1715568172000 8 connected 5461-10922
3ce35d77a25660a093c2d36cce0c95351705259f 10.196.52.65:6380@16380 master - 0 1715568174000 7 connected 10923-16383
0927e13c0fbb246d460df7137b9f3768901add9b 10.196.52.65:6379@16379 myself,master - 0 1715568172000 1 connected 0-5460
ae2370096014cc8b9a3d6804906d34679f519f3d 10.196.52.66:6379@16379 slave 0927e13c0fbb246d460df7137b9f3768901add9b 0 1715568173000 1 connected
4511548d363153bb5b258df324a87538d222b100 10.196.52.67:6380@16380 slave 3ce35d77a25660a093c2d36cce0c95351705259f 0 1715568174899 7 connected

  常用命令整合

1 向redis集群添加添加数据
/opt/redis/bin/redis-cli -c -h 10.196.52.67 -p 6379 -a Ebupt#202401f set 4c 4cValue

2 查找集群数据所在的slot
/opt/redis/bin/redis-cli -c -h 10.196.52.67 -p 6379 -a Ebupt#202401f cluster keyslot 4a

3 查询节点的数据
/opt/redis/bin/redis-cli -h 10.196.52.65 -p 6380 -a Ebupt#202401f

4 向集群添加节点(自动会成为主节点)
/opt/redis/bin/redis-cli --cluster add-node 10.196.52.64:6379 10.196.52.65:6379 -a Ebupt#202401f

5 向刚加的主节点添加从节点
/opt/redis/bin/redis-cli --cluster add-node 10.196.52.64:6380 10.196.52.65:6379 -a Ebupt#202401f --cluster-slave --cluster-master-id 690583bf6464147c59b8b6be5051fc1ce6b1b29b
 
6 slot迁移
/opt/redis/bin/redis-cli --cluster reshard 10.196.52.65:6379 -a Ebupt#202401
 
 
7 删除节点
/opt/redis/bin/redis-cli -h 10.196.52.67 -p 6379 -a Ebupt#202401f --cluster del-node 10.196.52.66:6380 bb1c16862396793a606ed8c0698f5ab7e8f9aeb6

redis三主三从集群快速搭建的更多相关文章

  1. Redis 3主-3从集群的搭建(CentOS 7)

    注意ip地址为: 虚拟机ip设置 TYPE="Ethernet"BOOTPROTO="static"NAME="enp0s3"DEVICE= ...

  2. Zookeeper集群快速搭建

    Zookeeper集群快速搭建 1.cd /usr/local/zookeeper/conf(如在192.168.212.101服务器) mv zoo_sample.cfg zoo.cfg 修改con ...

  3. Redis 非关系性数据库集群的搭建与常用方法

    redis 非关系型数据库,内存型数据库,现在大家都不陌生了,无论大中小型企业,都会将redis应用到自己的项目中,以此来减轻数据库的压力 安装步骤: 1.安装gcc 安装c语言的编译环境 yum i ...

  4. Redis Cluster 4.0.9 集群安装搭建

    Redis Cluster 4.0.9集群搭建步骤:yum install -y gcc g++ gcc-c++ make openssl cd redis-4.0.9 make mkdir -p / ...

  5. Docker:docker搭建redis一主多从集群(配置哨兵模式)

    角色 实例IP 实例端口 宿主机IP 宿主机端口 master 172.19.0.2 6382 192.168.1.200 6382 slave01 172.19.0.3 6383 192.168.1 ...

  6. storm集群快速搭建

    sudo mkdir /export/serverssudo chmod -R 777 /exportmkdir /export/servers tar -zxvf apache-storm-1.0. ...

  7. Mysql双主双从高可用集群的搭建且与MyCat进行整合

    1.概述 老话说的好:瞻前顾后.患得患失只会让我们失败,下定决心,干就完了. 言归正传,之前我们聊了Mysql的一主一从读写分离集群的搭建,虽然一主一从或一主多从集群解决了并发读的问题,但由于主节点只 ...

  8. Redis Cluster 集群三主三从高可用环境搭建

    前言 Redis 是我们目前大规模使用的缓存中间件,由于它强大高效而又便捷的功能,得到了广泛的使用. Window环境下载地址:https://github.com/tporadowski/redis ...

  9. centos 7 两台机器搭建三主三从 redis 集群

    参考自:https://linux.cn/article-6719-1.htmlhttp://blog.csdn.net/xu470438000/article/details/42971091 ## ...

  10. 搭建Redis三主三从集群

    Redis三主三从集群规划 10.0.128.19   使用端口 7000  7001 10.0.128.22   使用端口 7002  7003 10.0.128.23   使用端口 7004  7 ...

随机推荐

  1. 深入理解 Java 多线程、Lambda 表达式及线程安全最佳实践

    Java 线程 线程使程序能够通过同时执行多个任务而更有效地运行. 线程可用于在不中断主程序的情况下在后台执行复杂的任务. 创建线程 有两种创建线程的方式. 扩展Thread类 可以通过扩展Threa ...

  2. MySQL 数据库操作指南:LIMIT,OFFSET 和 JOIN 的使用

    限制结果 您可以通过使用"LIMIT"语句来限制查询返回的记录数量.以下是一个示例,获取您自己的Python服务器中"customers"表中的前5条记录: i ...

  3. SQL 算术运算符:加法、减法、乘法、除法和取模的用法

    SQL Server中的存储过程 什么是存储过程? 存储过程是一段预先编写好的 SQL 代码,可以保存在数据库中以供反复使用.它允许将一系列 SQL 语句组合成一个逻辑单元,并为其分配一个名称,以便在 ...

  4. 拥抱开源更省钱「GitHub 热点速览」

    免费.低成本.自托管.开源替代品...这些词就是本周的热门开源项目的关键字.常见的 AI 提升图片分辨率的工具,大多是在线服务或者调用接口的客户端,而「Upscaler」是一款下载即用的免费 AI 图 ...

  5. Mysql系列:Mysql5.7编译安装--系统环境:Centos7 / CentOS9 Stream

    Mysql系列:Mysql5.7编译安装 系统环境:Centos7 / CentOS9 Stream 1:下载mysql源码包 https://dev.mysql.com/downloads/mysq ...

  6. js 是单线程吗?

    前言 在html5中,js中允许操作多个线程执行,但是不能操作dom元素,这是一个痛点. 但是在mvvm依然存在很大的作用力,因为我们只需要操作数据,在操作数据的时候委托机制在主线程中就实现了对dom ...

  7. js es6 Iterator

    1.遍历器(Iterator)是一种接口,为各种不同的数据结构提供统一的访问机制.任何数据结构只要部署Iterator接口,就可以完成遍历操作(即依次处理该数据结构的所有成员). 2.Iterator ...

  8. 【Oracle】PL/SQL制作唯一标识,固定字段+日期+流水码,流水码每日重置

    [Oracle]PL/SQL制作唯一标识,固定字段+日期+流水码,流水码每日重置 首先创建序列 create sequence sequence_name minvalue 0 maxvalue 99 ...

  9. Redis 7.0 Multi Part AOF的设计和实现

    ​简介:本文将详解Redis中现有AOF机制的一些不足以及Redis 7.0中引入的Multi Part AOF的设计和实现细节. Redis 作为一种非常流行的内存数据库,通过将数据保存在内存中,R ...

  10. 探究 Java 应用的启动速度优化

    简介: Java 的执行效率非常高,约为最快的C语言的一半.这在主流的编程语言中,仅次于C.Rust 和 C++.但在高性能的背后,Java 的启动性能差也令人印象深刻,大家印象中的 Java 笨重缓 ...