【问题标题】:Corda OS with Postgresql database带有 Postgresql 数据库的 Corda OS
【发布时间】:2021-06-06 14:00:12
【问题描述】:

Corda OS 4.7 节点无法成功创建与 PostgreSQL 数据库的连接。

按照此处的指南使用 PSQL 从此处运行 Corda 节点:- https://medium.com/corda/cordapp-database-setup-production-perspective-2c400e60fae5

该指南似乎已过时,因为从 4.7 操作系统版本开始不支持许多数据库配置。

忽略 Corda 节点会出现以下错误:-

...
Certificate signing request approved, storing private key with the certificate chain.
Private key 'cordaclientca' and its certificate-chain stored successfully.
Generating SSL certificate for node messaging service.
SSL private key and certificate chain stored in /opt/corda/certificates/sslkeystore.jks.
Generating trust store for corda node.
Node trust store stored in /opt/corda/certificates/truststore.jks.
Generating node identity certificate.
Node identity private key and certificate chain stored in identity-private-key.
Running database schema migration scripts ...
[ERROR] 14:04:07+0000 [main] internal.NodeStartupLogging. - Exception during node registration: Could not find the database driver class. Please add it to the 'drivers' folder.
[ERROR] 14:04:07+0000 [main] internal.NodeStartupLogging. - Could not find the database driver class. Please add it to the drivers directory. [Error Code: database-missing-driver For further information, please go to https://docs.corda.net/docs/corda-os/4.7/error-codes.html]

   ______               __
  / ____/     _________/ /___ _
 / /     __  / ___/ __  / __ `/         Computers are useless. They can only
/ /___  /_/ / /  / /_/ / /_/ /          give you answers.  -- Picasso
\____/     /_/   \__,_/\__,_/

--- Corda Open Source 4.7 (75618ca) -------------------------------------------------------------


Logs can be found in                    : /opt/corda/logs
Running database schema migration scripts ...
[ERROR] 14:04:16+0000 [main] internal.NodeStartupLogging. - Could not find the database driver class. Please add it to the drivers directory. [Error Code: database-missing-driver For further information, please go to https://docs.corda.net/docs/corda-os/4.7/error-codes.html

以下是节点的配置文件:-

p2pAddress = "127.0.0.1:10002"
rpcSettings {
    address: "0.0.0.0:10003"
    adminAddress: "0.0.0.0:10004"
    useSsl: true
    ssl {
        keyStorePath: "/opt/corda/certificates/sslkeystore.jks"
        keyStorePassword: "spass1"
    }
}
emailAddress = "xxxxxxx"
myLegalName = "O=XXXX,L=London,C=GB" 
keyStorePassword = "kpass1"
trustStorePassword = "trustpass"
devMode = false
rpcUsers= [
    {
        user=corda
        password=portal_password
        permissions=[
            ALL
        ]
    }
]
networkServices {
    doormanURL="http://xxxxxx"
    networkMapURL="http://xxxxx"    
}
custom { jvmArgs = [ "-Xmx2048m", "-XX:+UseG1GC" ] }
dataSourceProperties {
    dataSource {
        password="my_password"
        url="jdbc:postgresql://localhost:5432/postgres?currentSchema=party_a_schema"
        user="party_a"
    }
    dataSourceClassName="org.postgresql.ds.PGSimpleDataSource"
}
#database { 
   #transactionIsolationLevel=READ_COMMITTED
   #schema="party_a_schema"
   #runMigration=false
#}
# When JDBC driver is not present into the node's 'drivers' directory then add absolute path:
jarDirs = ['/opt/corda/node1/drivers']
sshd {
    port = 2222
}

database 的所有不受支持的变量都被注释掉,scheme 仅添加到 URL 字符串中,而我看到 transactionIsolationLevel 从那时起就在节点内部进行了硬编码。这可能是什么原因?

【问题讨论】:

  • PSQL 的驱动程序在哪里?

标签: postgresql jdbc corda


【解决方案1】:

错误消息表明缺少数据库驱动程序。请确保您在链接的文章中提到的“驱动程序”目录中有适当的 jar 文件。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-06-30
    • 2020-12-09
    • 2023-03-11
    • 2018-07-03
    • 1970-01-01
    • 2014-08-14
    相关资源
    最近更新 更多