Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autosharding Insert Cannot find best cluster for class #3370

Closed
darkredz opened this issue Jan 12, 2015 · 11 comments
Closed

Autosharding Insert Cannot find best cluster for class #3370

darkredz opened this issue Jan 12, 2015 · 11 comments
Assignees
Milestone

Comments

@darkredz
Copy link

I have 2 servers nodes with orientdb 2.0-rc1 distributed mode running. Both database are synced. I have tried to enable autosharding following the manual at http://www.orientechnologies.com/docs/last/orientdb.wiki/Distributed-Sharding.html and create my claases.

alter database minimumclusters 4

The DB clusterSelection was roundrobin. However when i insert records it's always using the default cluster, no other clusters are used to store the new records.
So i tried to alter the cluster selection for the class: ALTER CLASS MyProfile CLUSTERSELECTION roundrobin

Tried to create new record, it's still using the default #18 cluster. After changing to another clusterselection
ALTER CLASS MyProfile CLUSTERSELECTION balanced

It's still the same, however now when i insert new record from server 2, it will complai:
com.orientechnologies.common.exception.OException: Cannot find best cluster for class 'MyProfile'. ClusterStrategy=local [ONetworkProtocolHttpDb]

But it's still fine on server 1 but still only the default cluster is used. (which is the 1st DB that is deploy). What else is needed to be configured to New records to fully utilize the clusters automatically?

Name SuperClass Alias Abstract Clusters Default Cluster Cluster Selection Records Actions
MyProfile [18,19,20,21] 18

@lvca
Copy link
Member

lvca commented Jan 14, 2015

Please could you try OrienDB 2.0-rc2?

@lvca lvca self-assigned this Jan 14, 2015
@lvca lvca closed this as completed Jan 20, 2015
@lvca lvca added the bug label Jan 20, 2015
@lvca lvca added this to the 2.0 Final milestone Jan 20, 2015
@darkredz
Copy link
Author

This seems to fixed with the latest version on the error cannot find best cluster class. Now i can insert from both nodes and they will sync without error. However cluster selection doesn't work
ALTER CLASS MyProfile CLUSTERSELECTION roundrobin

If you try to set it through the studio interface it will always default back to local instead of round robin which is what is chosen.

@lvca
Copy link
Member

lvca commented Jan 26, 2015

You cannot change clusterselection with distributed cfg, because "local" is always injected.

@darkredz
Copy link
Author

oh, so what will happen here when i insert a new record from Java API? Will orientdb still insert it in a round robin fashion to either node 1 or node 2? Or is it always going to be node 1?

@lvca
Copy link
Member

lvca commented Jan 26, 2015

If the request is taken by node1 will go to the cluster where node1 is master. The same for node2. Look at the docs: http://www.orientechnologies.com/docs/last/orientdb.wiki/Distributed-Sharding.html

@darkredz
Copy link
Author

Ok I see, so I shouldn't actually test this through studio interface as it seems to only choose the node where it is hosted on.

@darkredz
Copy link
Author

It seems that even inserting from Java api it will always choose the 2nd node. I explained my experience here:
https://groups.google.com/forum/#!topic/orient-database/f6Qv0-IfKWs

@lvca
Copy link
Member

lvca commented Jan 27, 2015

Ok, I'll respond in the forum.

@darkredz
Copy link
Author

thanks!

@p1tz
Copy link

p1tz commented Feb 15, 2015

I still see this with 2.0.2:

Caused by: com.orientechnologies.common.exception.OException: Cannot find best cluster for class '...' on server '...'. ClusterStrategy=local
    at com.orientechnologies.orient.server.distributed.OLocalClusterStrategy.readConfiguration(OLocalClusterStrategy.java:90)
    at com.orientechnologies.orient.server.distributed.OLocalClusterStrategy.getCluster(OLocalClusterStrategy.java:60)
    at com.orientechnologies.orient.core.metadata.schema.OImmutableClass.getClusterForNewInstance(OImmutableClass.java:273)
    at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.save(ODatabaseDocumentTx.java:2237)
    at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.save(ODatabaseDocumentTx.java:117)
    at com.orientechnologies.orient.core.record.impl.ODocument.save(ODocument.java:1704)
    at com.orientechnologies.orient.core.record.impl.ODocument.save(ODocument.java:1695)
    at com.orientechnologies.orient.core.record.impl.ODocument.save(ODocument.java:75)

@lvca
Copy link
Member

lvca commented Sep 18, 2015

@p1tz do you have the code that cause that problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants