redis-cluster集群添加或删除节点以及槽重新分片

2023-11-14

Redis版本:5.0.0
redis 5.0.0版本后可以不用安装ruby环境.
集群命令说明:

redis-cli --cluster help
Cluster Manager Commands:
  create         host1:port1 ... hostN:portN   #创建集群
                 --cluster-replicas <arg>      #从节点个数
  check          host:port                     #检查集群
                 --cluster-search-multiple-owners #检查是否有槽同时被分配给了多个节点
  info           host:port                     #查看集群状态
  fix            host:port                     #修复集群
                 --cluster-search-multiple-owners #修复槽的重复分配问题
  reshard        host:port                     #指定集群的任意一节点进行迁移slot,重新分slots
                 --cluster-from <arg>          #需要从哪些源节点上迁移slot,可从多个源节点完成迁移,以逗号隔开,传递的是节点的node id,还可以直接传递--from all,这样源节点就是集群的所有节点,不传递该参数的话,则会在迁移过程中提示用户输入
                 --cluster-to <arg>            #slot需要迁移的目的节点的node id,目的节点只能填写一个,不传递该参数的话,则会在迁移过程中提示用户输入
                 --cluster-slots <arg>         #需要迁移的slot数量,不传递该参数的话,则会在迁移过程中提示用户输入。
                 --cluster-yes                 #指定迁移时的确认输入
                 --cluster-timeout <arg>       #设置migrate命令的超时时间
                 --cluster-pipeline <arg>      #定义cluster getkeysinslot命令一次取出的key数量,不传的话使用默认值为10
                 --cluster-replace             #是否直接replace到目标节点
  rebalance      host:port                                      #指定集群的任意一节点进行平衡集群节点slot数量 
                 --cluster-weight <node1=w1...nodeN=wN>         #指定集群节点的权重
                 --cluster-use-empty-masters                    #设置可以让没有分配slot的主节点参与,默认不允许
                 --cluster-timeout <arg>                        #设置migrate命令的超时时间
                 --cluster-simulate                             #模拟rebalance操作,不会真正执行迁移操作
                 --cluster-pipeline <arg>                       #定义cluster getkeysinslot命令一次取出的key数量,默认值为10
                 --cluster-threshold <arg>                      #迁移的slot阈值超过threshold,执行rebalance操作
                 --cluster-replace                              #是否直接replace到目标节点
  add-node       new_host:new_port existing_host:existing_port  #添加节点,把新节点加入到指定的集群,默认添加主节点
                 --cluster-slave                                #新节点作为从节点,默认随机一个主节点
                 --cluster-master-id <arg>                      #给新节点指定主节点
  del-node       host:port node_id                              #删除给定的一个节点,成功后关闭该节点服务
  call           host:port command arg arg .. arg               #在集群的所有节点执行相关命令
  set-timeout    host:port milliseconds                         #设置cluster-node-timeout
  import         host:port                                      #将外部redis数据导入集群
                 --cluster-from <arg>                           #将指定实例的数据导入到集群
                 --cluster-copy                                 #migrate时指定copy
                 --cluster-replace                              #migrate时指定replace
  help           

For check, fix, reshard, del-node, set-timeout you can specify the host and port of any working node in the cluster.

Redis群集TCP端口说明:
每个Redis群集节点都需要打开两个TCP连接。用于服务客户端的常规Redis TCP端口,例如6379,再加上将数据端口加10000所获得的端口,因此在示例中为16379。

第二个高端口用于群集总线,即使用二进制协议的节点到节点通信通道。节点将群集总线用于故障检测,配置更新,故障转移授权等。客户端永远不要尝试与群集总线端口进行通信,而应始终与普通的Redis命令端口进行通信,但是请确保您在防火墙中同时打开了这两个端口,否则Redis群集节点将无法进行通信。

命令端口和集群总线端口的偏移量是固定的,并且始终为10000。

请注意,对于每个节点,要使Redis群集正常工作,您需要:

普通客户端通信端口(通常为6379)用于与客户端通信,以向需要访问群集的所有客户端以及所有其他群集节点(使用客户端端口进行密钥迁移)开放。
群集总线端口(客户端端口+ 10000)必须可以从所有其他群集节点访问。
如果您没有同时打开两个TCP端口,则群集将无法正常工作。

集群总线使用不同的二进制协议进行节点到节点的数据交换,它更适合于使用很少的带宽和处理时间在节点之间交换信息。

环境说明:
172.16.1.102:7000-7005 总共六个节点的集群,3主3从。
启动多两个多端口7006 7007,如何启动请参考搭建redis5.0.4集群

实验

###测试环境
[root@localhosts redis]# redis-cli -a 123456 --cluster check 172.16.1.102:7000
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
172.16.1.102:7000 (a968b760...) -> 33321 keys | 5461 slots | 1 slaves.
172.16.1.102:7001 (d42969de...) -> 33390 keys | 5462 slots | 1 slaves.
172.16.1.102:7002 (93faf299...) -> 33291 keys | 5461 slots | 1 slaves.
[OK] 100002 keys in 3 masters.
6.10 keys per slot on average.
>>> Performing Cluster Check (using node 172.16.1.102:7000)
M: a968b7602483bd05f0f7ea5c2cc13eeff6ee7918 172.16.1.102:7000
   slots:[0-5460] (5461 slots) master
   1 additional replica(s)
S: 0a2ff6c720ba32c398c8fc3d5ef14bd241252904 172.16.1.102:7005
   slots: (0 slots) slave
   replicates 93faf299a645c7eaac1b898fde6da48de28c6f1c
S: 4672c47668ea7f179f484cb64bc00e1347155ff5 172.16.1.102:7004
   slots: (0 slots) slave
   replicates d42969de78528d247580a39106e594dfbf9b1005
M: d42969de78528d247580a39106e594dfbf9b1005 172.16.1.102:7001
   slots:[5461-10922] (5462 slots) master
   1 additional replica(s)
M: 93faf299a645c7eaac1b898fde6da48de28c6f1c 172.16.1.102:7002
   slots:[10923-16383] (5461 slots) master
   1 additional replica(s)
S: 6d31edca810ddcef5c1191394aec1153c159a7dc 172.16.1.102:7003
   slots: (0 slots) slave
   replicates a968b7602483bd05f0f7ea5c2cc13eeff6ee7918
[OK] All nodes agree about slots configuration.
>>> Check for open slots...
>>> Check slots coverage...
[OK] All 16384 slots covered. 

#添加节点,把7006节点 添加  到 现在有的集群上
[root@localhosts redis]# redis-cli -a 123456 --cluster add-node 172.16.1.102:7006  172.16.1.102:7000
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
>>> Adding node 172.16.1.102:7006 to cluster 172.16.1.102:7000
>>> Performing Cluster Check (using node 172.16.1.102:7000)
M: a968b7602483bd05f0f7ea5c2cc13eeff6ee7918 172.16.1.102:7000
   slots:[0-5460] (5461 slots) master
   1 additional replica(s)
S: 0a2ff6c720ba32c398c8fc3d5ef14bd241252904 172.16.1.102:7005
   slots: (0 slots) slave
   replicates 93faf299a645c7eaac1b898fde6da48de28c6f1c
S: 4672c47668ea7f179f484cb64bc00e1347155ff5 172.16.1.102:7004
   slots: (0 slots) slave
   replicates d42969de78528d247580a39106e594dfbf9b1005
M: d42969de78528d247580a39106e594dfbf9b1005 172.16.1.102:7001
   slots:[5461-10922] (5462 slots) master
   1 additional replica(s)
M: 93faf299a645c7eaac1b898fde6da48de28c6f1c 172.16.1.102:7002
   slots:[10923-16383] (5461 slots) master
   1 additional replica(s)
