当前位置: 首页> 财经> 金融 > 高端网站建设公司_成人2023学历提升政策_seo网站优化平台_常州网站建设优化

高端网站建设公司_成人2023学历提升政策_seo网站优化平台_常州网站建设优化

时间:2025/7/14 23:03:30来源:https://blog.csdn.net/zhanremo3062/article/details/143950785 浏览次数:0次
高端网站建设公司_成人2023学历提升政策_seo网站优化平台_常州网站建设优化

Kubernetes集群外连接redis集群和使用redis-shake工具迁移数据(一)
Kubernetes集群外连接redis集群和使用redis-shake工具迁移数据(二)

文章目录

    • 一、RedisShake
    • 二、Cluster模式迁移

一、RedisShake

RedisShake 是一个 Redis 数据同步工具,主要用于实现两个 Redis 实例之间的数据同步。它支持多种同步模式,包括但不限于:

全量同步:将源 Redis 实例中的所有数据复制到目标实例中。
增量同步:在全量同步之后,继续监听源实例的数据变化,并实时同步到目标实例。
指定键同步:用户可以指定需要同步的键或键模式,这样只有符合模式的数据会被同步。
RedisShake 的设计目的是为了满足不同场景下的数据迁移、备份、复制等需求,它能够帮助用户减少数据同步过程中的复杂性和错误率。此外,RedisShake 支持跨网络环境的数据同步,比如从本地环境同步数据到云上环境,或者在不同的云服务提供商之间进行数据同步。

使用 RedisShake 进行数据同步时,通常需要注意配置文件的设置,确保源和目标 Redis 实例的连接信息正确无误,并根据实际需求选择合适的同步模式。此外,还需要考虑同步过程中可能遇到的数据冲突处理方式,以及如何保证数据的一致性等问题。
GitHub地址:https://github.com/tair-opensource/RedisShake
官方地址:https://tair-opensource.github.io/RedisShake/zh

二、Cluster模式迁移

编辑 shake.toml 文件
cat shake.toml | grep -v "^#"

[sync_reader]
cluster = true   #源是集群模式,需要开启         # set to true if source is a redis cluster
address = "源redis url:6379" # when cluster is true, set address to one of the cluster node
username = ""              # keep empty if not using ACL
password = "woshimima"              # keep empty if no authentication is required
tls = false                #
sync_rdb = true            # set to false if you don't want to sync rdb
sync_aof = true            # set to false if you don't want to sync aof
prefer_replica = false     # set to true if you want to sync from replica node
try_diskless = false       # set to true if you want to sync by socket and source repl-diskless-sync=yes[redis_writer]
cluster = true    #源是集群模式,需要开启         # set to true if target is a redis cluster
sentinel = false           # set to true if target is a redis sentinel
master = ""                # set to master name if target is a redis sentinel
address = "192.168.1.10:30111" # when cluster is true, set address to one of the cluster node
username = ""              # keep empty if not using ACL
password = "woshimima"              # keep empty if no authentication is required
tls = false
off_reply = false          # turn off the server reply[filter]
allow_key_prefix = []
allow_key_suffix = []block_key_prefix = []
block_key_suffix = []allow_db = []
block_db = []allow_command = [] 
block_command = [] allow_command_group = [] 
block_command_group = [] function = ""[advanced]
dir = "data"
ncpu = 0        # runtime.GOMAXPROCS, 0 means use runtime.NumCPU() cpu cores
pprof_port = 0  # pprof port, 0 means disable
status_port = 0 # status port, 0 means disablelog_file = "shake.log"
log_level = "info"     # debug, info or warn
log_interval = 5       # in secondsrdb_restore_command_behavior = "panic" # panic, rewrite or skippipeline_count_limit = 1024target_redis_client_max_querybuf_len = 1073741824  # 1GB in bytestarget_redis_proto_max_bulk_len = 512_000_000aws_psync = "" # example: aws_psync = "10.0.0.1:6379@nmfu2sl5osync,10.0.0.1:6379@xhma21xfkssync"empty_db_before_sync = false[module]
target_mbbloom_version = 20603

我测试的时候,打了一个redis-shake 4.2.1版本的镜像swr.cn-north-4.myhuaweicloud.com/asdl-aps/softwares/redis-shake:20241119,进入到cd /RedisShake/bin/目录下,运行./redis-shake shake.toml开始全量和增量同步数据

关键字:高端网站建设公司_成人2023学历提升政策_seo网站优化平台_常州网站建设优化

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: