Redis Connection Error during Mastodon Instance Migration

Some errors of connecting to Redis occur when rebuilding the home timeline for all users

~/live$ RAILS_ENV=production ./bin/tootctl feeds build
Error processing 270: Error connecting to Redis on localhost:6379 (Errno::ECONNREFUSED)
Error processing 1: Error connecting to Redis on localhost:6379 (Errno::ECONNREFUSED)
Error processing 265: Error connecting to Redis on localhost:6379 (Errno::ECONNREFUSED)

Check /var/log/redis/redis-server.log

3674:C 15 Jan 22:30:34.679 # Configuration loaded
3675:M 15 Jan 22:30:34.681 # Creating Server TCP listening socket ::1:6379: bind: Cannot assign requested address
3710:C 15 Jan 22:32:05.173 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
3710:C 15 Jan 22:32:05.173 # Redis version=4.0.9, bits=64, commit=00000000, modified=0, pid=3710, just started

According to this comment, do

sed -i "s/bind .*/bind 127.0.0.1/g" /etc/redis/redis.conf

Check log again

3710:C 15 Jan 22:32:05.173 # Configuration loaded
                _._
           _.-``__ ''-._
      _.-``    `.  `_.  ''-._           Redis 4.0.9 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 3711
  `-._    `-._  `-./  _.-'    _.-'
 |`-._`-._    `-.__.-'    _.-'_.-'|
 |    `-._`-._        _.-'_.-'    |           http://redis.io
  `-._    `-._`-.__.-'_.-'    _.-'
 |`-._`-._    `-.__.-'    _.-'_.-'|
 |    `-._`-._        _.-'_.-'    |
  `-._    `-._`-.__.-'_.-'    _.-'
      `-._    `-.__.-'    _.-'
          `-._        _.-'
              `-.__.-'

3711:M 15 Jan 22:32:05.178 # Server initialized
3711:M 15 Jan 22:32:05.179 * Ready to accept connections

It works

~/live$ RAILS_ENV=production ./bin/tootctl feeds build
3/3 |========================================================================================================| Time: 00:00:02
Regenerated feeds for 3 accounts

comments powered by Disqus