Hi Colin,

thanks for the email but I'm still not getting the expected results. That's
what I've done so far.

- Start server1 and create database "test"
- run the following commands:
create class MyClass extends V
create property MyClass.id long
create index MyClass.id UNIQUE
insert into MyClass (id) values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10)

- start server2. The data gets replicated
- run the following command:

ALTER CLASS MyClass ADDCLUSTER myclass_orientdb02

After all that I still see the 10 rows inserted on "myclass" and nothing
has been sharded on cluster "myclass_orientdb02"

 myclass                                      |    12 |
|             10 |
 myclass_orientdb02                           |    17 |
|              0 |

How can I rebalance the data so there's 5 rows on each cluster?


On Tue, Sep 15, 2015 at 8:36 PM, Colin <[email protected]> wrote:

> Hi Isart,
>
> Let's say you have a class called MyClass.
>
> You can create additional clusters for that class as so:
>
> ALTER CLASS MyClass ADDCLUSTER AwesomeCluster2
> ALTER CLASS MyClass ADDCLUSTER AwesomeCluster3
>
> Then, in the distributed config json file (in the database directory) you
> can specify which server (or servers) each cluster should live on.
>
> Best regards,
>
> -Colin
>
>
> On Tuesday, September 15, 2015 at 10:23:14 AM UTC-5, [email protected]
> wrote:
>>
>> I'm having some trouble to shard our database using OrientDB.
>>
>> I've got an N servers cluster (for example N=3), and I want to distribute
>> our users database evenly on the 3 servers using the user_id. As far as I
>> understand, the data gets inserted locally on the server that receives the
>> INSERT, but it doesn't get sharded if all the inserts are going to the same
>> server. Is there a way to workaround this and distribute the data evenly
>> using some kind of modulus? (%3)
>>
>> Assuming that I can do that, if I end up needing to duplicate the number
>> of servers (N=6), how can I rebalance the data? do I need to dump it and
>> insert it again?
>>
>> Sorry if that are basic questions, but I couldn't find the answer on the
>> documentation.
>>
> --
>
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "OrientDB" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/orient-database/xNxmZow4Vlc/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to