Hi Melvin,
Distributed mode is for running multiple instances of OrientDB at the same
time, where the clusters span multiple instances.
-Colin
On Tuesday, April 7, 2015 at 12:58:41 PM UTC-5, Melvin Yam wrote:
>
> Hi all,
>
> I'm using OrientDB 2.0.6.
> I started orientdb in a single machine in distributed mode, by running
> dserver.bat (in Windows).
>
> I did the following:
> orientdb> create database remote:192.168.88.213/testdb root root plocal
>
> Creating database [remote:192.168.88.213/testdb] using the storage type
> [plocal]...
> Connecting to database [remote:192.168.88.213/testdb] with user
> 'admin'...OK
>
> DISTRIBUTED CONFIGURATION:
> {
> "members": [{
> "id": "9b5e0282-f445-4f68-8d16-635ed0a0b394",
> "name": "node1428428394440",
> "startedOn": "2015-04-08 01:39:51",
> "listeners": [{"protocol":"ONetworkProtocolBinary","listen":"
> 192.168.88.213:2424"},{"protocol":"ONetworkProtocolHttpDb","listen":"
> 192.168.88.213:2480"}],
> "databases": []
> }
> ],
> "localName": "_hzInstance_1_orientdb",
> "localId": "9b5e0282-f445-4f68-8d16-635ed0a0b394"
> }
> Database created successfully.
>
> orientdb {db=testdb}> create cluster p1
>
> Cluster created correctly with id #11
>
> orientdb {db=testdb}> create cluster p2
>
> Cluster created correctly with id #12
>
> orientdb {db=testdb}> create class person cluster p1,p2
>
> Class created successfully. Total classes in database now: 11
>
> orientdb {db=testdb}> alter class person clusterselection balanced
>
> Class updated successfully
>
> orientdb {db=testdb}> info class person
>
> Class................: person
> Default cluster......: p1 (id=11)
> Supported cluster ids: [11, 12]
> Cluster selection....: balanced
> orientdb {db=testdb}> insert into person content {name:"Melvin"}
>
> Inserted record 'person#11:0{name:Melvin} v1' in 0.019000 sec(s).
>
> orientdb {db=testdb}> insert into person content {name:"Melvin2"}
>
> Inserted record 'person#11:1{name:Melvin2} v1' in 0.005000 sec(s).
>
> orientdb {db=testdb}> insert into person content {name:"Melvin3"}
>
> Inserted record 'person#11:2{name:Melvin3} v1' in 0.005000 sec(s).
>
> orientdb {db=testdb}> alter class person clusterselection round-robin
>
> Class updated successfully
>
> orientdb {db=testdb}> info class person
>
> Class................: person
> Default cluster......: p1 (id=11)
> Supported cluster ids: [11, 12]
> Cluster selection....: round-robin
> orientdb {db=testdb}> insert into person content {name:"Melvin5"}
>
> Inserted record 'person#11:4{name:Melvin5} v1' in 0.008000 sec(s).
>
> orientdb {db=testdb}> insert into person content {name:"Melvin6"}
>
> Inserted record 'person#11:5{name:Melvin6} v1' in 0.005000 sec(s).
>
> orientdb {db=testdb}> insert into person content {name:"Melvin7"}
>
> Inserted record 'person#11:6{name:Melvin7} v1' in 0.005000 sec(s).
>
> All the records inserted are always in the cluster p1, regardless of the
> clusterselection I set for class person.
> How does cluster selection work? Why does it not select cluster p2?
> I am really confused. Can someone explain to me what is happening?
>
> Thanks.
>
> Regards,
> Melvin Yam
>
>
>
--
---
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.