user1107922
user1107922

Reputation: 610

Capistrano deploy on more than one machine

I would like to deploy my rails application. I have one machine with nginx, two web servers and one which I use as a database server. Unfortunately when I reach deploy:migrate, it doesn't work because capistrano try to find the directory of the rails application "/home/user/apps/MyApp/releases/20141218160125" on my database server machine. I don't want to have a rails app there. I would like to use this machine only as database server.Should I upload my rails app there too, but not to use it in my nginx configuration? Is it possible to do it more clear - just as a database server and the code of the application to be on the machines which are used as application servers? Thanks!

Upvotes: 1

Views: 88

Answers (1)

Philip Hallstrom
Philip Hallstrom

Reputation: 19879

Exclude your database server entirely from capistrano. There's no need to deploy anything to it.

Your config/database.yml is configured to connect to the database already since your web servers have to talk to the database during normal operations.

All you need to do is assign the db capistrano role to one of the web servers. Here's what my config looks like. The database is on another server entirely.

server 'carnoustie.supremegolf.com', user: 'carl',    roles: %w{db web}
server 'standrews.supremegolf.com',  user: 'carl',    roles: %w{web}

Upvotes: 1

Related Questions