ioredis and internal network redis
Trying to connect to redis in node using
ioredis
and the new private URL, which it doesn't seem to recognise
Has anyone gotten redis working over the internal network?18 Replies
Project ID:
1cb9508e-4a99-456d-a6fc-4ae49f946789
1cb9508e-4a99-456d-a6fc-4ae49f946789
private networking contains a problem where it takes about 100ms to initialize.
see docs https://docs.railway.app/reference/private-networking#workaround-for-alpine-based-images
this is in runtime, the 100ms shouldn't be a problem there
and also not on alpine afaik
that occurs during runtime and it's not a alpine thing only
by runtime I meant that I'm attempting the connection way after the redis service is deployed
or is the 100ms for each connection?
after each deploy, Railway will bring up a private connection using wireguard (vpn basically) but it takes about 100ms to initialize.
so you can delay your application start up or try request loop as suggested until it's up
I attempt the connection to redis from a node application - not during the startup, rather in response to incoming requests
by then both services should be initialized
I might be misunderstanding something 😄
ah ok, make sense now
i suspect this might be an ipv6/ipv4 thing
ioredis has been picky with ipv6 in the past
maybe, node prefers IPv6 now over IPv4
yep
I think i'll just use the public url, the speed difference isn't that important atm
@snöw see if this comment solves it https://github.com/redis/ioredis/issues/1576#issuecomment-1158910923
GitHub
Unhandled error event: Error: getaddrinfo ENOTFOUND - AWS ElasticC...
Hey guys, did anyone have some issue like that to connect in the AWS ElasticCache in the ECS Container? [ioredis] Unhandled error event: Error: getaddrinfo ENOTFOUND cursobeta-dev-elasticache-redis...
I'm not seeing a
REDIS_PRIVATE_URL
advertised in the "Available Variables" tab of my redis service. Does this mean internal is not available?
All my other services have Private Networking addresses so I assume it's enabled for my environment..
In fact, I just tried using it in a Variable for another service...and it was empty
( ^ acron's question moved to: #Redis doesn't seem to be on Private network )