Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cuncurrent access to the same "home/data/find-db.h2.db" from two-or-more find installations #69

Open
ciroppina opened this issue Nov 30, 2021 · 6 comments

Comments

@ciroppina
Copy link

ciroppina commented Nov 30, 2021

Hello dears,

I have two (balanced) Find istallations (two Windows virtual machines) and I need to share "home/data/find-db.h2.db" data file among the two, in order all users could see their saved & shared searchs, whatever Find they access (thru a round-robin "balancer")
Users cannot choose which Find to work with; it's the balancer task

Is there a way? Or, does Find configuration let me use a different database, where to store users searches?
NOTICE: Find 12.1.0 (core and idol components) running with 64bit openjdk 1.8

@joseph-lansdowne-opentext
Copy link
Contributor

There's no support for an external database.

You should be able to do it by making sure the data directory can be accessed on both machines (maybe using a network share), and make a change in webapp/idol/src/main/resources/application.properties:

spring.datasource.url=jdbc:h2:file:${idol.find.home:${hp.find.home:}}/data/find-db;DB_CLOSE_ON_EXIT=FALSE;AUTO_SERVER=TRUE

If you do this I think you need to recreate the database from scratch.

@ciroppina
Copy link
Author

Hi,
I tried as You suggested, but I got:
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[TomcatAccessFileAppender] - openFile(F:/IDOLServer-12.7.0/find/home//logs/tomcat-access.log,true) call failed. java.io.FileNotFoundException: F:\IDOLServer-12.7.0\find\home\logs\tomcat-access.log (The system cannot find the path specified)

against the log files of the shares home dir
attached my configuration find.xml file

find.xml:

<service>
    <id>MF-Find-Arianna</id>
    <name>MF-Find-Arianna</name>
    <description>MF-Find-Arianna</description>
    <executable>java</executable>
    <arguments>-Didol.user.request.prefix=Find -Didol.find.home="F:/IDOLServer-12.7.0/find/home/" -Dserver.port=8080 -Dspring.config.location=classpath:application.properties,classpath:custom-application.properties -jar "C:/MicroFocus/IDOLServer-12.7.0/find/arianna.war"</arguments>
	<logmode>rotate</logmode>
</service>

@joseph-lansdowne-opentext
Copy link
Contributor

I wouldn't suggest sharing the whole home directory, just the data directory. Also you'll need write access to the shared files.

@ciroppina
Copy link
Author

ciroppina commented Dec 6, 2021

Dear Joseph,
I will let You know if I solved this issue by defining a new Java -D param: "-Didol.find.dat.dir"

@ciroppina
Copy link
Author

I tried to configure the path_to_db in one my 2 Find Instalations, by setting this paramenter in the find.xml file:
-Didol.find.shared.data="\\[computer name]\c$\MicroFocus\IDOLServer-12.7.0\find\home\data"
OR
-Didol.find.shared.data="file://[computer name]/c$/MicroFocus/IDOLServer-12.7.0/find/home/data"
OR
-Didol.find.shared.data="//[computer name]/c$/MicroFocus/IDOLServer-12.7.0/find/home/data"
OR
-Didol.find.shared.data="F:/find/home/data"

and by using the param "idol.find.shared.data" in the Spring "application.properties" file, of the idol module, in this way:
spring.datasource.url=jdbc:h2:file:${idol.find.shared.data}/find-db;DB_CLOSE_ON_EXIT=FALSE;AUTO_SERVER=TRUE

But with all theese tries I always get:
JdbcSQLException: Error while creating file "//"
OR
JdbcSQLException: Error while creating file "F:/"

The (first Find instalation) Windows directory is fully shared for IO access in R/W to "Everyone"

@ciroppina
Copy link
Author

Issue Advance: a h2 based db cannot be loaded/read/written from/to a shared filesystem location;
so I can only share the "find-db.h2.db" data file between two Find installation on the same Server (or same virtual machine)
But my goal is to be able to use 2 vm (for fault tolerance and load balancing)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants