Thanks! I am building some "proof-of-concept" for now, so the exact process 
of DB creation is not so important - will figure it out later, now just 
need to make it work. That is why I run it as root - just to get some 
prototype working, will polish all permissions later.

But I am still not able to connect the application to the cluster. Cluster 
is running, all settings are as in examples, I can connect from UI or 
shell, but cannot connect from the application:

hibernate.connection.driver=org.h2.Driver
hibernate.connection.url=jdbc:h2:tcp://10.59.1.214:9092,10.59.1.215:9092/~/test
hibernate.connection.user=sa
hibernate.connection.password=sa
hibernate.dialect=org.hibernate.dialect.H2Dialect
hibernate.hbm2ddl.auto=update
hibernate.show_sql=true


Am I missing something?
Log file says that the DB is in the cluster mode:

Environment - HHH000205: Loaded properties from resource 
hibernate.properties: {hibernate.connection.password=****, 
hibernate.connection.driver=org.h2.Driver, 
hibernate.dialect=org.hibernate.dialect.H2Dialect, hibernate.show_sql=true, 
hibernate.connection.user=sa, 
hibernate.connection.url=jdbc:h2:tcp://10.59.1.214:9092,10.59.1.215:9092/~/test,
 
hibernate.bytecode.use_reflection_optimizer=false, 
hibernate.hbm2ddl.auto=update}

Version - HCANN000001: Hibernate Commons Annotations {5.0.1.Final}

JdbcEnvironmentInitiator - HHH000342: Could not obtain connection to query 
metadata : Clustering error - database currently runs in cluster mode, 
server list: "'10.59.1.214:9092,10.59.1.215:9092'" [90094-198]

Dialect - HHH000400: Using dialect: org.hibernate.dialect.H2Dialect

LobCreatorBuilderImpl - HHH000422: Disabling contextual LOB creation as 
connection was null

Version - HV000001: Hibernate Validator 5.1.3.Final

SqlExceptionHelper - SQL Error: 90094, SQLState: 90094

SqlExceptionHelper - Clustering error - database currently runs in cluster 
mode, server list: "'10.59.1.214:9092,10.59.1.215:9092'" [90094-198]

The same code works fine if I run H2 in non-cluster mode and change the 
connection URL correspondingly.

--
    Thanks,
    Artem

On Wednesday, March 6, 2019 at 8:58:34 PM UTC-8, Evgenij Ryazanov wrote:
>
> Hello.
>
> You need to add -ifNotExists option to your TCP Servers to allow remote 
> creation of databases.
>
> Note that this option creates a security hole in your system unless your 
> servers are protected with a firewall or some other solution from 
> unauthorized access, so use it with caution and do not enable it when it is 
> not needed any more.
>

-- 
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