nredis-proxy高性能Redis中間件服務(wù)
nredis-proxy 是一個以redis 協(xié)議為主的高性能穩(wěn)定的代理中間件服務(wù),不侵入業(yè)務(wù)代碼,與業(yè)務(wù)毫無聯(lián)系,不需要改任何應(yīng)用代碼,天然支持分布式部署。
一:功能特點(diǎn):
1:自帶連接池,性能高效 2:提供分片策略,擴(kuò)展性強(qiáng),可自定義分片算法 3:提供讀寫分離,一主多從,從按照權(quán)重讀取 4:提供自動監(jiān)聽功能,主掛了,提供選舉算法,從作為主 5:可HA分布式部署,節(jié)點(diǎn)隨意擴(kuò)展
二:nredis-proxy 架構(gòu)圖
三:nredis-proxy 部署架構(gòu)圖
四:例子配置文件:
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:redisProxy="http://www.nredisproxy.com/redisProxy" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd http://www.nredisproxy.com/redisProxy http://www.nredisproxy.com/redisProxy/redisProxy.xsd" > <!--redis 主從配置 --> <redisProxy:redisProxyNode id="wandaredisnode" redisProxyHost="127.0.0.1" redisProxyPort="6379" algorithm-ref="loadMasterBalance" address="127.0.0.1:2181"> <redisProxy:redisProxyMaster id="wandaredismasters" host="127.0.0.1" port="6380" timeout="5000" maxActiveConnection="5000" maxIdleConnection="500" minConnection="50" algorithm-ref="loadClusterBalance"> <redisProxy:redisProxyCluster id="wandarediscluster0" host="127.0.0.1" port="6381" timeout="5000" maxActiveConnection="5000" maxIdleConnection="500" minConnection="50" weight="1"></redisProxy:redisProxyCluster> </redisProxy:redisProxyMaster> </redisProxy:redisProxyNode> <bean name="loadMasterBalance" class="com.opensource.netty.redis.proxy.core.cluster.impl.ConsistentHashLoadBalance"></bean> <bean name="loadClusterBalance" class="com.opensource.netty.redis.proxy.core.cluster.impl.RoundRobinLoadBalance"></bean> </beans>
評論
圖片
表情
