You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[root@VM_0_11_centos egg-cnode]# docker-compose up -d
Creating network "eggcnode_docker_cnode" with driver "bridge"
Creating volume "eggcnode_egg-mongo" with default driver
Creating volume "eggcnode_egg-redis" with default driver
Creating eggcnode_mongodb_1 ... done
Creating eggcnode_redis_1 ... done
Creating eggcnode_cnode_1 ... done
查看容器eggcnode_cnode_1 日志
2018-04-08 07:07:18,978 INFO 42 [egg:core:ready_stat] end ready task /usr/src/app/node_modules/egg-core/lib/egg.js:319:10, remain ["/usr/src/app/node_modules/egg-watcher/app.js:15:7","/usr/src/app/node_modules/egg-redis/lib/redis.js:48:7","/usr/src/app/node_modules/egg-mongoose/lib/mongoose.js:74:7"]
2018-04-08 07:07:18,985 ERROR 42 [egg-mongoose] mongodb://egg_cnode:egg_cnode@mongodb:27017/egg_cnode disconnected
2018-04-08 07:07:18,987 INFO 42 [egg-redis] connect success on redis://:egg_cnode@redis:6379/0
2018-04-08 07:07:18,991 ERROR 42 nodejs.MongoError: [egg-mongoose]failed to connect to server [mongodb:27017] on first connect [MongoError: connect ECONNREFUSED 172.19.0.2:27017]
at Pool.<anonymous> (/usr/src/app/node_modules/mongodb-core/lib/topologies/server.js:336:35)
at emitOne (events.js:116:13)
at Pool.emit (events.js:211:7)
at Connection.<anonymous> (/usr/src/app/node_modules/mongodb-core/lib/connection/pool.js:280:12)
at Object.onceWrapper (events.js:317:30)
at emitTwo (events.js:126:13)
at Connection.emit (events.js:214:7)
at Socket.<anonymous> (/usr/src/app/node_modules/mongodb-core/lib/connection/connection.js:189:49)
at Object.onceWrapper (events.js:315:30)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at emitErrorNT (internal/streams/destroy.js:64:8)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
name: 'MongoError'
message: '[egg-mongoose]failed to connect to server [mongodb:27017] on first connect [MongoError: connect ECONNREFUSED 172.19.0.2:27017]'
pid: 42
hostname: ee66c1c8cd4f
环境:
描述
修改docker-compose.yml
开启 redis 和mongo 默认端口设置 6379 和 27017
执行 docker-compose up -d 命令
查看容器eggcnode_cnode_1 日志
排查
链接mongodb数据库进行测试
在centos 中可以正常访问 172.19.0.2:27017/egg_cnode 库
备注
本人 docker 和 docker-compose 知识有限,目前使用遇到如上问题,还望大神帮忙答疑解惑
The text was updated successfully, but these errors were encountered: