Simple akka cluster example.
- Install cassandra and start it.
- sbt clean compile xitrum-package
- cd target/xitrum/bin
- ./start.sh seed1
- ./start.sh seed2
- ./start.sh stat1
- ./start.sh stat2
- ./start.sh query
- ./start_driver.sh
- cd ../logs
- tail -f driver_rt.log
To got multiple sharding actors run on separated sub-set of nodes, and can be accessed from other nodes in the cluster, for example:
- Counter1 runs on node1, node2, node3
- Counter2 runs on node7, node8, node9
- Query want to query both Counter1 sharding and Counter2 sharding.
You have to:
- All those sharding nodes should contain at lease one same role in "actor.cluster.roles"
- All sharding nodes should have the role in "actor.cluster.roles" which is the same as its sharding role
- Query can have or one or none whatever role in "akka.contrib.cluster.sharding.role"
- ClusterSharding(system).start() with entryProps = Some(Props[Counter1]) on node1, node2, node3
- ClusterSharding(system).start() with entryProps = Some(Props[Counter2]) on node7, node8, node9
- ClusterSharding(system).start() with entryProps = None on node of Query for shardings of Counter1 and Counter2.