Rails无法连接到openshift上的redis

时间:2021-12-11 05:00:02

I have openshift apps with installation of redis from this example I have these settings for Sidekiq(initializers/sidekiq.rb):

我有从这个例子安装redis的openshift应用程序我有Sidekiq的这些设置(initializers / sidekiq.rb):

Sidekiq.configure_server do |config|
  config.redis = { path: "#{ENV['OPENSHIFT_GEAR_DIR']}tmp/redis.sock" }
end

Sidekiq.configure_client do |config|
  config.redis = { path: "#{ENV['OPENSHIFT_GEAR_DIR']}tmp/redis.sock" }
end

But I have this error If I can use sidekiq:

但我有这个错误如果我可以使用sidekiq:

Redis::CannotConnectError (Error connecting to Redis on localhost:6379 (ECONNREFUSED)):

any suggestions?

有什么建议么?

1 个解决方案

#1


1  

The error message says that Sidekiq is trying to connect to port 6379 on localhost. The OpenShift example you are using sets the port to 0 in the configuration file, so that the server will not listen on any TCP socket.

错误消息显示Sidekiq正在尝试连接到localhost上的端口6379。您正在使用的OpenShift示例在配置文件中将端口设置为0,以便服务器不会侦听任何TCP套接字。

I think this answers your question: https://github.com/mperham/sidekiq/issues/228#issuecomment-7618003

我认为这回答了你的问题:https://github.com/mperham/sidekiq/issues/228#issuecomment-7618003

#1


1  

The error message says that Sidekiq is trying to connect to port 6379 on localhost. The OpenShift example you are using sets the port to 0 in the configuration file, so that the server will not listen on any TCP socket.

错误消息显示Sidekiq正在尝试连接到localhost上的端口6379。您正在使用的OpenShift示例在配置文件中将端口设置为0,以便服务器不会侦听任何TCP套接字。

I think this answers your question: https://github.com/mperham/sidekiq/issues/228#issuecomment-7618003

我认为这回答了你的问题:https://github.com/mperham/sidekiq/issues/228#issuecomment-7618003