版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、codis 3.0.3数据同步和高可用及压力测试一.基本信息三台机器:192.168.30.113 192.168.30.114 192.168.30.115 zk1 zk2 zk3 codis-dashboard codis-fe codis-ha codis-proxy1 codis-proxy2 codis-proxy3 codis_group1_M(6379) codis_group2_M(6379) codis_group3_M(6379) codis_group3_S(6380) codis_group1_S(6380) codis_group2_S(6380)二.主从数据同步测试
2、group1:redis-cli -h 192.168.30.113 -p 6379auth xxx192.168.30.113:6379 auth xxxxOK192.168.30.113:6379 set a 1OKredis-cli -h 192.168.30.115 -p 6380192.168.30.115:6380 auth xxxOK192.168.30.115:6380 get a1group2:redis-cli -h 192.168.30.114 -p 6379auth xxx192.168.30.114:6379 set b 2OKredis-cli -h 192.168
3、.30.113 -p 6380auth xxx192.168.30.113:6380 get b2group3:redis-cli -h 192.168.30.115 -p 6379auth xxx192.168.30.115:6379 set c 3OKredis-cli -h 192.168.30.114 -p 6380auth xxx192.168.30.114:6380 get c3三高可用测试1.将proxy1 offline(192.168.30.113)后,验证通过proxy2(192.168.30.114)的19000端口访问redis关闭proxy1:codisappmvxl
4、2579 codis$ chmod u+x *codisappmvxl2579 codis$ ps -ef|grep proxycodisapp 10479 8345 0 13:36 pts/0 00:00:00 grep proxycodisapp 30898 1 0 May31 ? 00:08:46 /codisapp/svr/codis/bin/codis-proxy -ncpu=4 -config=/codisapp/conf/codis/proxy.toml -log=/codisapp/logs/codis/proxy.log -log-level=WARNcodisappmvxl
5、2579 codis$ ./stop_codis_proxy.shcodisappmvxl2579 codis$ ps -ef|grep proxycodisapp 10520 8345 0 13:36 pts/0 00:00:00 grep proxycodisappmvxl2580 $ redis-cli -h 192.168.30.114 -p 19000192.168.30.114:19000 auth xxxxOK192.168.30.114:19000 set d 4OK192.168.30.114:19000 get d42.将proxy1 offline后,且将codis se
6、rver1的6379和6380关掉,验证通过proxy3的19000端口访问redis再接着关闭server 1的redis:codisappmvxl2579 codis$ ps -ef|grep codis-servercodisapp 10584 8345 0 13:44 pts/0 00:00:00 grep codis-servercodisapp 28919 1 0 May31 ? 00:01:28 /codisapp/svr/codis/bin/codis-server *:6379codisapp 29151 1 0 May31 ? 00:01:18 /codisapp/svr/
7、codis/bin/codis-server *:6380codisappmvxl2579 codis$ ./stop_codis_server.shcodisappmvxl2579 codis$ ps -ef|grep codis-servercodisapp 10626 8345 0 13:44 pts/0 00:00:00 grep codis-server通过proxy3访问正常:codisappmvxl2580 $ redis-cli -h 192.168.30.115 -p 19000192.168.30.115:19000 auth xxxxxxxOK192.168.30.115
8、:19000 set e 5OK192.168.30.115:19000 get e53. HA主从自动切换测试将server group 3(192.168.30.115)上的6379进程kill,查看HA是否能自动实现主从切换,及原主库启动后,如何处理?mvxl2530主机上将6380对应的进程kill:codisappmvxl2581 codis$ ps -ef|grep codis-servercodisapp 813 454 0 15:58 pts/0 00:00:00 grep codis-servercodisapp 21682 1 0 May31 ? 00:01:17 /cod
9、isapp/svr/codis/bin/codis-server *:6379codisapp 21701 1 0 May31 ? 00:01:14 /codisapp/svr/codis/bin/codis-server *:6380codisappmvxl2581 codis$ kill 21682codisappmvxl2581 codis$ ps -ef|grep codis-servercodisapp 849 454 0 15:58 pts/0 00:00:00 grep codis-servercodisapp 21701 1 0 May31 ? 00:01:14 /codisa
10、pp/svr/codis/bin/codis-server *:6380以下显示:group 3中的从库已有自动提升为主库,并且原主库已下线,从组中剔除.下线的原主库redis需要先启动服务,再重新加入到组中,并点击帮手小图标进行同步:三大数据量下的主从同步测试插入20W个key(每次测试运行前,需要更改INSTANCE_NAME)vim redis-key.sh#!/bin/bashREDISCLT=redis-cli -h 192.168.30.113 -p 19000 -a xxxxxxx -n 0 setID=1while $ID -le 50000 doINSTANCE_NAME=i
11、-2-$ID-VMUUID=cat /proc/sys/kernel/random/uuidCREATED=date +%Y-%m-%d %H:%M:%S$REDISCLT vm_instance:$ID:instance_name $INSTANCE_NAME$REDISCLT vm_instance:$ID:uuid $UUID$REDISCLT vm_instance:$ID:created $CREATED$REDISCLT vm_instance:$INSTANCE_NAME:id $IDID=expr $ID + 1done执行上面脚本,查看面板,各组主从数据同步正常,QPS达到了
12、800以上,显示如下:五.压力测试1、/codisapp/svr/codis/bin/redis-benchmark -h 192.168.30.113 -p 19000 -a “xxxxxx” -c 100 -n 100000100个并发连接,100000个请求,检测host为localhost端口为6379的redis服务器性能。以下显示100%的请求都在15ms或13ms或1ms内处理完成。codisappmvxl2579 codis$ /codisapp/svr/codis/bin/redis-benchmark -h 192.168.30.113 -p 19000 -a xxxxxx
13、x -c 100 -n 100000= PING_INLINE = 100000 requests completed in 0.83 seconds 100 parallel clients 3 bytes payload keep alive: 1100.00% = 1 milliseconds120627.27 requests per second= PING_BULK = 100000 requests completed in 0.79 seconds 100 parallel clients 3 bytes payload keep alive: 1100.00% = 20 mi
14、lliseconds127064.80 requests per second= SET = 100000 requests completed in 1.08 seconds 100 parallel clients 3 bytes payload keep alive: 1100.00% = 14 milliseconds92506.94 requests per second= GET = 100000 requests completed in 1.02 seconds 100 parallel clients 3 bytes payload keep alive: 1100.00%
15、= 15 milliseconds97560.98 requests per second= INCR = 100000 requests completed in 0.80 seconds 100 parallel clients 3 bytes payload keep alive: 1100.00% = 19 milliseconds124843.95 requests per second= LPUSH = 100000 requests completed in 0.81 seconds 100 parallel clients 3 bytes payload keep alive:
16、 1100.00% = 18 milliseconds123762.38 requests per second= LPOP = 100000 requests completed in 0.82 seconds 100 parallel clients 3 bytes payload keep alive: 1100.00% = 6 milliseconds121212.12 requests per second= SADD = 100000 requests completed in 0.93 seconds 100 parallel clients 3 bytes payload ke
17、ep alive: 1100.00% = 6 milliseconds108108.11 requests per second= SPOP = 100000 requests completed in 0.91 seconds 100 parallel clients 3 bytes payload keep alive: 1100.00% = 16 milliseconds110011.00 requests per second= LPUSH (needed to benchmark LRANGE) = 100000 requests completed in 0.88 seconds
18、100 parallel clients 3 bytes payload keep alive: 1100.00% = 15 milliseconds114155.25 requests per second= LRANGE_100 (first 100 elements) = 100000 requests completed in 3.76 seconds 100 parallel clients 3 bytes payload keep alive: 1100.00% = 19 milliseconds26588.67 requests per second= LRANGE_300 (f
19、irst 300 elements) = 100000 requests completed in 11.85 seconds 100 parallel clients 3 bytes payload keep alive: 1100.00% = 53 milliseconds8438.82 requests per second= LRANGE_500 (first 450 elements) = 100000 requests completed in 17.56 seconds 100 parallel clients 3 bytes payload keep alive: 1100.0
20、0% = 61 milliseconds5693.46 requests per second= LRANGE_600 (first 600 elements) = 100000 requests completed in 22.23 seconds 100 parallel clients 3 bytes payload keep alive: 1100.00% = 74 milliseconds4499.44 requests per second= MSET (10 keys) = 100000 requests completed in 3.24 seconds 100 paralle
21、l clients 3 bytes payload keep alive: 1100.00% = 20 milliseconds30873.73 requests per second2、/codisapp/svr/codis/bin/redis-benchmark -h 192.168.30.113 -p 19000 -a xxxxxxx -q -d 100测试存取大小为100字节的数据包的性能codisappmvxl2579 codis$ /codisapp/svr/codis/bin/redis-benchmark -h 192.168.30.113 -p 19000 -a xxxxxxx -q -d 100PING_INLINE: 124223.60 requests per secondPING_BULK: 129533.68 requests per secondSET: 59772.86 requests per secondGET: 68446.27 requests per secondINCR: 104166.67 requests per secondLPUSH: 121359.23 requests per secondLPOP: 125156.45 requests per secon
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2024年室内装修施工队劳务分包协议版B版
- 2024年大豆批量采购销售协议条款版B版
- 2024年交易双方洽谈策略与协议成文规范版B版
- 2024年度农业种植养殖合同
- 2024年事业单位聘用及劳动协作合同书版B版
- 2024年度企业并购合同:收购方与被收购方关于企业并购的协议
- 2024年度住宅电路布线及安装协议版B版
- 2024年度分公司技术转让合同
- 2024专项装修施工合作合同书一
- 2024年企业职员借款协议样式版B版
- 《民间非营利组织会计制度及操作实务》讲义
- 青年卒中 幻灯
- 立井井筒施工设备与布置
- 《跪跳起》教案 (2)
- 平板车操作保养规程
- 专业音响设备培训教材(共44页).ppt
- 龙牙百合高产栽培技术
- 员工综合技能考核范例表
- 我的小手真能干ppt课件
- 常用单词过去式过去分词表
- 小学英语前置性作业的设计探究
评论
0/150
提交评论