gpt4 book ai didi

java - OrientDB在启动时自动创建数据库

转载 作者:行者123 更新时间:2023-12-02 04:35:06 28 4
gpt4 key购买 nike

我正在尝试设置一个分布式 OrientDB 集群(使用 Docker),以便它自动从配置文件创建数据库。在我的 orientdb-server-config.xml 文件中,我指定了以下存储:

...
<storages>
<!-- our testing database -->
<storage name="testing" path="plocal:/var/orientdb/databases/testing"
userName="admin" userPassword="admin"
loaded-at-startup="true" />
<!-- our development instance database -->
<storage name="dev" path="plocal:/var/orientdb/databases/dev"
userName="admin" userPassword="alongpassword"
loaded-at-startup="true" />
<!-- our production instance database -->
<storage name="prod" path="plocal:/var/orientdb/databases/prod"
userName="admin" userPassword="alongpassword"
loaded-at-startup="true" />
</storages>
...
<properties>
...
<entry name="server.database.path" value="/var/orientdb/databases" />
...
</properties>

OrientDB 在启动时 (dserver.sh) 出现以下异常:

Caused by: com.orientechnologies.orient.core.exception.OStorageException: Cannot open the storage 'testing' because it does not exist in path: /var/orientdb/databases/testing
at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.open(OAbstractPaginatedStorage.java:164)
... 11 more

我真的不想手动创建这些数据库 - OrientDB 是否支持自动为我创建这些数据库的方法?我只希望它在数据库尚不存在时创建数据库,因此拥有一个从命令行自动执行此操作的脚本并不是真正的选择。

我现在唯一的选择是通过控制台手动创建数据库,或通过我的应用程序以编程方式创建数据库 - 由于各种原因,我试图避免这两种情况。

来自OrientDB code ,似乎它应该为我创建这些数据库。这可能是一个错误,还是我在这里遗漏了一些东西?

最佳答案

向 OrientDB 贡献了一个补丁来修复此问题:https://github.com/orientechnologies/orientdb/pull/4400

关于java - OrientDB在启动时自动创建数据库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30934721/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com