Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

210
Vistas
Redis Client ignoring configuration options set on it and trying to connect to default ip 127.0.01

In AWS i am using ElastiCache Redis server and using node as backEnd and "promise-redis" package

this is how i am tried to do to connect to my redis server endpoint

client = redis.createClient({
        host: '**my redis primary endpoint**',
        port: 6379
    });

this worked for a while but after adding some lines of code not related to redis it gave me this error

error: connect ECONNREFUSED 127.0.0.1:6379

it seems trying to connect to the local server and ignoring the host endpoint i gave to him

and when i changed the port to any number like 6300

it gave the same error with the default port number too

error: connect ECONNREFUSED 127.0.0.1:6379

i am so confused please help !!!!

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

these "geniuses" changed such a significant thing in their library as the connection and didn't even give a good warning about it. I'm already silent about the fact that it is a crime to make such changes when your library in a million projects is already coded. Now you need to connect like this:

const client = redis.createClient({
  socket: {
    host,
    port
  },
  password
});

I advise you to switch to the ioredis library, there is an old api, only the client is created through new Redis ({old config})

Because in this old library ("redis"), for some reason they now require an asynchronous connect () for some functionality, without really explaining why and when it is needed, and when it is not needed. Half of the code works for me, and half does not. So, use better this:

let Redis = require('ioredis');
  const client = new Redis({
  host: '***',
  port: ****,
  password: '****'
});
over 4 years ago · Santiago Trujillo Denunciar

0

Make sure the host key does not have the protocol part "http://" in it

client = redis.createClient({ 
    host: '192.168.45.34', // don't use host: 'http://192.168.45.34'
    port: 6379 
});

If you include the protocol in your host key, the redis client defaults to using localhost - 127.0.0.1

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda