Anyone made a High Availablility Setup for TeamCity?
Basically, I'm thinking of this:
- Image at least 2 hosts with a working TC master image, both configured in a "deactivated" state (what's the best way to do that?).
- Run a daemon using the following pseudocode:
loop {
rsync();
if (master()) {
activate();
} else {
deactivate();
}
sleep();
}
- The idea is to replicate the data store via rsync, and test via DNS whether we are the active master or a slave, and reconfigure teamcity accordingly.
Has anyone implemented such a scheme? Is it even sound?
Please sign in to leave a comment.
I understand passive node as an instance where TeamCity process is not running, and specifically - it does not modify data directory and SQL.
RSync would work, but it doesn't guarantie 100% data safety. Consider an example:
In such case latest changes are lost, because they are not copied to passive node before failover.
Usually it's solved by putting data directory on RAID storage shared between cluster nodes.
Also, is your SQL DB clustered?
So the reason I prefer rsync over a shared cluster or mirroring is for two reasons:
The downside is indeed that in case of a failure, there might be data loss for any transaction that happened between the last rsync and the failure. I'm not sure how you would provide a save for that even on a shared storage...
So I think that we're going to try a solution that uses a combination of LVM snapshots and rsync. Quiesce Teamcity, take lvm snapshot, restart Teamcity, rsync to standby, remove snapshot, repeat.
So two questions: