Hello,
I'm doing a deployment with staging. I have a development machine
where app, web and db server are the same it's done and works very well
:) In other side I have:
- 1 db server called db
- 2 app servers called web1 and web2
- webservers in app server.
I need multiples instancies of one rails application in two app
servers. The big problem is generate mongrel_cluster yaml file and hand
mongrel. for example:
Instance 1 need 4 mongrel_cluster in web1 and 3 + 1 in web2 (one
separated in web2, dedicated for administrator)
Instance 2 need 3+1 mongrel_cluster in web1 and 4 in web2 (one
separated in web1, dedicated for administrator)
Instance 3 need 3+1 mongrel_cluster in web1 and 4 in web2 (one
separated in web1 , dedicated for administrator)
Instance 4 need 4 mongrel_cluster in web1 and 3 + 1 in web2 (one
separated in web2, dedicated for administrator)
... (until the infinite) :)
I set roles for it in every stage:
role :app, "web1"
role :app, "web2", :admin => true
role :web, "web1","web2"
role :db, "db", :primary => true
For generate a mongrel_cluster.yml in simple case I used this tasks:
desc "Create mongrel_cluster yaml in shared path"
task :mongrel_cluster_yml do
template = File.read(File.join(File.dirname(__FILE__),
"deploy/templates", "mongrel_cluster.erb"))
result = ERB.new(template).result(binding)
run "mkdir -p #{shared_path}/config"
put result, "#{shared_path}/config/mongrel_cluster.yml"
end
desc "Make symlink for mongrel_cluster yaml"
task :symlink_mongrel_cluster_yml do
run "ln -nfs #{shared_path}/config/mongrel_cluster.yml
#{release_path}/config/mongrel_cluster.yml"
end
Variables used in template:
set :mongrel_port, 3000
set :mongrel_servers, 1
set :mongrel_username, user # Change if user is diffent to shell user
set :mongrel_group, user # Change if group is different to shell
group
But now, how I can create a mongrel_cluster file (or files if has
:admin attribute) for every stage in different servers? A little help
please :)
Regards,
PS: Sorry for my english
--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---