Redis Cache Proxy Twemproxy

Source: Internet
Author: User

4 Redis Servers


172.16.1.37:6379-1

172.16.1.36:6379-2

172.16.1.35:6379-3

172.16.1.34:6379-4


Installing autoconf

CentOS 7 Yum installation is available, autoconf version must be more than 2.64 versions


Yum-y Install autoconf



Installing Twemproxy


git clone https://github.com/twitter/twemproxy.git


Autoreconf-fvi #生成configure文件


./configure--prefix=/opt/local/twemproxy/--enable-debug=log


Make && make install


Mkdir-p/opt/local/twemproxy/{run,conf,logs}


Ln-s/opt/local/twemproxy/sbin/nutcracker/usr/bin/


cd/opt/local/twemproxy/conf/


VI nutcracker.yml #编辑配置文件


---------------------------------------------------------------------------------------

Alpha

listen:172.16.1.37:6380 #监听端口

hash:fnv1a_64 #key值hash算法, default fnv1a_64

Distribution:ketama #分布算法

#ketama一致性hash算法; Modula is very simple, is based on the key value of the hash value of the modulo; random randomly distributed

Auto_eject_hosts:true #摘除后端故障节点

Redis:true #是否是redis缓存, default is False

timeout:400 #代理与后端超时时间, MS

server_retry_timeout:200000 #摘除故障节点后重新连接的时间, MS

Server_failure_limit:1 #故障多少次摘除

Servers

-172.16.1.34:6379:1

-172.16.1.35:6379:1

-172.16.1.36:6379:1

-172.16.1.37:6379:1

---------------------------------------------------------------------------------------




Nutcracker-t-c/opt/local/twemproxy/conf/nutcracker.yml #检查配置文件是否正确



nutcracker-d-c/opt/local/twemproxy/conf/nutcracker.yml-p/opt/local/twemproxy/run/redisproxy.pid-o/opt/local/ Twemproxy/logs/redisproxy.log #启动


Redis Cache Proxy Twemproxy

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.