S: 6d31edca810ddcef5c1191394aec1153c159a7dc 172.16.1.102:7003
   slots: (0 slots) slave
   replicates a968b7602483bd05f0f7ea5c2cc13eeff6ee7918
[OK] All nodes agree about slots configuration.
>>> Check for open slots...
>>> Check slots coverage...
[OK] All 16384 slots covered.
>>> Send CLUSTER MEET to node 172.16.1.102:7006 to make it join the cluster.
[OK] New node added correctly.  

#再次check集群信息, 发现4个主3从,但是新加入的主slots 为0
[root@localhosts redis]# redis-cli -a 123456 --cluster check 172.16.1.102:7000          Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
172.16.1.102:7000 (a968b760...) -> 33321 keys | 5461 slots | 1 slaves.
172.16.1.102:7006 (3bf112e8...) -> 0 keys | 0 slots | 0 slaves.
172.16.1.102:7001 (d42969de...) -> 33390 keys | 5462 slots | 1 slaves.
172.16.1.102:7002 (93faf299...) -> 33291 keys | 5461 slots | 1 slaves.
[OK] 100002 keys in 4 masters.
6.10 keys per slot on average.
>>> Performing Cluster Check (using node 172.16.1.102:7000)
M: a968b7602483bd05f0f7ea5c2cc13eeff6ee7918 172.16.1.102:7000
   slots:[0-5460] (5461 slots) master
   1 additional replica(s)
S: 0a2ff6c720ba32c398c8fc3d5ef14bd241252904 172.16.1.102:7005
   slots: (0 slots) slave
   replicates 93faf299a645c7eaac1b898fde6da48de28c6f1c
S: 4672c47668ea7f179f484cb64bc00e1347155ff5 172.16.1.102:7004
   slots: (0 slots) slave
   replicates d42969de78528d247580a39106e594dfbf9b1005
M: 3bf112e8fab64ddae44eaf33c7c13eff1a536112 172.16.1.102:7006
   slots: (0 slots) master
M: d42969de78528d247580a39106e594dfbf9b1005 172.16.1.102:7001
   slots:[5461-10922] (5462 slots) master
   1 additional replica(s)
M: 93faf299a645c7eaac1b898fde6da48de28c6f1c 172.16.1.102:7002
   slots:[10923-16383] (5461 slots) master
   1 additional replica(s)
S: 6d31edca810ddcef5c1191394aec1153c159a7dc 172.16.1.102:7003
   slots: (0 slots) slave
   replicates a968b7602483bd05f0f7ea5c2cc13eeff6ee7918
[OK] All nodes agree about slots configuration.
>>> Check for open slots...
>>> Check slots coverage...
[OK] All 16384 slots covered.

[root@localhosts redis]# redis-cli -a 123456 --cluster info 172.16.1.102:7000 
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
172.16.1.102:7000 (a968b760...) -> 33321 keys | 5461 slots | 1 slaves.
172.16.1.102:7006 (3bf112e8...) -> 0 keys | 0 slots | 0 slaves.
172.16.1.102:7001 (d42969de...) -> 33390 keys | 5462 slots | 1 slaves.
172.16.1.102:7002 (93faf299...) -> 33291 keys | 5461 slots | 1 slaves.
[OK] 100002 keys in 4 masters.
6.10 keys per slot on average.


#把7007做为7006的slave,7006是master
[root@localhosts redis]# redis-cli -a 123456 --cluster add-node  --cluster-slave  --cluster-master-id 3bf112e8fab64ddae44eaf33c7c13eff1a536112 172.16.1.102:7007 172.16.1.102:7000 
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
>>> Adding node 172.16.1.102:7007 to cluster 172.16.1.102:7000
>>> Performing Cluster Check (using node 172.16.1.102:7000)
M: a968b7602483bd05f0f7ea5c2cc13eeff6ee7918 172.16.1.102:7000
   slots:[0-5460] (5461 slots) master
   1 additional replica(s)
S: 0a2ff6c720ba32c398c8fc3d5ef14bd241252904 172.16.1.102:7005
   slots: (0 slots) slave
   replicates 93faf299a645c7eaac1b898fde6da48de28c6f1c
S: 4672c47668ea7f179f484cb64bc00e1347155ff5 172.16.1.102:7004
   slots: (0 slots) slave
   replicates d42969de78528d247580a39106e594dfbf9b1005
M: 3bf112e8fab64ddae44eaf33c7c13eff1a536112 172.16.1.102:7006
   slots: (0 slots) master
M: d42969de78528d247580a39106e594dfbf9b1005 172.16.1.102:7001
   slots:[5461-10922] (5462 slots) master
   1 additional replica(s)
M: 93faf299a645c7eaac1b898fde6da48de28c6f1c 172.16.1.102:7002
   slots:[10923-16383] (5461 slots) master
   1 additional replica(s)
S: 6d31edca810ddcef5c1191394aec1153c159a7dc 172.16.1.102:7003
   slots: (0 slots) slave
   replicates a968b7602483bd05f0f7ea5c2cc13eeff6ee7918
[OK] All nodes agree about slots configuration.
>>> Check for open slots...
>>> Check slots coverage...
[OK] All 16384 slots covered.
>>> Send CLUSTER MEET to node 172.16.1.102:7007 to make it join the cluster.
Waiting for the cluster to join

>>> Configure node as replica of 172.16.1.102:7006.
[OK] New node added correctly.

 
#再次check集群信息 ,每个主都有一个从。
[root@localhosts redis]# redis-cli -a 123456 --cluster check 172.16.1.102:7000          Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
172.16.1.102:7000 (a968b760...) -> 33321 keys | 5461 slots | 1 slaves.
172.16.1.102:7006 (3bf112e8...) -> 0 keys | 0 slots | 1 slaves.
172.16.1.102:7001 (d42969de...) -> 33390 keys | 5462 slots | 1 slaves.
172.16.1.102:7002 (93faf299...) -> 33291 keys | 5461 slots | 1 slaves.
[OK] 100002 keys in 4 masters.
6.10 keys per slot on average.
>>> Performing Cluster Check (using node 172.16.1.102:7000)
M: a968b7602483bd05f0f7ea5c2cc13eeff6ee7918 172.16.1.102:7000
   slots:[0-5460] (5461 slots) master
   1 additional replica(s)
S: 0a2ff6c720ba32c398c8fc3d5ef14bd241252904 172.16.1.102:7005
   slots: (0 slots) slave
   replicates 93faf299a645c7eaac1b898fde6da48de28c6f1c
S: 4672c47668ea7f179f484cb64bc00e1347155ff5 172.16.1.102:7004
   slots: (0 slots) slave
   replicates d42969de78528d247580a39106e594dfbf9b1005
M: 3bf112e8fab64ddae44eaf33c7c13eff1a536112 172.16.1.102:7006
   slots: (0 slots) master
   1 additional replica(s)
M: d42969de78528d247580a39106e594dfbf9b1005 172.16.1.102:7001
   slots:[5461-10922] (5462 slots) master
   1 additional replica(s)
M: 93faf299a645c7eaac1b898fde6da48de28c6f1c 172.16.1.102:7002
   slots:[10923-16383] (5461 slots) master
   1 additional replica(s)
S: 2297a3c5efd6e459539f562faf35edafd3566889 172.16.1.102:7007
   slots: (0 slots) slave
   replicates 3bf112e8fab64ddae44eaf33c7c13eff1a536112
S: 6d31edca810ddcef5c1191394aec1153c159a7dc 172.16.1.102:7003
   slots: (0 slots) slave
   replicates a968b7602483bd05f0f7ea5c2cc13eeff6ee7918
[OK] All nodes agree about slots configuration.
>>> Check for open slots...
>>> Check slots coverage...
[OK] All 16384 slots covered.

