481 words

Replicated cluster recovery

#1
2011-04-08 16:07

If I create a replicated database cluster as per http://www.objectdb.com/java/jpa/tool/replication what is the behaviour of the master database after a failure?

For example, say I have MasterDB and SlaveDB in the cluster. If MasterDB goes offline the application will automatically switch to SlaveDB. When MasterDB comes back online it will have missed any activity that occured during the downtime.

What is the best way to resolve this? Copying SlaveDB would be an option put presumably this would be a manual task and the application would need to be halted during the copy otherwise further updates would be missed.

Ideally the SlaveDB would become the new master when MasterDB goes offline and then MasterDB would become a slave when it comes back online. Or something similar...

Let me know if that doesnt make sense and I'll explain better. Also let me know if I've misunderstood anything and this functionality (or similar) is currently available.

Thanks!

felixobjectdb
felixobjectdb's picture
Joined on 2011-02-10
User Post #5
#2
2011-04-08 16:23

Currently the slave servers are limited to read only (it is indicated at the beginning of the page but probably has to be emphasised).

Your idea of switching the master and slave is good but has some difficulties. For example, in case the master fails before it completes transferring all the committed updates to the slave.

There are solutions that enable full cluster even with the ability to write and read to any node (and maybe such a solution will be included in a future version of ObjectDB) - but they are much slower than a simple master-slave replication.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
support
support's picture
Joined on 2010-05-03
User Post #192
#3
2011-07-21 14:10

hi

Is it means that when master goes down application can only reads data? And the second question: on which level switching between  nodes is done, persistent managers could switch to another node or they are bound to one node and after connection problem application must create new PM via PMF?

 

br

Tomasz

Tomasz
Tomasz's picture
Joined on 2011-07-11
User Post #13
#4
2011-07-21 23:39

> Is it means that when master goes down application can only reads data?

Yes.

> On which level switching between  nodes is done, persistent managers could switch to another node or they are bound to one node and after connection problem application must create new PM via PMF?

Switching is automatic - between a main url and backup urls, which may also reference databases on different nodes.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
support
support's picture
Joined on 2010-05-03
User Post #466
#5
2011-07-22 08:40

Hi

I wanted test cluster so I ran 4 threads 2 for writing and two 2 reading data but all hangs up on geting PersistenceManager from the PMF, without cluter it works fine. I had similar situation in JPA API but it was corrected: http://www.objectdb.com/database/support/151

 

hare is the connection url:

javax.jdo.option.ConnectionURL=objectdb://localhost:6000/test.odb;user=admin;password=admin|objectdb://localhost:6001/localhost:6000/test.odb;user=admin;password=admin

 

and thread stack dump:

SocketInputStream.socketRead0(FileDescriptor, byte[], int, int, int) line: not available [native method]
SocketInputStream.read(byte[], int, int) line: 129
BufferedInputStream.fill() line: 218
BufferedInputStream.read1(byte[], int, int) line: 258
BufferedInputStream.read(byte[], int, int) line: 317
CST(NTS).z(int, int) line: 314
CST(NTS).y() line: 274
CST(CLS).R() line: 327
CST(CLS).P() line: 274
CST.UA(int) line: 283
TYM.ac(boolean, String, Object) line: 472
TYM.<init>(TSR, ClassLoader, SCM, PersistenceUnitInfo, String, ERR, boolean) line: 232
PMF(OMF).ai(String, String) line: 730
PMF(OMF).ah(String, String) line: 681
PMF.getPersistenceManager() line: 547
ObjectDbTests.testDbProvisioning() line: 290
ObjectDbTests.testAll(int, Properties) line: 46
ObjectDbTests$1.run() line: 117
Thread.run() line: 662

br

Tomasz

Tomasz
Tomasz's picture
Joined on 2011-07-11
User Post #14
#6
2011-07-24 01:37

Please produce and post stack traces of all the running threads.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
support
support's picture
Joined on 2010-05-03
User Post #474

Post Reply

Please read carefully the posting instructions - before posting to the ObjectDB website.

  • You may have to disable pop up blocking in order to use the toolbar (e.g. in Chrome).
  • Use ctrl + right click to open the browser context menu in the editing area (e.g. for using a browser spell checker).
  • To insert formatted lines (e.g. Java code, stack trace) - select a style in the toolbar and then insert the text in the new created block.
  • Avoid overflow of published source code examples by breaking long lines.
  • You may mark in paragraph code words (e.g. class names) with the code style (can be applied by ctrl + D).
  • Long stack traces (> 50 lines) and complex source examples (> 100 lines) should be posted as attachments.
Attachments:
Maximum file size: 32 MB
Cancel