-
Problem Description
Use Redis in the
Python
connectiondocker
container -
Prerequisite knowledge
-
[Errno 104] Connection reset by peer
errno 104 indicates that the write or send method is called on a connection whose socket has been closed. In this case, after calling write or send, the opposite socket will send a Reset signal to the local socket, and then continue to execute write/read, you will get 104.
-
netstat -ntpl
lsof -i:6379
It
lsof -i:6379
can be found that the port is not open. -
solution
In the
Docker
containerredis
in theredis.conf
middlebind
modify ip address of the vessel, thenredis-server
the configuration file.How to
ip
view container address:docker inspect 容器|grep -i add
-
References
- Random ConnectionErrors (104, Connection reset by peer) #1186
- errno 104: error analysis of connetction reset by peer
- Docker Compose demo from official website question
- Must-know network command-netstat
- 10 basic usages of netstat
- The official image of Docker Redis is simple to use
- Docker series ~ Configure external access to the Redis service in the container (10)
- Docker advanced application to give containers independent external network ip