Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to restart individual servers in thin cluster in rails 3.1 app

I have a thin cluster set up to start 3 servers:

/etc/thin/myapp.yml

...
wait: 30
servers: 3
daemonize: true
...

and the I use thin restart -C /etc/thin/myapp.yml to restart. However, I would like to restart each server at a time, to reduce downtime.

Is there a way to restart each server by pid number or location for example?

like image 426
deb Avatar asked Oct 20 '11 20:10

deb


2 Answers

There is something better for you try option: --onebyone

you may also add the following line to your config file

onebyone: true

afterwards you able to restart you thin cluster without any downtime.

like image 98
sarvavijJana Avatar answered Nov 04 '22 23:11

sarvavijJana


I know the question has been answered, but I'd like to add the -o option to the mix.

So

thin restart -C /etc/thin/myapp.yml -o 3000

Will only start the server running on port 3000. If let's say you have two other servers running on 3001 and 3002, they'll be left untouched.

-o works with start and stop commands too.

like image 7
Coffee Bite Avatar answered Nov 04 '22 22:11

Coffee Bite