【发布时间】:2021-09-13 03:10:35
【问题描述】:
我试图在 虚拟机 中创建 H2 和 SymmetricDS 之间的数据库连接。按照这个教程(H2-Installation),我能够安装 H2 并使用 H2 浏览器创建 store001 H2 数据库。但是,当我连接到 SymmetricDS 时,它会在连接上引发一些错误。
对称配置:
db.driver=org.h2.Driver
db.url=jdbc:h2:~/store001;AUTO_SERVER=TRUE;LOCK_TIMEOUT=60000
H2 配置(在 h2.sh 中):
java -cp "$dir/h2-1.4.200.jar:$H2DRIVERS:$CLASSPATH" org.h2.tools.Server -web -webAllowOthers -ifNotExists "$@"
H2 浏览器(设法创建 store-001):
使用 H2 jdbc 连接运行 symmetricDS 时出错:
Caused by: org.h2.jdbc.JdbcSQLException: IO Exception: "/root/store001 outside /opt/symmetric-server-3.12.10/db/h2" [90028-176]
这些是我尝试解决此问题的步骤:
- 在 h2.sh 中添加 -Dh2.baseDir=/。遵循此解决方案-> solution-example
但是在运行H2时出现这个错误:
Exception in thread "main" org.h2.jdbc.JdbcSQLFeatureNotSupportedException: Feature not supported: "-Dh2.baseDir=/" [50100-200]
- 将 H2 浏览器从
Embedded更改为Server。但在浏览器中出现此错误:
Connection is broken: "java.net.ConnectException: Connection refused (Connection refused): localhost" [90067-200] 90067/90067 (Help)
我应该怎么做才能解决这个问题?
【问题讨论】:
标签: database connection h2 symmetricds