RedisCluster
No description available
Install / Use
/learn @wodouxiangyao/RedisClusterREADME
Redis-cluster集群创建
<div> <img src="https://img.shields.io/badge/go-1.15-lightBlue"/> <img src="https://img.shields.io/badge/redis-5.0.9-brightgreen"/> <img src="https://img.shields.io/badge/docker-1.18-red"/> </div>该工具目前适用于装有
docker的Linux系统下
1、使用说明
该工具旨在项目的开发和前期测试阶段
虽是为创建集群环境,但该工具只作用于单台机器,通过容器将集群中每个redis实例进行隔离,而达到集群效果
2、集群创建
该文件为可执行文件,添加可执行权限
chmod +x redis-cluster
通过./redis-cluster -h 来查看相关命令
![image][p1]
目前只做了创建create相关,删除相关功能还并未做
通过./redis-cluster create -h 命令可查看创建需要的选项,分别是 host,ports,master,replicas;
host 则将作为外界可访问的本机IP地址,如果在云服务器,填写公网IP即可 (必填)
ports 则是向外界提供访问Redis的端口,用逗号分隔 (可不填)
master 为集群的master节点个数,理论应为奇数 (但是工具将其定为3)
replicas 每个master节点个副本数,理论上为任意个 (工具将其定位1)
接下来是创建
./redis-cluster create -H ${ip}
等待其执行完,即可生成6个容器,3主3从,同时集群创建成功。
3、优势
- [x] 操作简便:一行命令即可创建生成集群
- [x] 速度快:整个创建时间在30秒左右
- [x] 硬件要求低:单台机器即可,服务器或者虚拟机都行
- [x] 依赖少:不需要服务器额外安装命令
4、不足
- [ ] 暂时不支持对
master和replicas的自定义赋值 - [ ] Redis的连接没有加入密码验证
- [ ] 暂不支持将集群中数据映射到宿主机
- [ ] 暂不支持window环境
Related Skills
node-connect
340.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
84.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
340.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
84.1kCommit, push, and open a PR
