List:Cluster« Previous MessageNext Message »
From:Craig L Russell Date:June 26 2013 11:10pm
Subject:Re: ClusterJDatastoreException (possible obscure Windows error?)
View as plain text  
Hi Serdyn,

The connectstring for clusterj is not the same as the connect string for ndb configuration
files. The connectstring in clusterj is a simple ipaddress:portnumber.

Currently connection pooling (specifying node ids and pool size) is a feature of clusterj
but is not supported by clusterjpa. There are a couple of code changes needed in order to
implement this feature for clusterjpa. What we would probably do is to add configuration
parameters like ndb.connectionPoolNodeids and ndb.connectionPoolSize that will then be
used in your jpa configuration file. These would be mapped to the underlying
com.mysql.clusterj.connection.pool.nodeids and com.mysql.clusterj.connection.pool.size.

It may be better to go back to trying to get the basic code working, specifying a connect
string that contains only the IP address and port number.

The default nodeid is 0 which will connect to any available application (API) node id.
This should be sufficient for the purpose of getting your application running. 

Have you been successful connecting via clusterj using that connect string? That would
verify that there is connectivity at the clusterj api level. Have you tried getting a
mysqld up and running, perhaps with the mysqld running on the same machine from which you
are trying to connect using clusterjpa.

You mentioned earlier that the trouble comes when connecting a windows vm client to a unix
vm server. It might be well to review the connectivity between those machines and verify
that the ports you are using (1186 for the ndb_mgmd and 3306 for the mysqld) are valid
and open. 

Regards,

Craig

On Jun 26, 2013, at 2:35 PM, Serdyn du Toit wrote:

> Thanks - didn't know that.  So I changed it to point to an API node and now
> get a different stacktrace.  Please note that the nodeId is still being
> reflected as 0 in the logs even though its reflected as 51 in the
> connectString...
> 
> Code and stacktraces below.  Getting some sleep now, will continue
> investigating tomorrow first thing.
> 
> 
> 
> Java code:
> properties.put("openjpa.ndb.connectString", "nodeid=51,192.168.1.3:1186");
> 
> 
> 
> config.ini:
> [ndb_mgmd]
> hostname=localhost
> datadir=/home/me/my_cluster/ndb_data
> NodeId=1
> 
> [ndbd default]
> noofreplicas=2
> datadir=/home/me/my_cluster/ndb_data
> 
> [ndbd]
> hostname=localhost
> NodeId=3
> 
> [ndbd]
> hostname=localhost
> NodeId=4
> 
> [mysqld]
> NodeId=50
> 
> [api]
> NodeId=51
> 
> 
> 
> Stacktrace:
> INFO: Created cluster connection 'nodeid=51,192.168.1.3:1186' with node id
> 0.
> org.apache.openjpa.persistence.PersistenceException: Error getting
> connection to cluster with properties
> {com.mysql.clusterj.connect.verbose=0,
> com.mysql.clusterj.connect.retries=4, com.mysql.clusterj.connect.delay=5,
> com.mysql.clusterj.connectstring=nodeid=51,192.168.1.3:1186,
> com.mysql.clusterj.max.transactions=1024,
> com.mysql.clusterj.connect.timeout.before=30,
> com.mysql.clusterj.database=clusterdb,
> com.mysql.clusterj.connect.timeout.after=20}:
> Caused by com.mysql.clusterj.ClusterJDatastoreException:Datastore
> exception on connectString 'nodeid=51,192.168.1.3:1186' nodeId 0; Return
> code: -1 error code: 0 message: .
> at
>
> org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:218)
> ~[openjpa-all-2.2.2.jar:2.2.2]
> at
>
> org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
> ~[openjpa-all-2.2.2.jar:2.2.2]
> at
>
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
> ~[openjpa-all-2.2.2.jar:2.2.2]
> at
>
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:154)
> ~[openjpa-all-2.2.2.jar:2.2.2]
> at
>
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
> ~[openjpa-all-2.2.2.jar:2.2.2]
> at
> <snip, my test code>
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
> [junit-4.10.jar:na]
> at
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> [junit-4.10.jar:na]
> at
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
> [junit-4.10.jar:na]
> at
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
> [junit-4.10.jar:na]
> at
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
> [junit-4.10.jar:na]
> at
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
> [junit-4.10.jar:na]
> at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
> [junit-4.10.jar:na]
> at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
> [junit-4.10.jar:na]
> at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
> [junit-4.10.jar:na]
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
> [junit-4.10.jar:na]
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
> [junit-4.10.jar:na]
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
> [junit-4.10.jar:na]
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
> [junit-4.10.jar:na]
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
> [junit-4.10.jar:na]
> at
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
> [junit-4.10.jar:na]
> at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
> [junit-4.10.jar:na]
> at
>
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
> [.cp/:na]
> at
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> [.cp/:na]
> at
>
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
> [.cp/:na]
> at
>
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
> [.cp/:na]
> at
>
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
> [.cp/:na]
> at
>
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
> [.cp/:na]
> Caused by: com.mysql.clusterj.ClusterJFatalUserException: Error getting
> connection to cluster with properties
> {com.mysql.clusterj.connect.verbose=0,
> com.mysql.clusterj.connect.retries=4, com.mysql.clusterj.connect.delay=5,
> com.mysql.clusterj.connectstring=nodeid=51,192.168.1.3:1186,
> com.mysql.clusterj.max.transactions=1024,
> com.mysql.clusterj.connect.timeout.before=30,
> com.mysql.clusterj.database=clusterdb,
> com.mysql.clusterj.connect.timeout.after=20}:
> Caused by com.mysql.clusterj.ClusterJDatastoreException:Datastore
> exception on connectString 'nodeid=51,192.168.1.3:1186' nodeId 0; Return
> code: -1 error code: 0 message: .
> at
>
> com.mysql.clusterj.core.SessionFactoryImpl.createClusterConnection(SessionFactoryImpl.java:252)
> ~[clusterj-7.3.2.jar:na]
> at
>
> com.mysql.clusterj.core.SessionFactoryImpl.createClusterConnectionPool(SessionFactoryImpl.java:226)
> ~[clusterj-7.3.2.jar:na]
> at
> com.mysql.clusterj.core.SessionFactoryImpl.<init>(SessionFactoryImpl.java:174)
> ~[clusterj-7.3.2.jar:na]
> at
>
> com.mysql.clusterj.core.SessionFactoryImpl.getSessionFactory(SessionFactoryImpl.java:129)
> ~[clusterj-7.3.2.jar:na]
> at
>
> com.mysql.clusterj.core.SessionFactoryServiceImpl.getSessionFactory(SessionFactoryServiceImpl.java:36)
> ~[clusterj-7.3.2.jar:na]
> at
>
> com.mysql.clusterj.core.SessionFactoryServiceImpl.getSessionFactory(SessionFactoryServiceImpl.java:27)
> ~[clusterj-7.3.2.jar:na]
> at
> com.mysql.clusterj.ClusterJHelper.getSessionFactory(ClusterJHelper.java:69)
> ~[clusterj-7.3.2.jar:na]
> at
> com.mysql.clusterj.ClusterJHelper.getSessionFactory(ClusterJHelper.java:54)
> ~[clusterj-7.3.2.jar:na]
> at
>
> com.mysql.clusterj.openjpa.NdbOpenJPAConfigurationImpl.createSessionFactory(NdbOpenJPAConfigurationImpl.java:311)
> ~[clusterj-7.3.2.jar:na]
> at
>
> com.mysql.clusterj.openjpa.NdbOpenJPAConfigurationImpl.getSessionFactory(NdbOpenJPAConfigurationImpl.java:278)
> ~[clusterj-7.3.2.jar:na]
> at
>
> com.mysql.clusterj.openjpa.NdbOpenJPAConfigurationImpl.getSessionFactory(NdbOpenJPAConfigurationImpl.java:55)
> ~[clusterj-7.3.2.jar:na]
> at
>
> com.mysql.clusterj.openjpa.NdbOpenJPAStoreManager.setContext(NdbOpenJPAStoreManager.java:98)
> ~[clusterj-7.3.2.jar:na]
> at
>
> com.mysql.clusterj.openjpa.NdbOpenJPAStoreManager.setContext(NdbOpenJPAStoreManager.java:92)
> ~[clusterj-7.3.2.jar:na]
> at
>
> org.apache.openjpa.kernel.DelegatingStoreManager.setContext(DelegatingStoreManager.java:79)
> ~[openjpa-all-2.2.2.jar:2.2.2]
> at org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:375)
> ~[openjpa-all-2.2.2.jar:2.2.2]
> at org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:326)
> ~[openjpa-all-2.2.2.jar:2.2.2]
> at
>
> org.apache.openjpa.kernel.AbstractBrokerFactory.initializeBroker(AbstractBrokerFactory.java:228)
> ~[openjpa-all-2.2.2.jar:2.2.2]
> at
>
> org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:212)
> ~[openjpa-all-2.2.2.jar:2.2.2]
> ... 35 common frames omitted
> Caused by: com.mysql.clusterj.ClusterJDatastoreException: Datastore
> exception on connectString 'nodeid=51,192.168.1.3:1186' nodeId 0; Return
> code: -1 error code: 0 message: .
> at
>
> com.mysql.clusterj.tie.ClusterConnectionImpl.throwError(ClusterConnectionImpl.java:168)
> ~[clusterj-7.3.2.jar:na]
> at
>
> com.mysql.clusterj.tie.ClusterConnectionImpl.handleError(ClusterConnectionImpl.java:138)
> ~[clusterj-7.3.2.jar:na]
> at
>
> com.mysql.clusterj.tie.ClusterConnectionImpl.waitUntilReady(ClusterConnectionImpl.java:123)
> ~[clusterj-7.3.2.jar:na]
> at
>
> com.mysql.clusterj.core.SessionFactoryImpl.createClusterConnection(SessionFactoryImpl.java:245)
> ~[clusterj-7.3.2.jar:na]
> ... 52 common frames omitted

Craig L Russell
Architect, Oracle
http://db.apache.org/jdo
408 276-5638 mailto:Craig.Russell@stripped
P.S. A good JDO? O, Gasp!

Thread
ClusterJDatastoreException (possible obscure Windows error?)Serdyn du Toit5 Jun
  • RE: ClusterJDatastoreException (possible obscure Windows error?)Andrew Morgan5 Jun
    • Re: ClusterJDatastoreException (possible obscure Windows error?)Serdyn du Toit5 Jun
      • Re: ClusterJDatastoreException (possible obscure Windows error?)Serdyn du Toit26 Jun
        • Re: ClusterJDatastoreException (possible obscure Windows error?)Serdyn du Toit26 Jun
          • Re: ClusterJDatastoreException (possible obscure Windows error?)Craig L Russell26 Jun
            • Re: ClusterJDatastoreException (possible obscure Windows error?)Serdyn du Toit26 Jun
              • Re: ClusterJDatastoreException (possible obscure Windows error?)Craig L Russell26 Jun
                • Re: ClusterJDatastoreException (possible obscure Windows error?)Serdyn du Toit29 Jun
                  • Re: ClusterJDatastoreException (possible obscure Windows error?)Andrew Morgan29 Jun
                    • Re: ClusterJDatastoreException (possible obscure Windows error?)Johan Andersson29 Jun
                      • Re: ClusterJDatastoreException (possible obscure Windows error?)Serdyn du Toit3 Jul