使用k8s部署Corda网络时遇到的问题。Node无法连接到外部DB。 数据库容器已启动并正在运行。下面是配置
Node.conf
dataSourceProperties {
dataSourceClassName = "org.postgresql.ds.PGSimpleDataSource"
dataSource {
url = "jdbc:postgresql://xx.xx.xx.xx:5432/notarydb"
user = user1
password = "test"
}
}
database {
transactionIsolationLevel=READ_COMMITTED
initialiseSchema=true
runMigration=true
}
错误
[ERROR] 17:56:26+0530 [main] postgresql.Driver. - Connection error: [errorCode=zmhrwq, moreInformationAt=https://errors.corda.net/ENT/4.4/zmhrwq]
[ERROR] 17:56:26+0530 [main] common.BaseDataSource. - Failed to create a Non-Pooling DataSource from PostgreSQL JDBC Driver 42.1.4 for admin at jdbc:postgresql://1xx.xx.xx.xx:5432/notarydb?prepareThreshold=5&preparedStatementCacheQueries=256&preparedStatementCacheSizeMiB=5&databaseMetadataCacheFields=65536&databaseMetadataCacheFieldsMiB=5&defaultRowFetchSize=0&binaryTransfer=true&readOnly=false&binaryTransferEnable=&binaryTransferDisable=&unknownLength=2147483647&logUnclosedConnections=false&disableColumnSanitiser=false&tcpKeepAlive=false&loginTimeout=30&connectTimeout=10&socketTimeout=0&cancelSignalTimeout=10&receiveBufferSize=-1&sendBufferSize=-1&ApplicationName=PostgreSQL JDBC Driver&useSpnego=false&gsslib=auto&sspiServiceClass=POSTGRES&allowEncodingChanges=false&targetServerType=any&loadBalanceHosts=false&hostRecheckSeconds=10&preferQueryMode=extended&autosave=never&reWriteBatchedInserts=false: org.postgresql.util.PSQLException: The connection attempt failed.
[ERROR] 17:56:26+0530 [main] pool.HikariPool. - HikariPool-1 - Exception during pool initialization. [errorCode=zmhrwq, moreInformationAt=https://errors.corda.net/ENT/4.4/zmhrwq]
[ERROR] 17:56:26+0530 [main] internal.NodeStartupLogging. - Exception during node registration: Could not connect to the database. Please check your JDBC connection URL, or the connectivity to the database. [errorCode=18t70u2, moreInformationAt=https://errors.corda.net/ENT/4.4/18t70u2]
[ERROR] 17:56:26+0530 [main] internal.NodeStartupLogging. - Could not connect to the database. Please check your JDBC connection URL, or the connectivity to the database.
答案 0 :(得分:0)
以下内容已经讨论
很少提出建议
他们尝试了上述建议,但仍然需要40秒左右,然后再给出sockettimeoutexception超时。 他们甚至尝试增加超时时间,例如jdbc:postgresql://10.96.0.50:5432 / partyadb?loginTimeout = 60000&connectTimeout = 60000&socketTimeout = 60000&cancelSignalTimeout = 1200,但还是没有运气。
我们的结论
如果仅需要4-5秒钟即可与VM通信-corda将永远无法正常工作。 这是他们Kubernetes部署的问题,我们无能为力。如果要花费40秒的时间来ping,则与corda无关。
答案 1 :(得分:0)
在我们的例子中,我们在同一台VM上运行corda节点和DB,节点使用NodePort,而DB使用ClusterIP。这是混合设置,其中由于NodePort和ClusterIP的混合,集群中的容器需要时间来定位地址