Alan Burlison <[email protected]> writes: > I'm having an incredible struggle getting Derby replication to work - > in fact, I can't get it to work at all. The problem seems to be > centred around the use of user authentication in conjunction with > replication, and when trying to start the slave across the network > rather than locally. > > For startSlave the documentation on says: > > "If authentication or authorization is turned on, you must also > specify this attribute in conjunction with the user=userName and > password=userPassword attributes. If authorization is turned on, the > user must be the database owner." > > The example given is: > > -- start slave using database name in subprotocol, default slave host > -- and port, authorization > jdbc:derby:myDB;startslave=true;user=mary;password=little88lamb > > So the parameters I'm using for the connect() call are: > > DB URL: jdbc:derby://localhost:1528/opensolaris > Properties: {user=admin, password=admin, securityMechanism=8, > startSlave=true, slaveHost=localhost} > > and then I get the following exception: > > DERBY SQL error: SQLCODE: -1, SQLSTATE: XRE09, SQLERRMC: Cannot start > replication slave mode for database 'opensolaris'. The database has > already been booted. [XRE09] > > And the database absolutely *isn't* already booted - I'm starting the > database up just before I run the above connect(), and all I see in > the log file is the normal network server startup message: > > Apache Derby Network Server - 10.5.1.1 - (764942) started and ready to > accept connections on port 1528 > > in derby.log, and if I single step through the debugger I seen nothing > else in the log until I step over the connect() call, at which point I > see the exception above appear in the log file. > > Does replication actually work at all in my scenario?
Hi Alan, I think it should work, at least it did when I tested it in what I think is a similar scenario. See the attached script which creates a database with authentication and authorization enabled, starts slave and master servers, and performs failover. Are you running the network server in a separate process, or is it embedded inside another Java process? If the latter, it may be that the database has already been booted when the server is started. -- Knut Anders
replication.sh
Description: Bourne shell script
