无法将蜂队列连接到Docker容器

时间:2019-03-07 20:02:20

标签: docker redis docker-compose queue

由于某种原因,我似乎很难将蜂队列的竞技场指向我的其他docker镜像进行redis。只是想知道是否有人对此有任何经验。

这是我正在使用的配置模式

{
  "queues": [
    {
      "hostId": "eyeshade-workers",
      "type": "bee",
      "name": "settlement-report",
      "redis": "redis://redis:3011"
    },
...

我也尝试过

{
  "queues": [
    {
      "hostId": "eyeshade-workers",
      "type": "bee",
      "name": "settlement-report",
      "redis": {
        "url": "redis://redis:3011"
      }
    },
{
  "queues": [
    {
      "hostId": "eyeshade-workers",
      "type": "bee",
      "name": "settlement-report",
      "url": "redis://redis:3011"
    },

这是我的redis和arena docker-compose文件在这里:

version: "2.1"

networks:
  ledger:
    driver: bridge

services:
  redis:
    container_name: ledger-redis
    image: redis:latest
    ports:
      - "3011:6379"
    networks:
      - ledger
  arena:
    container_name: worker-arena
    image: mixmaxhq/arena:latest
    networks:
      - ledger
    ports:
      - "4567:4567"
    depends_on:
      - redis
      - eyeshade-worker
    volumes:
      - ./queue/index.json:/opt/arena/src/server/config/index.json

但我不断收到此错误,指出它正在尝试连接到默认的:/

worker-arena         | (node:42) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
worker-arena         | (node:42) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
worker-arena         | (node:42) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
worker-arena         | events.js:182
worker-arena         |       throw er; // Unhandled 'error' event
worker-arena         |       ^
worker-arena         | 
worker-arena         | Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
worker-arena         |     at Object.exports._errnoException (util.js:1016:11)
worker-arena         |     at exports._exceptionWithHostPort (util.js:1039:20)
worker-arena         |     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1138:14)
worker-arena         | [nodemon] app crashed - waiting for file changes before starting...

0 个答案:

没有答案