egg icon indicating copy to clipboard operation
egg copied to clipboard

egg-redis配置中的host无法解析字符串

Open oneWalker opened this issue 6 years ago • 0 comments

What happens?

因项目分别将常用的组件在docker内进行分别转发,设置如下:

Mini Showcase Repository(REQUIRED)

 //add the redis setting to the world
  config.redis = {
    client: {
      port: 6379,          // Redis port
      host: "redis",   // Redis host
      password: '',
      db: 1,
    },
  };

ERROR

2020-04-08 16:58:57,914 ERROR 16546 [egg-redis] client error: Error: getaddrinfo ENOTFOUND redis redis:6379
2020-04-08 16:58:57,915 ERROR 16546 nodejs.ENOTFOUNDError: getaddrinfo ENOTFOUND redis redis:6379 (redis) (redis)
    at errnoException (dns.js:55:10)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:97:26)
code: "ENOTFOUND"
errno: "ENOTFOUND"
syscall: "getaddrinfo"
hostname: "redis"
host: "redis"
port: 6379
name: "ENOTFOUNDError"
pid: 16546
hostname: RD-TEST

Context

  • Node Version:node version v9.2.1
  • Egg Version:egg version 2.26.0
  • Plugin Name:egg-redis
  • Plugin Version:^2.4.0
  • Platform:linux

oneWalker avatar Apr 08 '20 09:04 oneWalker