See: Description
| Class | Description |
|---|---|
| Ha |
Main class for the HA cluster management.
|
| HaStatus |
This class represents a status for a HA node in a HA cluster.
|
| Enum | Description |
|---|---|
| HaOrderType |
enum for the different HA cluster protocol operations Used internally by the
api.
|
| HaStateType |
This enum describes the different states a HA node can be in.
|
| Exception | Description |
|---|---|
| HaException |
Exception for the HA handling
|
Example: We set up three nodes in a HA cluster set one as master and the other two as slaves and afterwards check their state.
Socket s0 = new Socket("localhost", 4565);
Socket s1 = new Socket("localhost", 4575);
Socket s2 = new Socket("localhost", 4585);
Ha ha0 = new Ha(s0, "clus0");
Ha ha1 = new Ha(s1, "clus0");
Ha ha2 = new Ha(s2, "clus0");
ConfHaNode master =
new ConfHaNode(new ConfBuf("node0"),
new ConfIPv4(InetAddress.getByName("localhost")));
ha0.beMaster(master.nodeid);
Thread.sleep(500);
ha1.beSlave(new ConfBuf("node1"), master, true);
Thread.sleep(500);
ha2.beSlave(new ConfBuf("node2"), master, true);
Thread.sleep(500);
HaStatus status0 = ha0.status();
HaStatus status1 = ha1.status();
HaStatus status2 = ha2.status();