How to restart individual servers in thin cluster in rails 3.1 app
Asked Answered
H

2

6

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?

Hircine answered 20/10, 2011 at 20:10 Comment(0)
S
12

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.

Sanctimony answered 20/10, 2011 at 20:14 Comment(1)
works great, thank you. Another thing is you might want to increase the wait: 30 time if your server takes longer than that to start.Hircine
K
7

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.

Kissner answered 9/5, 2012 at 0:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.