OrientDB嵌入式和分布式错误:未安装分布式存储

时间:2015-10-08 13:41:38

标签: orientdb

您好,感谢您阅读此问题。我有定位数据库设置,并希望添加第二个服务器,并让它们彼此之间进行复制。当一个人自己运行它运行良好,我已经使用它几个月。启用hazelcast插件时,服务器开始通信,我可以看到它们开始相互通信。虽然他们试图互相写信时会发生错误。这是同一个问题:

https://groups.google.com/forum/#!topic/orient-database/QpZPG4y_KpU

为了它的价值,我将这两台服务器部署在同一台机器上,每台服务器都有自己的嵌入式数据库。数据库路径是plocal:/ home / chris / dbs / db2和plocal:/ home / chris / dbs / db1

2015-10-08 08:56:14:048 INFO  [db2-orient] Saving distributed configuration file for database 'db' to: ./databases/db/distributed-config.json [OHazelcastPlugin]
2015-10-08 08:56:14:049 INFO  [db2-orient] received new status idp2-orient.idp=SYNCHRONIZING [OHazelcastPlugin]
2015-10-08 08:56:18:054 WARNING [db2-orient]->[[db1-orient]] requesting deploy of database 'db' on local server... [OHazelcastPlugin]

然后在另一台服务器上,首先启动的那个,我看到了

[OHazelcastPlugin]{db=db} [db1-orient]<-[db2-orient] error on executing distributed request 0: deploy_db
com.orientechnologies.orient.server.distributed.ODistributedException: Distributed storage was not installed for database 'db'. Implementation found: com.orientechnologies.orient.core.storage.impl.local.paginated.OLocalPaginatedStorage
at com.orientechnologies.orient.server.hazelcast.OHazelcastPlugin.executeOnLocalNode(OHazelcastPlugin.java:745)
at com.orientechnologies.orient.server.hazelcast.ODistributedWorker.onMessage(ODistributedWorker.java:298)
at com.orientechnologies.orient.server.hazelcast.ODistributedWorker.run(ODistributedWorker.java:121)

我在抛出该异常的行上放置了一个断点,并且当时存在的存储类型确实是OLocalPaginatedStorage。我的orientDB版本是2.0.15。

我的分布式配置。 (两台服务器都相同)

{
"autoDeploy": true,
"hotAlignment": false,
"executionMode": "undefined",
"readQuorum": 1,
"writeQuorum": 2,
"failureAvailableNodesLessQuorum": false,
"readYourWrites": true,
"clusters": {
    "internal": {
    },
    "index": {
    },
    "*": {
        "servers" : [ "<NEW_NODE>" ]
    }
}

}

这就是我启动服务器的方式。它是嵌入式的,并通过java应用程序启动。

OServer server = OServerMain.create(true);
OPartitionedDatabasePool pool = server.startup(config.toString()).activate().getDatabasePoolFactory().get(dbPath, OUser.ADMIN, OUser.ADMIN);

服务器用于启动的配置是

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<orient-server>
<handlers>
    <handler class="com.orientechnologies.orient.server.hazelcast.OHazelcastPlugin">
        <parameters>
            <parameter name="nodeName" value="db2-orient" />
            <parameter name="enabled" value="true" />
            <parameter name="configuration.db.default" value="${orientDBConfigs}/orientdb-default-distributed-db-config.json" />
            <parameter name="configuration.hazelcast" value="${orientDBConfigs}/orientdb-hazelcast.xml" />
            <parameter name="conflict.resolver.impl" value="com.orientechnologies.orient.server.distributed.conflict.ODefaultReplicationConflictResolver" />

            <parameter name="sharding.strategy.round-robin" value="com.orientechnologies.orient.server.hazelcast.sharding.strategy.ORoundRobinPartitioninStrategy" />
        </parameters>
    </handler>
    <handler class="com.orientechnologies.orient.server.handler.OAutomaticBackup">
        <parameters>
            <parameter name="enabled" value="false" />
            <parameter name="delay" value="4h" />
            <parameter name="target.directory" value="backup" />
            <parameter name="target.fileName" value="${DBNAME}-${DATE:yyyyMMddHHmmss}.json" />
            <parameter name="db.include" value="" />
            <parameter name="db.exclude" value="" />
        </parameters>
    </handler>
    <handler class="com.orientechnologies.orient.server.plugin.mail.OMailPlugin">
        <parameters>
            <parameter name="enabled" value="false" />
            <parameter name="profile.default.mail.smtp.host" value="localhost" />
            <parameter name="profile.default.mail.smtp.port" value="25" />
            <parameter name="profile.default.mail.smtp.auth" value="true" />
            <parameter name="profile.default.mail.smtp.starttls.enable" value="true" />
            <parameter name="profile.default.mail.smtp.user" value="" />
            <parameter name="profile.default.mail.smtp.password" value="" />
            <parameter name="profile.default.mail.date.format" value="yyyy-MM-dd HH:mm:ss" />
        </parameters>
    </handler>
    <handler class="com.orientechnologies.orient.server.handler.OServerSideScriptInterpreter">
        <parameters>
            <parameter name="enabled" value="false" />
        </parameters>
    </handler>
</handlers>
<network>
    <protocols>
        <protocol name="binary" implementation="com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary" />
    </protocols>
     <listeners>
        <listener protocol="binary" ip-address="0.0.0.0" port-range="2424-2430" />

    </listeners> 
    <cluster>
    </cluster>
</network>
<storages>
    <storage name="${dbName}" path="${dbPath}" loaded-at-startup="true" />
</storages>
<users>
    <user name="root" password="root" resources="*"/>
</users>
<properties>

    <entry name="db.pool.min" value="1" />
    <entry name="db.pool.max" value="20" />

    <entry name="cache.level1.enabled" value="false" />
    <entry name="cache.level1.size" value="1000" />
    <entry name="cache.level2.enabled" value="true" />
    <entry name="cache.level2.size" value="1000" />
    <entry name="profiler.enabled" value="true" />

    <entry name="log.console.level" value="info" />
    <entry name="log.file.level" value="fine" />

    <entry name="plugin.dynamic" value="false"/>
</properties>

再次感谢。

1 个答案:

答案 0 :(得分:0)

正如wolf4ood指出的那样,存储类型被hazelcast插件的onOpen方法中的hazelcast插件所取代。分页存储切换到分布式。如果路径不以“plocal:./ databases”开头,则不会发生此替换。解决方案:使路径以此开头。我不知道这是不是一个好主意。那个检查似乎在那里有一个原因,代码中的注释似乎表明在同一个jvm上运行的东西。