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. 使用 Grafana 统一监控展示-对接 Zabbix

    概述 在某些情况下,Metrics 监控的 2 大顶流: Zabbix: 用于非容器的虚拟机环境 Prometheus: 用于容器的云原生环境 是共存的.但是在这种情况下,统一监控展示就不太方便,本文 ...

  2. 鸿蒙HarmonyOS实战-ArkUI组件(Navigation)

    一.Navigation Navigation组件通常作为页面的根容器,支持单页面.分栏和自适应三种显示模式.开发者可以使用Navigation组件提供的属性来设置页面的标题栏.工具栏.导航栏等. 在 ...

  3. 五款最优秀的java微服务框架

    微服务被广泛用于创建多功能的应用程序,通过组合每个功能部分并将它们逐层放在一个单元中.许多人可能没有意识到微服务是一组小型服务中制作单个应用程序的方法,每个服务都独立运行(进程). java微服务框架 ...

  4. Top 20 OpenSSH Server Best Security Practices

    Top 20 OpenSSH Server Best Security Practices by NIX Craft on July 24, 2009 · 139 comments· LAST UPD ...

  5. IIS applicationHost.config 查找历史

    背景 iis 有时候需要修改配置,一般来说,我们会去修改applicationHost.config配置,当然,很多时候我们都需要去备份一个配置文件,但是可能忘记了,那么是否有补救的方式? 补救方式 ...

  6. 《C# in depth》第6章C#6.0中的更改(十四)——表达式体

    表达式体成员是一种在C# 6及以上版本中引入的语法.它允许开发人员使用Lambda表达式来简化方法或属性的定义. 在使用表达式体成员时,可以将方法或属性的实现写在一个Lambda表达式中,然后直接返回 ...

  7. 《c#高级编程》第2章C#2.0中的更改(二)——匿名类型

    一.概念 C#中的匿名类型是一种特殊类型,可以在运行时动态创建一个对象,该对象可以包含多个属性,这些属性的名称和类型可以在创建时指定.相对于定义具体的类,匿名类型更加灵活和简洁. C#的匿名类型通常用 ...

  8. 学习 XQuery:XML数据查询的关键

    XQuery 是 XML 数据的查询语言,类似于 SQL 是数据库的查询语言.它被设计用于查询 XML 数据. XQuery 示例 for $x in doc("books.xml" ...

  9. 力扣609(java&python)-在系统中查找重复文件(中等)

    给你一个目录信息列表 paths ,包括目录路径,以及该目录中的所有文件及其内容,请你按路径返回文件系统中的所有重复文件.答案可按 任意顺序 返回. 一组重复的文件至少包括 两个 具有完全相同内容的文 ...

  10. 龙湖千丁基于 ACK@Edge 的云原生智慧停车系统架构实践

    简介: 结合龙湖千丁自研的新版停车云系统以及 ACK@Edge 提供的标准 Kubernetes 服务以及云边一体化协同解决方案,整体来着,边缘部署时间成本由 1 天缩短到 3 小时,将之前的手动升级 ...