#把7000的master槽 全部移动到 7006 上,7006现在slot为0, 7000总共有5461个槽位,--cluster-slots 5461
redis-cli -a 123456 --cluster reshard 172.16.1.102:7001 --cluster-from a968b7602483bd05f0f7ea5c2cc13eeff6ee7918 --cluster-to 3bf112e8fab64ddae44eaf33c7c13eff1a536112 --cluster-slots 5461
yes
yes


#再次check集群信息
[root@localhosts redis]# redis-cli -a 123456 --cluster check 172.16.1.102:7000          Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
172.16.1.102:7000 (a968b760...) -> 0 keys | 0 slots | 0 slaves.
172.16.1.102:7006 (3bf112e8...) -> 33321 keys | 5461 slots | 2 slaves.
172.16.1.102:7001 (d42969de...) -> 33390 keys | 5462 slots | 1 slaves.
172.16.1.102:7002 (93faf299...) -> 33291 keys | 5461 slots | 1 slaves.
[OK] 100002 keys in 4 masters.
6.10 keys per slot on average.
>>> Performing Cluster Check (using node 172.16.1.102:7000)
M: a968b7602483bd05f0f7ea5c2cc13eeff6ee7918 172.16.1.102:7000
   slots: (0 slots) master
S: 0a2ff6c720ba32c398c8fc3d5ef14bd241252904 172.16.1.102:7005
   slots: (0 slots) slave
   replicates 93faf299a645c7eaac1b898fde6da48de28c6f1c
S: 4672c47668ea7f179f484cb64bc00e1347155ff5 172.16.1.102:7004
   slots: (0 slots) slave
   replicates d42969de78528d247580a39106e594dfbf9b1005
M: 3bf112e8fab64ddae44eaf33c7c13eff1a536112 172.16.1.102:7006
   slots:[0-5460] (5461 slots) master
   2 additional replica(s)
M: d42969de78528d247580a39106e594dfbf9b1005 172.16.1.102:7001
   slots:[5461-10922] (5462 slots) master
   1 additional replica(s)
M: 93faf299a645c7eaac1b898fde6da48de28c6f1c 172.16.1.102:7002
   slots:[10923-16383] (5461 slots) master
   1 additional replica(s)
S: 2297a3c5efd6e459539f562faf35edafd3566889 172.16.1.102:7007
   slots: (0 slots) slave
   replicates 3bf112e8fab64ddae44eaf33c7c13eff1a536112
S: 6d31edca810ddcef5c1191394aec1153c159a7dc 172.16.1.102:7003
   slots: (0 slots) slave
   replicates 3bf112e8fab64ddae44eaf33c7c13eff1a536112
[OK] All nodes agree about slots configuration.
>>> Check for open slots...
>>> Check slots coverage...
[OK] All 16384 slots covered.

#移除节点

[root@localhosts redis]# redis-cli -a 123456 --cluster del-node 172.16.1.102:7001  a968b7602483bd05f0f7ea5c2cc13eeff6ee7918
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
>>> Removing node a968b7602483bd05f0f7ea5c2cc13eeff6ee7918 from cluster 172.16.1.102:7001
>>> Sending CLUSTER FORGET messages to the cluster...
>>> SHUTDOWN the node.

#再次check集群信息
[root@localhosts redis]# redis-cli -a 123456 --cluster check 172.16.1.102:7001
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
172.16.1.102:7001 (d42969de...) -> 33390 keys | 5462 slots | 1 slaves.
172.16.1.102:7002 (93faf299...) -> 33291 keys | 5461 slots | 1 slaves.
172.16.1.102:7006 (3bf112e8...) -> 33321 keys | 5461 slots | 2 slaves.
[OK] 100002 keys in 3 masters.
6.10 keys per slot on average.
>>> Performing Cluster Check (using node 172.16.1.102:7001)
M: d42969de78528d247580a39106e594dfbf9b1005 172.16.1.102:7001
   slots:[5461-10922] (5462 slots) master
   1 additional replica(s)
