目前 redis 并不支持 memcache 协议,但已经有人给 redis 2.0 版本 打了个patch,支持 memcache 协议
项目:https://github.com/vislee/medis
如有任何建议和问题,请 New issues https://github.com/vislee/medis/issues
先看下性能测试:
目前只支持一些 memcache 命令
set add replace append prepend get gets delete incr decr
安装 medis
git clone https://github.com/vislee/medis.git make make install
配置文件
# cat /etc/medis.conf daemonize yes pidfile /var/run/medis.pid port 6379 memcached-port 11211 timeout 300 loglevel notice logfile /var/log/medis.log databases 3 save 900 1 save 300 10 save 60 10000 rdbcompression yes dbfilename dump.rdb dir /var maxclients 102400 maxmemory 1024mb appendonly no appendfilename appendonly.aof appendfsync no activerehashing yes
启动
/usr/local/sbin/medis-server /etc/medis.conf
memcache 测试
# telnet 127.0.0.1 11211 Trying 127.0.0.1... Connected to 127.0.0.1. Escape character is '^]'. set aikaiyuan 123 1000 3 aky STORED get aikaiyuan VALUE aikaiyuan 123 3 aky END
redis 测试
# redis-cli -h 127.0.0.01 -p 6379 redis 127.0.0.01:6379> PING PONG redis 127.0.0.01:6379> get aikaiyuan "aky" redis 127.0.0.01:6379> SAVE OK redis 127.0.0.01:6379>
感谢参与 https://github.com/vislee/medis
转载请注明:爱开源 » 为redis加了个memcached端口支持mc协议