redis三主三从集群快速搭建
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
redis三主三从集群快速搭建的更多相关文章
- Redis 3主-3从集群的搭建(CentOS 7)
注意ip地址为: 虚拟机ip设置 TYPE="Ethernet"BOOTPROTO="static"NAME="enp0s3"DEVICE= ...
- Zookeeper集群快速搭建
Zookeeper集群快速搭建 1.cd /usr/local/zookeeper/conf(如在192.168.212.101服务器) mv zoo_sample.cfg zoo.cfg 修改con ...
- Redis 非关系性数据库集群的搭建与常用方法
redis 非关系型数据库,内存型数据库,现在大家都不陌生了,无论大中小型企业,都会将redis应用到自己的项目中,以此来减轻数据库的压力 安装步骤: 1.安装gcc 安装c语言的编译环境 yum i ...
- 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 / ...
- 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 ...
- storm集群快速搭建
sudo mkdir /export/serverssudo chmod -R 777 /exportmkdir /export/servers tar -zxvf apache-storm-1.0. ...
- Mysql双主双从高可用集群的搭建且与MyCat进行整合
1.概述 老话说的好:瞻前顾后.患得患失只会让我们失败,下定决心,干就完了. 言归正传,之前我们聊了Mysql的一主一从读写分离集群的搭建,虽然一主一从或一主多从集群解决了并发读的问题,但由于主节点只 ...
- Redis Cluster 集群三主三从高可用环境搭建
前言 Redis 是我们目前大规模使用的缓存中间件,由于它强大高效而又便捷的功能,得到了广泛的使用. Window环境下载地址:https://github.com/tporadowski/redis ...
- centos 7 两台机器搭建三主三从 redis 集群
参考自:https://linux.cn/article-6719-1.htmlhttp://blog.csdn.net/xu470438000/article/details/42971091 ## ...
- 搭建Redis三主三从集群
Redis三主三从集群规划 10.0.128.19 使用端口 7000 7001 10.0.128.22 使用端口 7002 7003 10.0.128.23 使用端口 7004 7 ...
随机推荐
- 分析即服务(AaaS)是什么?终于有人讲清楚了
随着世界数据领域的地位和规模的不断扩大,大数据.人工智能和云计算正在结合起来,以分析即服务的形式为企业提供急需的喘息机会 . 让我们简要回顾一下 2010 年以来发生的事情. 这十年来我们见证了许多技 ...
- openGauss支持国密SM3和SM4算法
国密算法介绍 国密即国家密码局认定的国产密码算法,主要有 SM1,SM2,SM3,SM4.密钥长度和分组长度均为 128 位.针对银行客户对数据库安全能力的诉求以及提高产品安全竞争力的要求,进行数据库 ...
- 如何巧妙应对iOS键盘难题?
前言 写过移动端的同学或多或少都遇到过软键盘带来的各种各样的问题,最典型的就是输入框被软键盘遮挡.fixed元素失效等问题,并且这些问题在iOS上的表现让人难以接受. webview的差异 在移动端上 ...
- c# assembly.GetManifestResourceStream找不到路径
前言 最近发现一个问题,用assembly.GetManifestResourceStream去找资源路径xml的时候,发现找不到,然后有些xml资源又可以找到,这时候有两种思维来思考. 正文 第一种 ...
- Javascript中的继承?如何实现继承?
一.是什么 继承(inheritance)是面向对象软件技术当中的一个概念 如果一个类别B"继承自"另一个类别A,就把这个B称为"A的子类",而把A称为&quo ...
- huggingface vit训练CIFAR10数据集代码 ,可以改dataset训练自己的数据
上代码,使用hugging face fineturn vit模型 自己写的代码 from transformers import ViTImageProcessor, ViTForImageClas ...
- few-shot-learning for object detection
github https://github.com/LiuXinyu12378/few-shot-learning-for-object-detection train.py from __futu ...
- 07cj031,07CJ03-1图集免费下载
简介 07CJ03-1轻钢龙骨石膏板隔墙.吊顶图集是中国建筑标准设计研究院组织编写的一部针对轻钢龙骨.石膏板材料用于非承重隔墙.室内吊顶装修的装修.建造参考资料,为用户提供专业的建造参考 下载 有需要 ...
- 【Oracle】ORDER BY 2 DESC,1 ASC,同时对多个数据列进行不同的顺序排序&Oracle中的 (+)
最初想对 travelled_distance 降序排列 ,如果有两个或者更多的用户旅行了相同的距离, 那么再以 name 升序排列 然后就写了下面的 SELECT U.NAME name, NVL( ...
- 力扣476(java)-数字的补数(简单)
题目: 对整数的二进制表示取反(0 变 1 ,1 变 0)后,再转换为十进制表示,可以得到这个整数的补数. 例如,整数 5 的二进制表示是 "101" ,取反后得到 "0 ...