के साथ हमें यूनिकॉर्न के साथ गर्म-तैनाती में परेशानी हो रही है। हम conical unicorn.rb
कॉन्फ़िगरेशन का बहुत अधिक उपयोग करते हैं, working_directory
को symlink'd फ़ोल्डर को इंगित करने के लिए सेट करें, लेकिन किसी भी तरह यह वास्तविक फ़ोल्डर पर फंस गया लगता है जब इसे पहली बार शुरू किया गया था और सिम्लिंक का पालन करने में असफल रहा।यूनिकॉर्न वर्किंग_डायरेक्टरी सिम्लिंक
# config/unicorn.rb
if ENV['RAILS_ENV'] == 'production'
worker_processes 4
else
worker_processes 2
end
working_directory "/var/local/project/symlinkfolder"
# Listen on unix socket
listen "/tmp/unicorn.sock", :backlog => 64
pid "/var/run/unicorn/unicorn.pid"
stderr_path "/var/log/unicorn/unicorn.log"
stdout_path "/var/log/unicorn/unicorn.log"
preload_app true
before_fork do |server, worker|
# the following is highly recomended for Rails + "preload_app true"
# as there's no need for the master process to hold a connection
if defined?(ActiveRecord::Base)
ActiveRecord::Base.connection.disconnect!
end
# Before forking, kill the master process that belongs to the .oldbin PID.
# This enables 0 downtime deploys.
old_pid = "/var/run/unicorn/unicorn.pid.oldbin"
if File.exists?(old_pid) && server.pid != old_pid
begin
Process.kill("QUIT", File.read(old_pid).to_i)
rescue Errno::ENOENT, Errno::ESRCH
# someone else did our job for us
end
end
end
after_fork do |server, worker|
# the following is *required* for Rails + "preload_app true",
if defined?(ActiveRecord::Base)
ActiveRecord::Base.establish_connection
end
# this makes sure the logging-rails framework works when preload_app = true
Logging.reopen
# if preload_app is true, then you may also want to check and
# restart any other shared sockets/descriptors such as Memcached,
# and Redis. TokyoCabinet file handles are safe to reuse
# between any number of forked children (assuming your kernel
# correctly implements pread()/pwrite() system calls)
end
जब हम एक USR2
जारी है, हम गेंडा लॉग में इस देखें:
executing ["/var/local/project/project.d/6/vendor/bundle/ruby/1.9.1/bin/unicorn_rails", "-E", "staging", "-D", "-c", "/var/local/project/symlinkfolder/config/unicorn.rb"│·
, {12=>#<Kgio::UNIXServer:fd 12>}] (in /var/local/project/project.d/8)
तो गेंडा किसी भी तरह संस्करण 6 पर 'अटक' है, जबकि वास्तविक सांकेतिक रूप से लिंक फ़ोल्डर संस्करण 8 पर है .. । यह एक समस्या जैसे ही हम संस्करण 6 में कुछ तैनात के बाद के लिए फ़ोल्डर छँटाई के रूप में हो जाता है ...
working_directory
symlink'd fol के लिए सेट है/var/local/project/project.d/[id]
फ़ोल्डर में- सिमलिंक अंक der सही ढंग से
- हम
USR2
संकेत
हम क्या याद आती थी भेजने से पहले सिमलिंक अद्यतन ??