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

前端 未结 12 1556
灰色年华
灰色年华 2020-12-22 22:10

Using homebrew to install Redis but when I try to ping Redis it shows this error:

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

12条回答
  •  -上瘾入骨i
    2020-12-22 22:41

    I was stuck on this for a long time. After a lot of tries I was able to configured it properly.

    There can be different reasons of raising the error. I am trying to provide the reason and the solution to overcome from that situation.

    1. 6379 Port is not allowed by ufw firewall.

      Solution: type following command sudo ufw allow 6379

    2. The issue can be related to permission of redis user. May be redis user doesn't have permission of modifying necessary redis directories. The redis user should have permissions in the following directories:

      • /var/lib/redis
      • /var/log/redis
      • /run/redis
      • /etc/redis

      To give the owner permission to redis user, type the following commands:

      • sudo chown -R redis:redis /var/lib/redis
      • sudo chown -R redis:redis /var/log/redis
      • sudo chown -R redis:redis /run/redis
      • sudo chown -R redis:redis /etc/redis.

      Now restart redis-server by following command:

      sudo systemctl restart redis-server

    Hope this will be helpful for somebody.

提交回复
热议问题