M: 93faf299a645c7eaac1b898fde6da48de28c6f1c 172.16.1.102:7002
   slots:[10923-16383] (5461 slots) master
   1 additional replica(s)
M: 3bf112e8fab64ddae44eaf33c7c13eff1a536112 172.16.1.102:7006
   slots:[0-5460] (5461 slots) master
   2 additional replica(s)
S: 0a2ff6c720ba32c398c8fc3d5ef14bd241252904 172.16.1.102:7005
   slots: (0 slots) slave
   replicates 93faf299a645c7eaac1b898fde6da48de28c6f1c
S: 6d31edca810ddcef5c1191394aec1153c159a7dc 172.16.1.102:7003
   slots: (0 slots) slave
   replicates 3bf112e8fab64ddae44eaf33c7c13eff1a536112
S: 2297a3c5efd6e459539f562faf35edafd3566889 172.16.1.102:7007
   slots: (0 slots) slave
   replicates 3bf112e8fab64ddae44eaf33c7c13eff1a536112
S: 4672c47668ea7f179f484cb64bc00e1347155ff5 172.16.1.102:7004
   slots: (0 slots) slave
   replicates d42969de78528d247580a39106e594dfbf9b1005
[OK] All nodes agree about slots configuration.
>>> Check for open slots...
>>> Check slots coverage...
[OK] All 16384 slots covered.

Redis 集群管理常见操作一览

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

redis-cluster集群添加或删除节点以及槽重新分片 的相关文章

