A Redis cluster proxy.
Build
===
Requirements:
* `make` and `cmake`
* UNIX-like system with `SO_REUSEPORT | SO_REUSEADDR` support
* `epoll` support
* pthread
* C++ compiler & lib with C++11 features, like g++ 4.8 or clang++ 3.2 (NOTE: install clang++ 3.2 on CentOS 6.5 won't compile because clang uses header files from gcc, which is version 4.4 without C++11 support)
* Google Test (for test)
To build, just
make
turn on all debug logs
make MODE=debug
or compile with g艹
make COMPILER=g++
To link libstdc++ statically, use
make STATIC_LINK=1
to run test (just cover message parsing parts)
make runtest
run test with valgrind checking
make runtest CHECK_MEM=1
Run
===
cerberus CONFIG_FILE [ARGS]
The first argument is path of a configuration file, then optional arguments. Those specifies
* bind / `-b` : (integer) local port to listen; could also specified
* node / `-n` : (address) active nodes in a cluster; format should be *host1:port1,host2:port2*; could also set after cerberus launched, via the `SETREMOTES` command, see it below
* thread / `-t` : (integer) number of threads
* read-slave / `-r` : (optional, default off) set to "yes" to turn on read slave mode. A proxy in read-slave mode won't support writing commands like `SET`, `INCR`, `PUBLISH`, and it would select slave nodes for reading commands if possible. For more information please read [here (CN)](https://github.com/HunanTV/redis-cerberus/wiki/%E8%AF%BB%E5%86%99%E5%88%86%E7%A6%BB).
* read-slave-filter / `-R` : (optional, need read-slave set to "yes") if multiple slaves replicating one master, use the one whose host starts with this option value; for example, you have `10.0.0.1:7000` as a master, with 2 slave `10.0.1.1:8000` and `10.0.2.1:9000`, and read-slave-filter set to `10.0.1`, then `10.0.1.1:8000` is preferred. Note this option is no more than a string matching, so `10.0.1.1` and `10.0.10.1` won't be different on option value `10.0.1`
* cluster-require-full-coverage : (optional, default on) set to "no" to turn off full coverage mode, so proxy would keep serving when not all slots covered in a cluster.
The option set via ARGS would override it in the configuration file. For example
cerberus example.conf -t 8
set the program to 8 threads.
Commands in Particular
===
Restricted Commands Bypass
---
* `MGET` : execute multiple `GET`s
* `MSET` : execute multiple `SET`s
* `DEL` : execute multiple `DEL`s
* `RENAME` : if source and destination are not in the same slot, execute a `GET`-`SET`-`DEL` sequence without atomicity
* `BLPOP` / `BRPOP` : one list limited; might return nil value before timeout [See detail (CN)](https://github.com/HunanTV/redis-cerberus/wiki/BLPOP-And-BRPOP)
* `EVAL` : one key limited; if any key which is not in the same slot with the argument key is in the lua script, a cross slot error would return
Extra Commands
---
* `PROXY` / `INFO`: show proxy information, including threads count, clients counts, commands statistics, and remote redis servers
* `KEYSINSLOT slot count`: list keys in a specified slot, same as `CLUSTER GETKEYSINSLOT slot count`
* `UPDATESLOTMAP`: notify each thread to update slot map after the next operation
* `SETREMOTES host port host port ...`: reset redis server addresses to arguments, and update slot map after that
Not Implemented
---
* keys: `KEYS`, `MIGRATE`, `MOVE`, `OBJECT`, `RANDOMKEY`, `RENAMENX`, `SCAN`, `BITOP`,
* list: `BRPOPLPUSH`, `RPOPLPUSH`,
* set: `SINTERSTORE`, `SDIFFSTORE`, `SINTER`, `SMOVE`, `SUNIONSTORE`,
* sorted set: `ZINTERSTORE`, `ZUNIONSTORE`,
* pub/sub: `PUBSUB`, `PUNSUBSCRIBE`, `UNSUBSCRIBE`,
others: `PFADD`, `PFCOUNT`, `PFMERGE`,
`EVALSHA`, `SCRIPT`,
`WATCH`, `UNWATCH`, `EXEC`, `DISCARD`, `MULTI`,
`SELECT`, `QUIT`, `ECHO`, `AUTH`,
`CLUSTER`, `BGREWRITEAOF`, `BGSAVE`, `CLIENT`, `COMMAND`, `CONFIG`,
`DBSIZE`, `DEBUG`, `FLUSHALL`, `FLUSHDB`, `LASTSAVE`, `MONITOR`,
`ROLE`, `SAVE`, `SHUTDOWN`, `SLAVEOF`, `SLOWLOG`, `SYNC`, `TIME`,
For more information please read [here (CN)](https://github.com/HunanTV/redis-cerberus/wiki/Redis-%E9%9B%86%E7%BE%A4%E4%BB%A3%E7%90%86%E5%9F%BA%E6%9C%AC%E5%8E%9F%E7%90%86%E4%B8%8E%E4%BD%BF%E7%94%A8).
没有合适的资源?快使用搜索试试~ 我知道了~
Redis 集群代理.zip
共106个文件
cpp:43个
hpp:28个
h:11个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 153 浏览量
2024-12-02
21:22:13
上传
评论
收藏 244KB ZIP 举报
温馨提示
Redis 集群代理Redis 集群代理。建造要求make和cmakeSO_REUSEPORT | SO_REUSEADDR支持类 UNIX 系统epoll支持线程具有 C++11 特性的 C++ 编译器和库,例如 g++ 4.8 或 clang++ 3.2(注意在 CentOS 6.5 上安装 clang++ 3.2 无法编译,因为 clang 使用了 gcc 的头文件,而 gcc 是 4.4 版,不支持 C++11)Google Test(用于测试)要构建,只需make打开所有调试日志make MODE=debug或者用 g艹 编译make COMPILER=g++要静态链接 libstdc++,使用make STATIC_LINK=1运行测试(仅涵盖消息解析部分)make runtest使用 valgrind 检查运行测试make runtest CHECK_MEM=1跑步cerberus CONFIG_FILE [ARGS]第一个参数是配置文件的路径,然后是可选参数。这些指定绑定/
资源推荐
资源详情
资源评论
收起资源包目录
Redis 集群代理.zip (106个子文件)
format.cc 38KB
posix.cc 8KB
example.conf 151B
test-cerberus.conf 40B
command.cpp 37KB
slot_map.cpp 20KB
event-loop-data-proxy.cpp 19KB
server-client.cpp 19KB
buffer.cpp 17KB
proxy.cpp 12KB
message.cpp 9KB
server.cpp 7KB
slot_map.cpp 6KB
main.cpp 6KB
subscription.cpp 6KB
buffer.cpp 5KB
client.cpp 5KB
event-loop-long-conn.cpp 4KB
mock-io.cpp 4KB
mock-poll.cpp 4KB
slot_calc.cpp 4KB
demangle.cpp 3KB
response.cpp 3KB
stats.cpp 3KB
string.cpp 3KB
slot_calc.cpp 3KB
event-loop-slot-map-updating.cpp 3KB
event-loop-test.cpp 3KB
trace.cpp 2KB
mock-server.cpp 2KB
response.cpp 1KB
mock-proxy.cpp 1KB
acceptor.cpp 1KB
sig-handler.cpp 1KB
concurrence.cpp 1KB
globals.cpp 1KB
address.cpp 960B
mock-acceptor.cpp 686B
message.cpp 496B
alg.cpp 409B
mock-stats.cpp 390B
fdutil.cpp 373B
pointer.cpp 363B
test-main.cpp 280B
logging.cpp 243B
random.cpp 201B
connection.cpp 106B
.gitignore 199B
.gitignore 49B
easylogging++.h 275KB
format.h 91KB
posix.h 9KB
pointer.h 4KB
poll.h 3KB
fctl.h 3KB
cio.h 1KB
string.h 983B
demangle.h 559B
trace.h 373B
sig-handler.h 244B
message.hpp 9KB
proxy.hpp 5KB
event-loop-test.hpp 4KB
buffer.hpp 3KB
exceptions.hpp 3KB
slot_map.hpp 2KB
command.hpp 2KB
server.hpp 2KB
subscription.hpp 2KB
mock-poll.hpp 2KB
mock-io.hpp 1KB
address.hpp 1KB
slot_calc.hpp 1KB
client.hpp 1KB
concurrence.hpp 1013B
alg.hpp 848B
stats.hpp 841B
connection.hpp 815B
response.hpp 727B
globals.hpp 712B
acceptor.hpp 597B
common.hpp 492B
fdutil.hpp 413B
mock-acceptor.hpp 301B
mock-server.hpp 286B
test-utils.hpp 271B
logging.hpp 261B
random.hpp 207B
LICENSE 1KB
Makefile 3KB
Makefile 1KB
Makefile 957B
Makefile 237B
Makefile 104B
README.md 4KB
mf-template.mk 1KB
script_test.py 5KB
cluster_launcher.py 1KB
README.rst 16KB
ChangeLog.rst 11KB
共 106 条
- 1
- 2
资源评论
赵闪闪168
- 粉丝: 1726
- 资源: 6942
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 医疗领域5G基础设施建设行业分析:全球市场具有广阔的发展前景.docx
- 移动应用程序测试行业分析:北美是最大消费者市场,约占全球市场的50%.docx
- 医生调度系统行业市场分析:美国南部地区的应用最为广泛,市占比34%.docx
- 英语学习行业分析:亚太和欧洲占全球约80%的市场份额.docx
- 语言学习软件行业分析:全球收入约为1999.4百万美元.docx
- 音乐推广软件行业分析:北美是全球最大的消费市场,约占全球市场的68%份额.docx
- 云机组管理系统行业市场分析:北美地区是全球的消费者,约占市场的60%.docx
- 自动驾驶控制-二 三自由度动力学MPC任意路径跟踪 是可以跟踪各种自定义路径,可以自己更改参考路径的 carsim和simulink联合仿真,基于车辆二自由度动力学模型的mpc跟踪任意路径 蓝色为全
- C# 自己调试用的一些小工具 WebSocket, tcp,串口等.zip
- C#速成指南-从入门到进阶,实战WPF与Unity3D开发(17章全+源码+电子书)
- LQR控制主动悬架模型 LQR控制,基于最优控制的思想,以状态反馈控制的形式,根据自定权重,求解出最优的反馈系数K simulink模型对比了主 被动悬架的系统响应结果,如悬架动挠度、簧载质量加速度
- 标准IEEE9三机九节点simulink仿真模型,可自加风电并网,储能,SVC,自由开发
- Vue的前后端分离的后台管理系统
- 基于 websocket 文件上传 ,解压缩.Net web
- 101 个免费现成的 Excel 模板
- 电缆紫外线老化试验箱行业分析:预计至2031年市场规模将进一步扩大至33.29亿美元
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功