我正在尝试为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'
我还检查了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
帮我解决一下。提前致谢。
要运行sidekiq,您需要一台redis服务器:
Redis为Sidekiq提供数据存储。它包含所有作业数据以及运行时和历史数据,以支持Sidekiq的Web UI。
从文档:
https://github.com/mperham/sidekiq/wiki/The-Basics#redis https://github.com/mperham/sidekiq/wiki/Using-Redis
如果你的redis服务器在localhost:6379
以外的地方运行,你可以使用configure the URL。
要设置本地redis服务器,可以使用homebrew安装它:
brew install redis
redis-server # will run the server on `localhost:6379`
然后在第二个shell窗口中,尝试启动sidekiq:
bundle exec sidekiq
你将sidekiq设置为在redis://redis:6379/0
上使用redis,但这不是你系统上的有效网址。特别是,主机redis
无法解析为IP地址。