H2 Database Cluster Recovery -
i have got springmvc application runs on apache tomcat , uses h2 database. infrastructure contains 2 application servers (lets name them & b) running own tomcat servers. have h2 database clustering in place.
on 1 system (a) ran following command
java org.h2.tools.server -tcp -tcpport 9101 -tcpallowothers -basedir server1
on other (b) ran
java org.h2.tools.server -tcp -tcpport 9101 -tcpallowothers -basedir server2
i started cluster in machine a
java org.h2.tools.createcluster -urlsource jdbc:h2:tcp://ipaddrofa:9101/~/test -urltarget jdbc:h2:tcp://ipaddrofb:9101/~/test -user sa -serverlist ipaddrofa:9101,ipaddrofb:9101
when 1 of server down, has been mentioned that, 1 has delete database failed, restart server , rerun createcluster.
i have following questions ?
- if both servers down, how can ascertain, database delete can restart server , rerun cluster ?
- createcluster contains urlsource , urltarget. need specific give them same value given or can interchange them without side effect ?
- do need run createcluster command both machines? if so, need interchange urlsource , urltarget ?
- is there way know whether both, 1 or none of servers running ? want both ipaddress returned if both of them up, 1 ipaddress if 1 otherwise none down.
if both servers down, how can ascertain, database delete
the idea of cluster second database adds redundancy system. let's assume server fails 1 every 100 days (hard disk failure, power failure or so). 99% availability. might not enough you, that's why may want use cluster 2 servers. way, if 1 of server fails every 100 days, chance of both failing @ same time very low. ideally, risk of failure independent. mean risk of both failing @ exact same time 1 in 10000 (100 times 100), giving 99.99% availability. risk both servers down cluster feature should prevent.
createcluster contains urlsource , urltarget. need specific give them same value previously
it depends 1 want use source , 1 target. database source copied target. source database want copy target.
do need run createcluster command both machines?
no.
is there way know whether both, 1 or none of servers running ?
you try open tcp/ip connection them, check if listener running. running
telnet <server> <port>
on command line.
Comments
Post a Comment