Redis connection error: Could not connect to Redis at 127.0.0.1:6379: Connection refused

foreword

  • Redis access error installed by docker

error message

Could not connect to Redis at 127.0.0.1:6379: Connection refused

wrong reason

Port 6379 of 127.0.0.1 is not a redis service.
possible reason:

  1. redis is not started
  2. The port that redis listens on is not 6379
  3. The IP bound to redis is not 127.0.0.1

I am in the third case.

I wrote this in the redis configuration file:

bind 127.0.0.1 ::1
bind 172.18.0.2

The purpose of writing this is to hope that redis can be bound to the three ips of 127.0.0.1 ::1 172.18.0.2, but redis is only bound to 172.18.0.2.

improved to:

bind 127.0.0.1 ::1 172.18.0.2

reference

https://blog.csdn.net/qaz18201142158/article/details/107260181

Guess you like

Origin blog.csdn.net/sayyy/article/details/131471386