Node -redis cannot connect to redis instance via twemproxy

Problem

Connecting directly through redis-cli to my twemproxy correctly proxies me to retry without any problems / disconnections. However, when I use node -redis to connect to twemproxy, I get the following error:

[Error: Redis connection gone from end event.]

The trace is as follows:

Error: Ready check failed: Redis connection gone from end event.
    at RedisClient.on_info_cmd (/home/vagrant/tests/write-tests/node_mo
dules/redis/index.js:368:35)
    at Command.callback (/home/vagrant/tests/write-tests/node_modules/r
edis/index.js:418:14)
    at RedisClient.flush_and_error (/home/vagrant/tests/write-tests/nod
e_modules/redis/index.js:160:29)
    at RedisClient.connection_gone (/home/vagrant/tests/write-tests/nod
e_modules/redis/index.js:474:10)
    at Socket.<anonymous> (/home/vagrant/tests/write-tests/node_modules
/redis/index.js:103:14)
    at Socket.EventEmitter.emit (events.js:117:20)
    at _stream_readable.js:919:16
    at process._tickCallback (node.js:419:13)

This error occurs regardless of whether the redis server even works, but I'm sure it is related to the way node -redis and twemproxy interact. Or not interact, as the case may be.

My question

Just what is going on?

Background Information

I have a simple test setup that looks like this:

+------------------+
|   +----+----+    |
|   | r1 + r2 +    |
|   +----+----+    |
|     |     |      |
|   +---------+    |
|   |twemproxy|    |
|   +---------+    |
|    /   |   \     |  
| +----+----+----+ |
| | aw | aw | aw | |
| +----+----+----+ |
+------------------+

aw = api worker
r1/r2 = redis instance
twemproxy = twemproxy
  • aw are currently nodejs grouped on one host
  • r1 / r2 are node instances, again on the same host
  • node version 0.10.x
  • . IP-, , . .
+4
1

, , node_redis "info" .

no_ready_check: true twemproxy.

+10

Source: https://habr.com/ru/post/1540776/


All Articles