awsでunicornを起動させようと思っているんですができません
comand
1[ec2-user@ip-172-31-43-0 rails_test3]$ unicorn_rails -c config/unicorn.rb -E production -D 2master failed to start, check stderr log for details
となります
ログを見ると
log
1[ec2-user@ip-172-31-43-0 rails_test3]$ less log/unicorn.stderr.log 2F, [2021-07-20T10:34:56.709901 #17371] FATAL -- : error adding listener addr=/var/tmp/sockets/unicorn.sock 3/home/ec2-user/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/unicorn-6.0.0/lib/unicorn/socket_helper.rb:138:in `initialize': No such file or directory - connect(2) for /var/tmp/sockets/unicorn.sock (Errno::ENOENT) 4 from /home/ec2-user/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/unicorn-6.0.0/lib/unicorn/socket_helper.rb:138:in `new' 5 from /home/ec2-user/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/unicorn-6.0.0/lib/unicorn/socket_helper.rb:138:in `bind_listen' 6 from /home/ec2-user/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/unicorn-6.0.0/lib/unicorn/http_server.rb:242:in `listen' 7 from /home/ec2-user/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/unicorn-6.0.0/lib/unicorn/http_server.rb:882:in `block in bind_new_listeners!' 8 from /home/ec2-user/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/unicorn-6.0.0/lib/unicorn/http_server.rb:882:in `each' 9 from /home/ec2-user/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/unicorn-6.0.0/lib/unicorn/http_server.rb:882:in `bind_new_listeners!' 10 from /home/ec2-user/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/unicorn-6.0.0/lib/unicorn/http_server.rb:141:in `start' 11 from /home/ec2-user/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/unicorn-6.0.0/bin/unicorn_rails:209:in `<top (required)>' 12 from /home/ec2-user/.rbenv/versions/3.0.1/bin/unicorn_rails:23:in `load' 13 from /home/ec2-user/.rbenv/versions/3.0.1/bin/unicorn_rails:23:in `<main>'
unicornの設定は
ruby
1root_path = File.expand_path('../../', __FILE__) 2 3# アプリケーションサーバの性能を決定する 4worker_processes 2 5 6# アプリケーションの設置されているディレクトリを指定 7working_directory root_path 8 9# プロセスIDの保存先を指定 10pid "#{root_path}/tmp/pids/unicorn.pid" 11#pid "/var/tmp/pids/unicorn.pid" 12# ポート番号を指定 13#listen "#{root_path}/tmp/sockets/unicorn.sock" 14listen "/var/tmp/sockets/unicorn.sock" 15# エラーのログを記録するファイルを指定 16stderr_path "#{root_path}/log/unicorn.stderr.log" 17#stderr_path "/var/log/unicorn.stderr.log" 18 19# 通常のログを記録するファイルを指定 20stdout_path "#{root_path}/log/unicorn.stdout.log" 21#stdout_path "/var/log/unicorn.stdout.log" 22 23#応答時間を待つ上限時間を設定 24timeout 30 25 26# ダウンタイムなしでUnicornを再起動時する 27preload_app true 28 29GC.respond_to?(:copy_on_write_friendly=) && GC.copy_on_write_friendly = true 30 31check_client_connection false 32 33run_once = true 34 35before_fork do |server, worker| 36 defined?(ActiveRecord::Base) && 37 ActiveRecord::Base.connection.disconnect! 38 39 if run_once 40 run_once = false # prevent from firing again 41 end 42 43 old_pid = "#{server.config[:pid]}.oldbin" 44 if File.exist?(old_pid) && server.pid != old_pid 45 begin 46 sig = (worker.nr + 1) >= server.worker_processes ? :QUIT : :TTOU 47 Process.kill(sig, File.read(old_pid).to_i) 48 rescue Errno::ENOENT, Errno::ESRCH => e 49 logger.error e 50 end 51 end 52end 53 54after_fork do |_server, _worker| 55 defined?(ActiveRecord::Base) && ActiveRecord::Base.establish_connection 56end
何が原因でどうすればいいか教えてください
urlは
http://35.75.245.81/
です
あなたの回答
tips
プレビュー