gpt4 book ai didi

ruby-on-rails-4 - Rails 4.2:sidekiq 无法连接到 Redis(Errno::ECONNREFUSED),由 foreman 启动

转载 作者:可可西里 更新时间:2023-11-01 11:36:45 24 4
gpt4 key购买 nike

在本地主机上的开发模式下(OS X°我开始使用

foreman start

我的 Procfile 是: postgresql: postgres -D 供应商/postgresql redis: redis 服务器供应商/redis/db/redis.conf redis-slave:redis-server vendor/redis-slave/db/redis.conf sidekiq: sidekiq -C config/sidekiq.yml -q devise,1 -q default -q mailers sidekiq_web: thin -R sidekiq.ru start -p 9292 邮件:mailcatcher -f 网络:bundle exec unicorn -p 3001 -c ./config/unicorn.rb rails: bundle exec rails s unicorn

一切正常,但 sidekiq 无法连接到正在运行的 Redis 实例,因此它退出并返回代码但是,如果我在不同的窗口中启动每个进程,它运行良好......我的工头脚本可能有什么问题?

         $ foreman start
01:19:21 postgresql.1 | started with pid 48166
01:19:21 redis.1 | started with pid 48167
01:19:21 redis-slave.1 | started with pid 48168
01:19:21 sidekiq.1 | started with pid 48169
01:19:21 sidekiq_web.1 | started with pid 48170
01:19:21 mail.1 | started with pid 48171
01:19:21 web.1 | started with pid 48172
01:19:21 rails.1 | started with pid 48173
01:19:21 redis-slave.1 | 48168:S 16 Aug 01:19:21.220 * Increased maximum number of open files to 10032 (it was originally set to 2560).
01:19:21 redis-slave.1 | _._
01:19:21 redis-slave.1 | _.-``__ ''-._
01:19:21 redis-slave.1 | _.-`` `. `_. ''-._ Redis 3.0.1 (00000000/0) 64 bit
01:19:21 redis-slave.1 | .-`` .-```. ```\/ _.,_ ''-._
01:19:21 redis-slave.1 | ( ' , .-` | `, ) Running in standalone mode
01:19:21 redis-slave.1 | |`-._`-...-` __...-.``-._|'` _.-'| Port: 6380
01:19:21 redis-slave.1 | | `-._ `._ / _.-' | PID: 48168
01:19:21 redis-slave.1 | `-._ `-._ `-./ _.-' _.-'
01:19:21 redis-slave.1 | |`-._`-._ `-.__.-' _.-'_.-'|
01:19:21 redis-slave.1 | | `-._`-._ _.-'_.-' | http://redis.io
01:19:21 redis-slave.1 | `-._ `-._`-.__.-'_.-' _.-'
01:19:21 redis-slave.1 | |`-._`-._ `-.__.-' _.-'_.-'|
01:19:21 redis-slave.1 | | `-._`-._ _.-'_.-' |
01:19:21 redis-slave.1 | `-._ `-._`-.__.-'_.-' _.-'
01:19:21 redis-slave.1 | `-._ `-.__.-' _.-'
01:19:21 redis-slave.1 | `-._ _.-'
01:19:21 redis-slave.1 | `-.__.-'
01:19:21 redis-slave.1 |
01:19:21 redis-slave.1 | 48168:S 16 Aug 01:19:21.248 # Server started, Redis version 3.0.1
01:19:21 redis-slave.1 | 48168:S 16 Aug 01:19:21.275 * DB loaded from disk: 0.028 seconds
01:19:21 redis-slave.1 | 48168:S 16 Aug 01:19:21.275 * The server is now ready to accept connections on port 6380
01:19:21 postgresql.1 | LOG: database system was shut down at 2015-08-16 01:12:29 CEST
01:19:21 postgresql.1 | LOG: database system is ready to accept connections
01:19:21 postgresql.1 | LOG: autovacuum launcher started
01:19:22 redis-slave.1 | 48168:S 16 Aug 01:19:22.254 * Connecting to MASTER localhost:6379
01:19:22 redis-slave.1 | 48168:S 16 Aug 01:19:22.255 * MASTER <-> SLAVE sync started
01:19:22 redis-slave.1 | 48168:S 16 Aug 01:19:22.255 * Non blocking connect for SYNC fired the event.
01:19:22 redis-slave.1 | 48168:S 16 Aug 01:19:22.256 * Master replied to PING, replication can continue...
01:19:22 redis-slave.1 | 48168:S 16 Aug 01:19:22.256 * Partial resynchronization not possible (no cached master)
01:19:22 redis-slave.1 | 48168:S 16 Aug 01:19:22.268 * Full resync from master: 337a934fccebc3e0ad1627e6f06f0e061b0515e2:1
01:19:22 redis-slave.1 | 48168:S 16 Aug 01:19:22.374 * MASTER <-> SLAVE sync: receiving 18 bytes from master
01:19:22 redis-slave.1 | 48168:S 16 Aug 01:19:22.374 * MASTER <-> SLAVE sync: Flushing old data
01:19:22 redis-slave.1 | 48168:S 16 Aug 01:19:22.374 * MASTER <-> SLAVE sync: Loading DB in memory
01:19:22 redis-slave.1 | 48168:S 16 Aug 01:19:22.378 * MASTER <-> SLAVE sync: Finished with success
01:19:23 sidekiq_web.1 | /Users/yves/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/thin-1.6.3/lib/thin/backends/base.rb:103: warning: epoll is not supported on this platform
01:19:23 sidekiq.1 | exited with code 0
01:19:23 system | sending SIGTERM to all processes
01:19:23 postgresql.1 | LOG: received smart shutdown request
01:19:23 redis-slave.1 | 48168:signal-handler (1439680763) Received SIGTERM scheduling shutdown...
01:19:23 postgresql.1 | LOG: autovacuum launcher shutting down
01:19:23 postgresql.1 | LOG: shutting down
01:19:23 redis.1 | exited with code 0
01:19:23 redis-slave.1 | 48168:S 16 Aug 01:19:23.505 # Connection with master lost.
01:19:23 redis-slave.1 | 48168:S 16 Aug 01:19:23.505 * Caching the disconnected master state.
01:19:23 web.1 | terminated by SIGTERM
01:19:23 mail.1 | terminated by SIGTERM
01:19:23 rails.1 | terminated by SIGTERM
01:19:23 sidekiq_web.1 | terminated by SIGTERM
01:19:23 postgresql.1 | LOG: database system is shut down
01:19:23 postgresql.1 | exited with code 0
01:19:23 redis-slave.1 | 48168:S 16 Aug 01:19:23.575 # User requested shutdown...
01:19:23 redis-slave.1 | 48168:S 16 Aug 01:19:23.575 # Redis is now ready to exit, bye bye...
01:19:23 redis-slave.1 | exited with code 0
yves@MacMini: recommence $ ps aux | grep redis
yves 48330 0.0 0.0 2441988 672 s000 S+ 1:26AM 0:00.01 grep redis
yves@MacMini: recommence $ foreman start
01:26:26 postgresql.1 | started with pid 48353
01:26:26 redis.1 | started with pid 48354
01:26:26 redis-slave.1 | started with pid 48355
01:26:26 sidekiq.1 | started with pid 48356
01:26:26 sidekiq_web.1 | started with pid 48357
01:26:26 mail.1 | started with pid 48358
01:26:26 web.1 | started with pid 48359
01:26:26 rails.1 | started with pid 48360
01:26:26 redis-slave.1 | 48355:S 16 Aug 01:26:26.464 * Increased maximum number of open files to 10032 (it was originally set to 2560).
01:26:26 redis-slave.1 | _._
01:26:26 redis-slave.1 | _.-``__ ''-._
01:26:26 redis-slave.1 | _.-`` `. `_. ''-._ Redis 3.0.1 (00000000/0) 64 bit
01:26:26 redis-slave.1 | .-`` .-```. ```\/ _.,_ ''-._
01:26:26 redis-slave.1 | ( ' , .-` | `, ) Running in standalone mode
01:26:26 redis-slave.1 | |`-._`-...-` __...-.``-._|'` _.-'| Port: 6380
01:26:26 redis-slave.1 | | `-._ `._ / _.-' | PID: 48355
01:26:26 redis-slave.1 | `-._ `-._ `-./ _.-' _.-'
01:26:26 redis-slave.1 | |`-._`-._ `-.__.-' _.-'_.-'|
01:26:26 redis-slave.1 | | `-._`-._ _.-'_.-' | http://redis.io
01:26:26 redis-slave.1 | `-._ `-._`-.__.-'_.-' _.-'
01:26:26 redis-slave.1 | |`-._`-._ `-.__.-' _.-'_.-'|
01:26:26 redis-slave.1 | | `-._`-._ _.-'_.-' |
01:26:26 redis-slave.1 | `-._ `-._`-.__.-'_.-' _.-'
01:26:26 redis-slave.1 | `-._ `-.__.-' _.-'
01:26:26 redis-slave.1 | `-._ _.-'
01:26:26 redis-slave.1 | `-.__.-'
01:26:26 redis-slave.1 |
01:26:26 redis-slave.1 | 48355:S 16 Aug 01:26:26.467 # Server started, Redis version 3.0.1
01:26:26 redis-slave.1 | 48355:S 16 Aug 01:26:26.467 * DB loaded from disk: 0.000 seconds
01:26:26 redis-slave.1 | 48355:S 16 Aug 01:26:26.467 * The server is now ready to accept connections on port 6380
01:26:26 redis-slave.1 | 48355:S 16 Aug 01:26:26.469 * Connecting to MASTER localhost:6379
01:26:26 redis-slave.1 | 48355:S 16 Aug 01:26:26.470 * MASTER <-> SLAVE sync started
01:26:26 redis-slave.1 | 48355:S 16 Aug 01:26:26.470 * Non blocking connect for SYNC fired the event.
01:26:26 redis-slave.1 | 48355:S 16 Aug 01:26:26.470 * Master replied to PING, replication can continue...
01:26:26 redis-slave.1 | 48355:S 16 Aug 01:26:26.471 * Partial resynchronization not possible (no cached master)
01:26:26 redis-slave.1 | 48355:S 16 Aug 01:26:26.471 * Full resync from master: f55a717fbd36511c5581e081e154c8e557499754:1
01:26:26 postgresql.1 | LOG: database system was shut down at 2015-08-16 01:19:23 CEST
01:26:26 postgresql.1 | LOG: autovacuum launcher started
01:26:26 postgresql.1 | LOG: database system is ready to accept connections
01:26:26 redis-slave.1 | 48355:S 16 Aug 01:26:26.557 * MASTER <-> SLAVE sync: receiving 18 bytes from master
01:26:26 redis-slave.1 | 48355:S 16 Aug 01:26:26.558 * MASTER <-> SLAVE sync: Flushing old data
01:26:26 redis-slave.1 | 48355:S 16 Aug 01:26:26.558 * MASTER <-> SLAVE sync: Loading DB in memory
01:26:26 redis-slave.1 | 48355:S 16 Aug 01:26:26.558 * MASTER <-> SLAVE sync: Finished with success
01:26:27 sidekiq_web.1 | /Users/yves/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/thin-1.6.3/lib/thin/backends/base.rb:103: warning: epoll is not supported on this platform
01:26:27 sidekiq.1 | exited with code 0
01:26:27 system | sending SIGTERM to all processes
01:26:27 postgresql.1 | LOG: received smart shutdown request
01:26:27 redis-slave.1 | 48355:signal-handler (1439681187) Received SIGTERM scheduling shutdown...
01:26:27 postgresql.1 | LOG: autovacuum launcher shutting down
01:26:27 postgresql.1 | LOG: shutting down
01:26:27 postgresql.1 | LOG: database system is shut down
01:26:27 redis.1 | exited with code 0
01:26:27 redis-slave.1 | 48355:S 16 Aug 01:26:27.991 # Connection with master lost.
01:26:27 redis-slave.1 | 48355:S 16 Aug 01:26:27.991 * Caching the disconnected master state.
01:26:27 redis-slave.1 | 48355:S 16 Aug 01:26:27.997 # User requested shutdown...
01:26:27 redis-slave.1 | 48355:S 16 Aug 01:26:27.997 # Redis is now ready to exit, bye bye...
01:26:27 redis-slave.1 | exited with code 0
01:26:27 postgresql.1 | exited with code 0
01:26:28 mail.1 | terminated by SIGTERM
01:26:28 sidekiq_web.1 | terminated by SIGTERM
01:26:28 rails.1 | terminated by SIGTERM
01:26:28 web.1 | terminated by SIGTERM

sidekiq.log 显示错误..

        WARN: Unresolved specs during Gem::Specification.reset:
minitest (~> 5.1)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
2015-08-15T23:19:29.882Z 48183 TID-oxy6u8hqw INFO: Booting Sidekiq 3.4.2 with redis options {:url=>"redis://localhost:6379/0", :driver=>:hiredis}
2015-08-15T23:19:32.130Z 48183 TID-oxy6u8hqw INFO: Running in ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin14]
2015-08-15T23:19:32.130Z 48183 TID-oxy6u8hqw INFO: See LICENSE and the LGPL-3.0 for licensing details.
2015-08-15T23:19:32.130Z 48183 TID-oxy6u8hqw INFO: Upgrade to Sidekiq Pro for more features and support: http://sidekiq.org/pro
2015-08-15T23:19:32.235Z 48183 TID-oxy6qw1tk ERROR: Error fetching message: Error connecting to Redis on localhost:6379 (Errno::ECONNREFUSED)
2015-08-15T23:19:32.235Z 48183 TID-oxy6qw1tk ERROR: /Users/yves/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/redis-3.2.1/lib/redis/client.rb:331:in `rescue in establish_connection'

最佳答案

尝试使用“127.0.0.1”或“::1”代替“localhost”。 IPv6 与 IPv4 有时会很棘手。

关于ruby-on-rails-4 - Rails 4.2:sidekiq 无法连接到 Redis(Errno::ECONNREFUSED),由 foreman 启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32030477/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com