Docker installation failing - Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED
-
docker run --name my-forum-redis -d -p 6379:6379 nodebb/docker:ubuntu-redis
docker run --name dockerdev-nodebb --link dockerdev-redis:redis -p 80:80 -p 443:443 -p 4567:4567 -P -t -i nodebb/docker:ubuntuDefined the wbsite url for the forum as http://forum.mydomain.com:80
Results in:
connect-redis@2.0.0 node_modules/connect-redis āāā debug@2.2.0 (ms@0.7.1) 14/12 09:45 [1] - info: Populating database with default configs, if not already set... 14/12 09:45 [1] - error: Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED at RedisClient.flush_and_error (/opt/nodebb/node_modules/redis/index.js:142:13) at RedisClient.on_error (/opt/nodebb/node_modules/redis/index.js:180:10) at Socket.<anonymous> (/opt/nodebb/node_modules/redis/index.js:95:14) at Socket.EventEmitter.emit (events.js:95:17) at net.js:441:14 at process._tickCallback (node.js:415:13) 14/12 09:45 [1] - warn: NodeBB Setup Aborted. Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED
Any help would be appreciated.
-
@william.owen
telnet localhost 6379 ?
netstat -npl | grep 6379 && echo 'Port open. Good.' || echo 'Port Closed. Redis started ?'
-
Hi there; thanks for the reply. I get : -
Port open. Good.
-
telnet localhost 6379 ?
-
telnet: Unable to connect to remote host: Connection refused
-
@william.owen
This suggests that it is not in the driver connection and not in the installation script. It tells us that the database connection is not possible, even though you have previously reported that the port is open.- Start Redis
- Input 'redis-cli ping' and Enter
- Insert screenshot command output netstat -npl
-
you have to run
docker network inspect bridge
the result will be :
[ { "Name": "bridge", "Id": "a82774b4cc857b934ca5d3bba8f20a077aef3c117b9a390455466fb8785aea0f", "Scope": "local", "Driver": "bridge", "EnableIPv6": false, "IPAM": { "Driver": "default", "Options": null, "Config": [ { "Subnet": "172.17.0.0/16", "Gateway": "172.17.0.1" } ] }, "Internal": false, "Containers": { "64e285ed8b6a287c693df8244f4cf45c6e724e74e979734b823f14f19cb2a74b": { "Name": "node-bb-redis", "EndpointID": "869f51cfefb3d1d59b5f0cc881c16e6a127b423345704c7f17bc3f10c5061922", "MacAddress": "02:42:ac:11:00:02", "IPv4Address": "172.17.0.2/16", "IPv6Address": "" }, "7fd7885220b189427121102a9cf34e7b2259b5d1038b3f6a522f24e1e3ebd25b": { "Name": "node-bb", "EndpointID": "9d971bdd8675714ba96385c3832cf08a0ed6630cc40e8ac08d3666c42f0b9133", "MacAddress": "02:42:ac:11:00:05", "IPv4Address": "172.17.0.5/16", "IPv6Address": "" }, "8391d3e8f44f064e885e2cf754a59a7cc00d24ca5c2db13b4add0152308eb843": { "Name": "nginx-letsencrypt", "EndpointID": "0416947f3ff616fb063b17363ef4f5d282a0549bc15582a842f97155b9ede5c2", "MacAddress": "02:42:ac:11:00:04", "IPv4Address": "172.17.0.4/16", "IPv6Address": "" }, "a06b204eb61be007c093488aa1f3491407b784c48c4b3a069afcc967892b1522": { "Name": "nginx-proxy", "EndpointID": "6de08ad911df8e80b04f4600909b76c70d3dd99f26a586cc444bf5a2ec97e2ef", "MacAddress": "02:42:ac:11:00:03", "IPv4Address": "172.17.0.3/16", "IPv6Address": "" } }, "Options": { "com.docker.network.bridge.default_bridge": "true", "com.docker.network.bridge.enable_icc": "true", "com.docker.network.bridge.enable_ip_masquerade": "true", "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0", "com.docker.network.bridge.name": "docker0", "com.docker.network.driver.mtu": "1500" }, "Labels": {} } ]
Find your redis IP and put it in your nodeBB config (in my case Redis IP is 172.17.0.2)
-
@Absam-Sibsam you saved me bro, worked perfectly!