3

I'm running the sample project from How to setup akka persistence project : https://developer.lightbend.com/start/?group=akka&project=akka-samples-persistence-dc-java

application.conf:

  cluster {
    seed-nodes = [
      "akka://ClusterSystem@127.0.0.1:2551",
      "akka://ClusterSystem@127.0.0.1:2552"]

    # Needed when running many actor systems in the same JVM
    jmx.multi-mbeans-in-same-jvm = on

    downing-provider-class = "akka.cluster.sbr.SplitBrainResolverProvider"

    multi-data-center {
      self-data-center = "eu-west"
    }
  }

Have configured 2 hosts running Yugabyte:

http://yugabyte_db_1:7000/
http://yugabyte_db_2:7000/

Where to set the configuration that allows replication between each Yugaybte data source?

Should it be set within the seed-nodes configuration? :

 seed-nodes = [
      "akka://ClusterSystem@127.0.0.1:2551",
      "akka://ClusterSystem@127.0.0.1:2552"]

Looking at the Yugabyte config I'm unsure where the config is exposed which points to the seed nodes :

enter image description here

blue-sky
  • 51,962
  • 152
  • 427
  • 752

1 Answers1

1

Note that you're using the web interface to connect. The YCQL api is available on the 9042 port.

Also note that akka will use the default Cassandra driver. And it's best to use the YugabyteDB fork: https://github.com/yugabyte/cassandra-java-driver

Then you can also see how to setup a cluster in multiple regions https://docs.yugabyte.com/latest/deploy/multi-dc/

dh YB
  • 965
  • 3
  • 10
  • thanks, I'm attempting to test replication at the akka cluster level only for now. In other words each Yugabyte instance is not aware of the other. Is an update to seed-nodes in application.conf required? – blue-sky Jul 28 '21 at 15:21
  • Looking at the readme on the project template, the seed-nodes are actually akka-cluster seed-nodes and not "cassandra seed nodes". So they should remain the same. And according to the readme, it's still setting up 1 Cassandra local node, so you'll need by default just 1 YugabyteDB process. Correct ? @blue-sky – dh YB Jul 29 '21 at 06:40
  • reading https://github.com/akka/akka-samples/tree/2.6/akka-sample-persistence-dc-java new resources are started in terminal 2 and terminal 3, it seems then this example demo's Akka persistence when two Akka clusters are sharing the same backend DB. I'm attempting to test replication using two Akka clusters each pointing to a distinct backend DB. – blue-sky Jul 29 '21 at 08:54
  • @blue-sky then you have to change the config of the two akka processes so each connects to a different yugabytedb instance. I can't find where the Cassandra ip is being defined in the application.conf. Maybe it's implicit ? – dh YB Jul 29 '21 at 09:30
  • yes seems to be implicit, the project uses a Cassandra implementation : akka.persistence.cassandra.testkit.CassandraLauncher; – blue-sky Jul 29 '21 at 16:24