Проблема с рельсами Sidekiq - PullRequest
       12

Проблема с рельсами Sidekiq

0 голосов
/ 07 сентября 2018

Я пытаюсь запустить приведенную ниже команду для Sidekiq.

 bundle exec sidekiq

Я получаю сообщение об ошибке ниже и не могу запустить задания с sidekiq.

$ bundle exec sidekiq
Note: Google::Cloud::Logging is disabled because it failed to authorize with the service. (Unable to read the credential file specified by GOOGLE_APPLICATION_CREDENTIALS: file /home/app/config/secrets/pubsub-credentials.json does not exist) Falling back to the default Rails logger.

INFO: Booting Sidekiq 5.1.1 with redis options {:url=>"redis://redis:6379/0", :role=>:master, :password=>"REDACTED", :id=>"Sidekiq-server-PID-10968"}


         m,
         `$b
    .ss,  $$:         .,d$
    `$$P,d$P'    .,md$P"'
     ,$$$$$bmmd$$$P^'
   .d$$$$$$$$$$P'
   $$^' `"^$$$'       ____  _     _      _    _
   $:     ,$$:       / ___|(_) __| | ___| | _(_) __ _
   `b     :$$        \___ \| |/ _` |/ _ \ |/ / |/ _` |
          $$:         ___) | | (_| |  __/   <| | (_| |
          $$         |____/|_|\__,_|\___|_|\_\_|\__, |
        .d$$                                       |_|

INFO: Running in ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-linux]
INFO: See LICENSE and the LGPL-3.0 for licensing details.
INFO: Upgrade to Sidekiq Pro for more features and support: http://sidekiq.org
getaddrinfo: Name or service not known
/vendor/cache/ruby/2.4.0/gems/redis-4.0.1/lib/redis/connection/ruby.rb:210:in `getaddrinfo'

IТакже проверил Redis

$redis-cli ping
PONG
$ redis-server
1991:C 07 Sep 17:11:54.900 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1991:C 07 Sep 17:11:54.901 # Redis version=4.0.9, bits=64, commit=00000000, modified=0, pid=1991, just started
1991:C 07 Sep 17:11:54.901 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
1991:M 07 Sep 17:11:54.901 # You requested maxclients of 10000 requiring at least 10032 max file descriptors.
1991:M 07 Sep 17:11:54.901 # Server can't set maximum open files to 10032 because of OS error: Operation not permitted.
1991:M 07 Sep 17:11:54.901 # Current maximum open files is 4096. maxclients has been reduced to 4064 to compensate for low ulimit. If you need higher maxclients increase 'ulimit -n'.
1991:M 07 Sep 17:11:54.901 # Creating Server TCP listening socket *:6379: bind: Address already in use

Помогите мне решить.Заранее спасибо.

Ответы [ 2 ]

0 голосов
/ 07 сентября 2018

Для запуска sidekiq вам нужен сервер redis:

Redis обеспечивает хранение данных для Sidekiq. Он содержит все данные о заданиях, а также данные времени выполнения и исторические данные для поддержки веб-интерфейса Sidekiq.

Из документации:

https://github.com/mperham/sidekiq/wiki/The-Basics#redis
https://github.com/mperham/sidekiq/wiki/Using-Redis

Если ваш сервер Redis работает где-то еще, чем localhost:6379, вы можете настроить URL .

Чтобы настроить локальный сервер Redis, вы можете установить его с помощью homebrew :

brew install redis
redis-server # will run the server on `localhost:6379`

Затем во втором окне оболочки попробуйте запустить sidekiq:

bundle exec sidekiq
0 голосов
/ 07 сентября 2018

Вы установили для sidekiq значение redis на redis://redis:6379/0, но это неверный URL в вашей системе. В частности, хост redis не может быть преобразован в IP-адрес.

...