简体   繁体   中英

Sidekiq can't connect to redis in rails

I have my redis server installed and running, but when I connect sidekiq using bundle exec sidekiq it throws an error message

Timed out connecting to Redis on localhost:6379

Redis Server is running on port: 6379.

Why are you using bundle exec sidekiq?

Try connecting with "redis-cli -h localhost"

I think it means you're redis server isn't running. Try running sudo /etc/init.d/redis-server start on your terminal, also make sure redis has permission to write to /var/log/redis.log or it won't start.

For the issue was my redis production url wasn't correct.

My fix was:

  1. open $ sudo nano gitlab/htdocs/config/resque.yml
  2. change production: redis://some-wrong-url:6379 to production: redis://localhost:6379
  3. restarted my Bitnami stack $ sudo /opt/bitnami/ctlscript.sh restart

I first verified my redis url from the answer @henley left.

*Note I'm using a Bitnami stack

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM