I want to have a separate instance for running Sidekiq in my production environment.
Currently I have db
, web
and app
instances and the app
instance is taking care of sidekiq which is proving to be a wrong move.
I created a new instance with roles redis
, redis_master
and sidekiq
but then when I SSH into it there is nothing running and if I do a cap deploy
to it, during bundle install
it says "dotenv" is only for instances with role app
and it rolled back.
How do I set things up? Do I need to add app role to the Sidekiq instance for it to work?
EDIT: Okay I've made it work by adding the app
role to instance running sidekiq
. Also I removed the passenger
and apache
roles from it manually so it does not start an app server. The only problem Im facing now is the fact that rubber
is not automatically starting and stopping and restarting sidekiq
during deploys. Need to figure that out.
Looking good though.
Are these ansible roles?
I'd recommend setting up a rails and ruby role (separately) in your ansible playbook, run the playbook in your new sidekiq-prod instance, then do a cap prod deploy
If you are using a rails app with capistrano to do your sidekiq deploys, you can access the rails env in your setup of lib/capistrano/tasks/sidekiq.cap
:
export RAILS_ENV=<%= fetch(:rails_env) %>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.