OrientDB 在启动时自动创建数据库
OrientDB to automatically create databases on startup
我正在尝试设置分布式 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
我正在尝试设置分布式 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