Haproxy for redis slaves

1,835 views
Skip to first unread message

balakec

unread,
May 10, 2012, 8:10:41 AM5/10/12
to Redis DB
We are using node_redis client to access the redis at present. I need
to use HAProxy in front of redis slaves which in my case is 3 nos. I
installed the HAProxy and configured it to load balance the redis
slaves. But when I tried to create connection from the node_redis
client to the HAProxy I was not able to create the connection and was
getting a error

Error: Redis reply parser error: Error: Protocol error, got "H" as
reply type byte
at HiredisReplyParser.execute (/home/user1/doosra/node-exp/
node_modules/redis/lib/parser/hiredis.js:32:31)
at RedisClient.on_data (/home/user1/doosra/node-exp/node_modules/redis/
index.js:440:27)
at Socket.<anonymous> (/home/user1/doosra/node-exp/node_modules/redis/
index.js:70:14)
at Socket.emit (events.js:67:17)
at TCP.onread (net.js:347:14)


Can anyone say the reason and wat can be done from the node redis
client side.

Marc Gravell

unread,
May 10, 2012, 9:51:56 AM5/10/12
to redi...@googlegroups.com
That *sounds* like a HAProxy configuration issue - maybe using an http-aware processor instead of a raw binary one? I'm not a HAProxy expert, but I know something very similar messed up my web-socket server until the right HAProxy config (i.e. one without any http knowledge) was used.


--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To post to this group, send email to redi...@googlegroups.com.
To unsubscribe from this group, send email to redis-db+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/redis-db?hl=en.




--
Regards,

Marc

Sreekanth V

unread,
May 11, 2012, 2:19:30 PM5/11/12
to redi...@googlegroups.com
Hi,
Looks like you are in the HTTP mode(level 7) on haproxy instead of the tcp mode(level 4) you need to connect to redis

Try changing the haproxy.cfg to replace
        mode    http
with
mode tcp

Cheers
sreekanth.

Reply all
Reply to author
Forward
0 new messages