我正在尝试以这样的方式设置分布式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开始,似乎应该为我创建这些数据库。这可能是一个错误,还是我在这里遗漏了什么?