twemproxy & Redis Quickstart

Running twemproxy and Redis locally for testing in this configuration:

twemproxy

Get started with twemproxy:

$ git clone https://github.com/twitter/twemproxy.git
$ cd twemproxy
$ autoreconf -fvi
$ ./configure --enable-debug=log
$ make

Using the following config file located in conf/dual-redis.yml:

beta:
  listen: 127.0.0.1:22122
  hash: fnv1a_64
  hash_tag: "{}"
  distribution: ketama
  auto_eject_hosts: false
  timeout: 400
  redis: true
  servers:
   - 127.0.0.1:7777:1 server1
   - 127.0.0.1:8888:1 server2

Start the 2 Redis servers:

$ ./redis-server --port 7777
$ ./redis-server --port 8888

Start twemproxy:

$ ./nutcracker -c ../conf/dual-redis.yml -v 11

Try connecting to twemproxy with the redis client:

$ ./redis-cli -p 22122
redis 127.0.0.1:22122> set key1 value1
OK
redis 127.0.0.1:22122> get key1
"value1"

One response to “twemproxy & Redis Quickstart

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s