These are chat archives for atomix/atomix

17th
Jul 2018
Jordan Halterman
@kuujo
Jul 17 2018 03:48
probably going to continue releasing release candidates every few days until the final release
sometimes every day
cow12331
@cow12331
Jul 17 2018 18:24
Hi, I try to use primitive to sync map among instances. I am confusing about how Atomix set up a cluster. If I want use 3 hosts to combine a cluster, do I have to put different configuration file for each host during deployment. I see there is a local member property in configuration file. It seems I have to define member name and bind it to host by myself.
Is any example for setting up a cluster using Atomix?
cow12331
@cow12331
Jul 17 2018 18:41
    //host 1
    Atomix.Builder builder = Atomix.builder();
    builder.withLocalMember(Member.builder()
              .withId("member1")
              .withAddress("localhost:5000")
              .build());
    builder.withMembers(
              Member.builder("member1")
                .withAddress("localhost:5000")
                .build(),
              Member.builder("member2")
                .withAddress("localhost:5005")
                .build(),
              Member.builder("member3")
                .withAddress("localhost:5002")
                .build());
    builder.addProfile(Profile.DATA_GRID);
    Atomix atomix = builder.build();
    atomix.start().join();
    ConsistentMap<String, String> map = atomix.<String, String>consistentMapBuilder("my-map").build();

    map.put("foo", "Hello world!");


    //host 2
    Atomix.Builder builder2 = Atomix.builder();
    builder2.withLocalMember(Member.builder()
              .withId("member2")
              .withAddress("localhost:5005")
              .build());
    builder2.withMembers(
              Member.builder("member1")
                .withAddress("localhost:5000")
                .build(),
              Member.builder("member2")
                .withAddress("localhost:5001")
                .build(),
              Member.builder("member3")
                .withAddress("localhost:5002")
                .build());
    builder2.addProfile(Profile.DATA_GRID);
    Atomix atomix2 = builder2.build();
    atomix2.start().join();
    ConsistentMap<String, String> map2 = atomix.<String, String>consistentMapBuilder("my-map").build();

    Versioned<String> value = map2.get("foo");
    System.out.println(value);
my understanding is we have to repeat these for each host. Am I right?
Jordan Halterman
@kuujo
Jul 17 2018 23:32
@cow12331 that’s correct. You have to provide a host to which to bind, plus a list of peers with which to initially bootstrap the cluster unless you configure Atomix to use multicast, which you can using the DATA_GRID profile.