无法将bee队列连接到docker容器
出于某种原因,我似乎很难将bee queue的竞技场指向我的另一张redis docker图像。只是想知道是否有人有这方面的经验 这就是我正在使用的配置模式无法将bee队列连接到docker容器,docker,redis,docker-compose,queue,Docker,Redis,Docker Compose,Queue,出于某种原因,我似乎很难将bee queue的竞技场指向我的另一张redis docker图像。只是想知道是否有人有这方面的经验 这就是我正在使用的配置模式 { "queues": [ { "hostId": "eyeshade-workers", "type": "bee", "name": "settlement-report", "redis": "redis://redis:3011" }, ... 我也试过了 {
{
"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"
}
},
这是我的redis和arena docker撰写文件:
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...
你解决过这个问题吗?我发现它与docker指向的图像(大约2岁)有关,所以我建立了自己的图像,上传到docker hub,然后在我的项目中指向它,效果很好。他们只需要更新docker图像,它应该尽可能的工作,但不,实际的原始设置,使用他们的图像不工作感谢的信息!我想我解决了这个问题。在我的例子中,我使用Bull.js,默认情况下队列连接到localhost,我有另一个redis.createClient(),我一直在关注其他地方,直到我意识到每个新队列()都需要docker redis网络而不是localhost。在这件事上浪费了好几天。谢谢你的回复@MichaelMcLaughlin:你能用一个示例配置文件和最新的docker compose文件发布一个答案吗。谢谢你解决过这个问题吗?我发现它和docker指向的图像(大约2岁)有关,所以我建立了自己的,上传到docker hub,然后在我的项目中指向它,效果很好。他们只需要更新docker图像,它应该尽可能的工作,但不,实际的原始设置,使用他们的图像不工作感谢的信息!我想我解决了这个问题。在我的例子中,我使用Bull.js,默认情况下队列连接到localhost,我有另一个redis.createClient(),我一直在关注其他地方,直到我意识到每个新队列()都需要docker redis网络而不是localhost。在这件事上浪费了好几天。谢谢你的回复@MichaelMcLaughlin:你能用一个示例配置文件和最新的docker compose文件发布一个答案吗。谢谢
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...