Hi Peter,
Usually test1 and test2 are machine domain names. (In your setup, local
zone domain names I'd guess).
So when you specify "test1,test2", hadb's node-1 will be placed on test1
and node-2 will be placed on test2.
If you specify "test1,test2,test1,test2", node-3 will be placed on test1
and node-4 will be placed on test2 in addition, i.e. 2 nodes running on
each server.
An hadb node is a set of processes, shared memory and some disk device
files for data and log, accessed by the processes. So if you place two
nodes on a server, you'll see 2 nsups running (so are the other
processes). So you can add hadb nodes to a server, as long as, there is
enough resources (mem, disk, cpu, network) to handle peak time load.
If you have 4 servers, you can specify "test1,test2,test3,test4". In
that case, each machine will get one hadb node, or
"test1,test2,test3,test4,test1,test2,test3,test4", where each machine
will get 2 nodes.
When a user-table is created, by default, each node will get one
partition of that table. In addition, the pair (or mirror) node gets the
replica of the partition. That means, there are two copies of the data
on the system. When one node or machine goes down, its mirror node (on
another machine) will take over and continue servicing the transactions.
This ensures availability, despite node or machine failures. The pairs
are formed in the order specified:
Eg: "test1,test2":
test1: node-1
test2: node-2
pairs/mirrors (node-1, node-2)
Eg. "test1,test2,test3,test4":
test1: node-1
test2: node-2
test3: node-3
test4: node-4
mirrors: (node-1, node-2), (node-3, node-4)
Eg. "test1,test2,test1,test2":
test1: node-1
test2: node-2
test1: node-3
test2: node-4
mirrors: (node-1, node-2), (node-3, node-4)
To ensure availability, hadb does not allow "test1,test1" where both
copies of the data will be placed on the same machine (neither
"test1,test1,test2,test2").
In addition, comes a spare node concept: a spare node takes over in case
one node of a pair is down for more than a timeout period ( a minute or
so - configurable). Spare nodes ensure two copies. I do not think that
this is used in asadmin scripts or appserver context.
I'm not sure about what you mean by uni-, bi-direction. See whether this
helps:
Each node serves transactions independently. If a transaction updates a
piece of data (eg a record of a table), it will not commit untill both
copies of this record placed on two machines are being updated.
On 01/05/11 08:17 AM, Peter L. Gratzer wrote:
> Maitrayi, Shreedhar,
>
> Thank you both for this excellent insight into HADB !! This is very helpful to my current project.
>
> As I am also progressing to a horizontal scaled solution solution a few more related question came to mind:
>
> - examples using asadmin with the configure-ha-cluster directive always show a two node cluster i.e. test1 and test 2. In some cases
> the hosts parameter has "test1, test2" specified, in others "test1,test2,test1,test2". As I would see that a pair represents one connection
> for distributing the data, is the connection bi-directional or do you have to specify the nodes twice aka is it uni-directional ? Is the order
> in a uni-directional case correct, that you would specify "test1, test2, test1, test2" ?
> - in a configuration of more than two nodes I have not found any documentation regarding the setup of an HADB database.
> Can you provide a guideline for a 2+ configuration on how nodes are specified using asadmin with the configure-ha-cluster directive ?
>
> Thanks again in advance,
>
> Peter
>
> PS: Sorry,
--
*** Maitrayi ***