(20200921 Solved)ConnectionResetError: [Errno 104] Connection reset by peer

  • Problem Description

    Use Redis in the Pythonconnection dockercontainer

  • 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:6379can be found that the port is not open.

  • solution

    In the Dockercontainer redisin the redis.confmiddle bindmodify ip address of the vessel, then redis-serverthe configuration file.

    How to ipview container address:docker inspect 容器|grep -i add

  • References

  1. Random ConnectionErrors (104, Connection reset by peer) #1186
  2. errno 104: error analysis of connetction reset by peer
  3. Docker Compose demo from official website question
  4. Must-know network command-netstat
  5. 10 basic usages of netstat
  6. The official image of Docker Redis is simple to use
  7. Docker series ~ Configure external access to the Redis service in the container (10)
  8. Docker advanced application to give containers independent external network ip

Guess you like

Origin blog.csdn.net/The_Time_Runner/article/details/109171379
Recommended