orientechnologies / orientdb

OrientDB is the most versatile DBMS supporting Graph, Document, Reactive, Full-Text and Geospatial models in one Multi-Model product. OrientDB can run distributed (Multi-Master), supports SQL, ACID Transactions, Full-Text indexing and Reactive Queries.
https://orientdb.dev
Apache License 2.0
4.75k stars 871 forks source link

db creation fails on Windows with clustering #2600

Closed odbuser2 closed 8 years ago

odbuser2 commented 10 years ago
OrientDB 1.7.7-SNAPSHOT (uses hazelcast 3.2.2)
OS : Windows (8.1 and 2008 Server fail), osx (works), solaris 10 (works)

I'm using OrientDB embedded. The hazelcast configuration does not include any remote nodes besides itself. The app creates the database on startup and it's working under OSX and Solaris 10 but it fails on Windows 8.1 and 2008 Server when trying to "create class V".

Another user reported that it is also failing on Linux. https://groups.google.com/forum/#!topic/orient-database/vAREt3Vdn08

Here's the stacktrace:

[MYHOST] Installing distributed storage on database 'db'
[MYHOST] Publishing online status for database MYHOST.db...
[MYHOST] Database MYHOST.db is online, waking up listeners on local node...
[MYHOST] received updated status MYHOST.db=ONLINE
[MYHOST] No nodes configured for partition 'db.[]' request: id=-1 from=MYHOST task=command_sql(create class V)
ODistributedStorage@74   |Cannot route COMMAND operation to the distributed node
com.orientechnologies.orient.server.distributed.ODistributedException: No nodes configured for partition 'db.[]' request: id=-1 from=MYHOST task=command_sql(create class V) userName=admin
        at com.orientechnologies.orient.server.hazelcast.OHazelcastPlugin.sendRequest(OHazelcastPlugin.java:367) ~[bundleFile:1.7.6]
        at com.orientechnologies.orient.server.distributed.ODistributedStorage.command(ODistributedStorage.java:185) ~[bundleFile:1.7.6]
        at com.orientechnologies.orient.core.command.OCommandRequestTextAbstract.execute(OCommandRequestTextAbstract.java:59) [bundleFile:1.7.6]
        at com.orientechnologies.orient.core.metadata.schema.OSchemaShared.createClass(OSchemaShared.java:306) [bundleFile:1.7.6]
        at com.orientechnologies.orient.core.metadata.schema.OSchemaShared.createClass(OSchemaShared.java:160) [bundleFile:1.7.6]
        at com.orientechnologies.orient.core.metadata.schema.OSchemaProxy.createClass(OSchemaProxy.java:62) [bundleFile:1.7.6]
        at com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.checkForGraphSchema(OrientBaseGraph.java:1571) [bundleFile:1.7.6]
        at com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.openOrCreate(OrientBaseGraph.java:1747) [bundleFile:1.7.6]
        at com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.<init>(OrientBaseGraph.java:131) [bundleFile:1.7.6]
        at com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.<init>(OrientBaseGraph.java:197) [bundleFile:1.7.6]
        at com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx.<init>(OrientGraphNoTx.java:44) [bundleFile:1.7.6]
robgratz commented 10 years ago

I'd like to +1 this defect. I have a test app that demonstrates this defect

odbuser2 commented 10 years ago

Can you add the test app here? I've found that that accelerates the a fix for the problem. I haven't had a chance to create a test.

robgratz commented 10 years ago

Here is the test and referenced config files This is being run on Windows.

package test;

import com.orientechnologies.common.io.OFileUtils; import com.orientechnologies.orient.core.config.OGlobalConfiguration; import com.orientechnologies.orient.core.metadata.schema.OType; import com.orientechnologies.orient.graph.gremlin.OGremlinHelper; import com.orientechnologies.orient.server.OServer; import com.tinkerpop.blueprints.impls.orient.OrientGraph; import com.tinkerpop.blueprints.impls.orient.OrientGraphFactory; import com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx; import com.tinkerpop.blueprints.impls.orient.OrientVertex; import com.tinkerpop.blueprints.impls.orient.OrientVertexType;

import java.io.File; import java.io.FileInputStream; import java.util.Date; import java.util.UUID;

public class OrientGraphTest { public static void main(String[] args) throws Exception { create();

OGremlinHelper.global().create();
OrientGraphFactory factory = new OrientGraphFactory(getDatabaseURL()).setupPool(1, 10);

// start in clustered mode
OServer server = new OServer();
server.startup(new FileInputStream("src/test/resources/orientdb-dserver-config-0.xml"));
server.activate();
OrientGraph graph = null;

try
{
  graph = factory.getTx();
  String username = "test_user";

  OrientVertex userV = graph.addVertex("class:User", "name", username);

  // First Vertex
  String ID = UUID.randomUUID().toString();
  OrientVertex logV = graph.addVertex("class:AuditLog", "log_id", ID, "timestamp", new Date()); 
  graph.addEdge(null, userV, logV, "log user");

  // Second Vertex
  ID = UUID.randomUUID().toString();
  logV = graph.addVertex("class:AuditLog", "log_id", ID, "timestamp", new Date()); 
  graph.addEdge(null, userV, logV, "log user");

  // Third Vertex
  ID = UUID.randomUUID().toString();
  logV = graph.addVertex("class:AuditLog", "log_id", ID, "timestamp", new Date()); 
  graph.addEdge(null, userV, logV, "log user");

  graph.commit();

}
finally
{
  if (graph != null)
  {
    graph.shutdown();
  }
  server.shutdown();
}

} private static String getDatabaseURL() { String ORIENTDB_HOME = new File("servers").getAbsolutePath().replace('\', '/'); System.setProperty("ORIENTDB_HOME", ORIENTDB_HOME); String databaseUrl = "plocal:" + ORIENTDB_HOME + "/databases/platform"; return databaseUrl; } private static void create() throws Exception { OGlobalConfiguration.STORAGE_KEEP_OPEN.setValue(false); OFileUtils.deleteRecursively(new File("servers"));

String databaseUrl = getDatabaseURL();

System.out.println("Create database: " + databaseUrl);

OrientGraphNoTx graph = new OrientGraphNoTx(getDatabaseURL());

try
{
  OrientVertexType userVertexType = graph.createVertexType("LogUser");
  userVertexType.createProperty("name", OType.STRING);

  OrientVertexType auditVertexType = graph.createVertexType("AuditLog");
  auditVertexType.createProperty("log_id", OType.STRING);
  auditVertexType.createProperty("timestamp", OType.DATETIME);
  auditVertexType.createProperty("tags", OType.EMBEDDEDSET);
  auditVertexType.createProperty("additional", OType.EMBEDDEDMAP);
}
finally
{
  graph.shutdown();
}

}

}

default-distributed-db-config.json

{ "autoDeploy": true, "hotAlignment": false, "offlineMsgQueueSize" : 0, "readQuorum": 1, "writeQuorum": 2, "failureAvailableNodesLessQuorum": false, "readYourWrites": true, "clusters": { "internal": { }, "index": { }, "*": { "servers" : [ "" ] } }

}

orientdb-dserver-config-0.xml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

``` ``` ##

hazelcast-0.xml

<?xml version="1.0" encoding="UTF-8"?>

<hazelcast xsi:schemaLocation="http://www.hazelcast.com/schema/config hazelcast-config-3.0.xsd" xmlns="http://www.hazelcast.com/schema/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

orientdb orientdb true true
<network>
    <port auto-increment="false">2435</port>
    <join>
        <multicast enabled="false">
            <multicast-group>224.2.2.3</multicast-group>
            <multicast-port>2434</multicast-port>
        </multicast>
        <tcp-ip enabled="true">
            <member>127.0.0.1:2435</member>
    <member>127.0.0.1:2436</member>
    <member>127.0.0.1:2437</member>
    <member>127.0.0.1:2438</member>
        </tcp-ip>
    </join>
</network>
<executor-service>
<pool-size>32</pool-size>
</executor-service>

lvca commented 10 years ago

Have you tried with 1.7.8?

robgratz commented 10 years ago

Running this with 1.7.9-SNAPSHOT does not work.

lvca commented 10 years ago

@robgraz Could you try it against mastercluster branch and give me the exact logs?

lvca commented 8 years ago

Old issue, closing. In case please reopen it.