I am creating a cluster following the steps required. When I start the 
second node, I get the above error message. I've went ahead and debugged 
the code and it seems the backup.sql file gets created in the source 
directory and when the target wants to execute it, it would obviously not 
be found. What am I doing wrong?

I should mention I am running two servers on the same host using two 
different directories and ports. Pretty much the same as the unit test 
(TestCluster) does. There seems to be a switch of directories when the 
backup.sql file is written. The JDBC URL I am using contains no path. I 
would expect the file will be written to the same directory the database 
resides on.


<https://github.com/h2database/h2database/issues/344#issuecomment-243265609> 

I think I've narrowed it to this area of the code in 
CreateCluster.process(). It seems that the backup file which gets created 
in the context of the source node, is attempted to be executed in the 
context of the target node. Assuming two different computers, or even just 
different directories, this will not work. script file needs to be copied 
or created in the context of the target node. I've also verified this by 
manually copying the created backup file just before it is attempted to be 
applied and that works.

I am blocked as there is no workaround. Would appreciate any advise or 
workaround.

            // backup
            Script script = new Script();
            script.setOut(out);
            Script.process(connSource, scriptFile, "", "");

            // delete the target database and then restore
            connTarget = DriverManager.getConnection(
                    urlTarget + ";CLUSTER=''", user, password);
            statTarget = connTarget.createStatement();
            statTarget.execute("DROP ALL OBJECTS DELETE FILES");
            connTarget.close();

            RunScript runScript = new RunScript();
            runScript.setOut(out);
            runScript.process(urlTarget, user, password, scriptFile, null, 
false);


*Also created issue in github. 
https://github.com/h2database/h2database/issues/344*

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to