I have a question about HAST's master slave setup.

I'm reading the HAST wiki, and I have a question about it.

Lets say I have two servers, hast[a] and hast. hast[a] is the master server. But suddenly hast[a] dies.

What happens now?
Do hast become the master server? If so, when hast[a] goes online, is hast still the master server?

Or does it work in another way?
 
There's only 1 master and 1 slave in a HAST setup. It never changes.

When the master goes offline, the slave takes over (what happens and how depends on the scripts you have configured). When the master comes back online, it notifies the slave, syncs the data from the slave, and takes over.

If you have two servers marked as master, you end up with a split-brain situation that is (fairly) hard to fix (not impossible).

How it works really depends on the scripts you put in place to manage the switch (ucarp, carp+devd, etc).
 
Note: I quickly skimmed through it.

As I read it the active node is the master. So if hast[a] is the active one and hast the backup when hast[a] fails hast will become the active node. Since the active node is the primary or master, hast will become primary/master. When hast[a] comes back online it will assume the role of secondary/backup. Perhaps one of the scripts will switch the primary role back to hast[a], I didn't look close enough.

HAST is not responsible for selecting node's role (primary or secondary). Node's role has to be configured by an administrator of other software like heartbeat or ucarp using hastctl(8) utility.
 
Back
Top