随机推荐

  • Linux/多线程的同步与互斥

    线程安全 多个执行流对资源进行争抢访问 但不会产生数据二义性 线程安全的实现 同步 互斥 同步 通过条件判断实现对临界资源访问的合理性 互斥 通过同一时间对临界资源的唯一访问 实现对临界资源访问的安全性 互斥锁 互斥的实现 互斥锁 在多任务
  • 第一次使用Eclipse:编写简单的Java小程序

    通过前部分的学习 了解了Java的安装和配置 那么从现在开始 要开始自己着手编写Java程序 学习一门编程语言 学会编写的第一个程序一般都是写一个输出 hello World 语句的小程序来表示自己开始学习这门语言 那么这篇教程也不例外 因
  • fsnotify 与 too many open files

    fsnotify fsnotify 是用来监听文件 目录变化的一个 golang 开源库 在 Linux 系统使用中 遇到了too many open files问题 首次尝试 通常 有 2 处配置太小 会触发too many open f
  • 最惊艳的sql

    select from girls where age between 18 and 20 and boyfriend is null order by cup desc
  • 不管人工智能发展如何 开发者都有必要了解 Linux 内核

    Linux内核在计算机世界的地位有目共睹 称它为计算机世界的基石也不为过 而且它还是全球最大的开源项目 几乎最知名的科技公司都参与其中 包括谷歌 Red Hat SUSE Intel Facebook 甲骨文和华为等 当然还包括Linux的
  • 将cmd中输出数据 保存为TXT文本

    原文 http blog sina com cn s blog 6d2d58cd0100x7zw html 在使用Windows XP中的cmd exe工具时 有时候我们想要把我们的输入命令及结果保存起来 但是用复制的方法过于麻烦 有时输出
  • LeetCode 热题 HOT 100:滑动窗口专题

    LeetCode 热题 HOT 100 https leetcode cn problem list 2cktkvj 文章目录 3 无重复字符的最长子串 128 最长连续序列 239 滑动窗口最大值 438 找到字符串中所有字母异位词 3
  • JFLex和JavaCUP简单使用

    由于需要使用到doris中的sql parser功能 所以决定使用其定义好的flex文件和cup文件 生成自己sqlscanner和parser类 步骤如下 1 下载JFlex和JavaCUP程序 路径分别为 https www jflex
  • 机械制造与自动化涉及使用计算机吗,论机械设计制造及自动化中计算机技术

    将计算机技术运用到机械设计制造中 大大提高了机械设计制造智能化水平 在机械设计制造中占据很重要的位置 但我国机械制造设计水平同国外发达国家相比 还存在一定的距离 若是可以加大对计算机技术的研究和探索 对机械制造行业的发展是非常有利的 1机械
  • Flowable入门系列文章29 - Activity解读 05

    1 消息开始事件 描述 甲消息开始事件可用于使用已命名的信息来启动一个过程实例 这有效地允许我们使用消息名称从一组替代开始事件中选择正确的开始事件 在部署具有一个或多个消息启动事件的流程定义时 应考虑以下注意事项 消息开始事件的名称在给定的
  • 机器学习实战:Python基于支持向量机SVM-RFE进行分类预测(三)

    文章目录 1 前言 1 1 支持向量机的介绍 1 2 支持向量机的应用 2 demo数据集演示 2 1 导入函数 2 2 构建数据集拟合 2 3 预测模型及可视化 3 实例演示分类 非SVM 3 1 导入函数和数据 3 2 简单线性分类 3
  • 剑指offer Java实现 第五题

    第五题 请实现一个函数 将一个字符串中的每个空格替换成 20 例如 当字符串为We Are Happy 则经过替换之后的字符串为We 20Are 20Happy 实现代码 public static String replaceSpace
  • MSCOCO数据集格式转化成VOC数据集格式

    MSCOCO数据集格式转化成VOC数据集格式 转载请注明原出处 http blog csdn net ouyangfushu article details 79543575 作者 SyGoing QQ 2446799425 SSD目标检测
  • [springmvc学习]8、JSR 303验证及其国际化

    目录 简介 常见注解 基本使用 BindResult获取异常信息 自定义提示信息 取消属性绑定 总结 简介 JSR 303 是 Java 为 Bean 数据合法性校验提供的标准框架 它已经包含在 JavaEE 中 我们可以通过注解的方式来指
  • SFTP报错,sftp couldn‘t stat remote file:No such file or directory

    原因 使用sftp进行文件传输时 需要连接到远程服务器的root用户上去 这就导致了另一个问题 在命令行使用su命令并输入root用户密码可以切换到root用户 但是使用sftp连接root用户 会连接失败 同类型的问题也有使用xshell
  • IDE介绍

    集成开发工具 gt gt gt IDE 编码工具取代了简单的记事本工具 辅助程序员编写源代码的常用高效编写工具 类似word 我们写文档会打开word文档来编写 代码也同样需要借助工具来开发 常见的编辑工具有记事本 sublime text
  • SD HOST——(一)SD简介

    Micro SD有九个引脚 TF卡只要八个 少一个地 CLK CMD 双向口 用于发命令和接收response VDD GND GND D3 D2 D1 D0 D3 D0不一定传输的是数据 读SD内部寄存器状态也可以从D3 30输出 CMD
  • Pytorch并行训练方法-单机多卡

    简单方便的 nn DataParallel DataParallel 可以帮助我们 使用单进程控 将模型和数据加载到多个 GPU 中 控制数据在 GPU 之间的流动 协同不同 GPU 上的模型进行并行训练 细粒度的方法有 scatter g
  • 通过栈实现算术表达式的计算

    最近在看数据结构的栈 其中有一节为栈应用到算术表达式的计算 接下来我讲举例说明如何用栈去计算 如有不对的地方 请各位大神指教 1 定义操作符的优先级 作为栈顶操作符时优先级仅高于 作为栈顶操作符时优先级是最高的 和 优先级一样 但是一个作为
  • redis-cluster集群添加或删除节点以及槽重新分片

    Redis版本 5 0 0 redis 5 0 0版本后可以不用安装ruby环境 集群命令说明 redis cli cluster help Cluster Manager Commands create host1 port1 hostN