Pod Clustering

34 views
Skip to first unread message

thomasm

unread,
Nov 7, 2014, 5:21:05 PM11/7/14
to barat...@googlegroups.com
Hi,

i am currently looking into the whole pod concept of Baratine. My current target setup is couple of Services and a ResourceService that get's distributed on all available cluster nodes.

For now i am trying to start multiple JVMs on my local machine by using this resin.cf:


cluster {
 server 8085;
 server 8086;
 server 8087;
 server 8088;
 server 8089;
 server 8090;

}

baratine start conf resin.cf spins up all jvms, this seems ok.

baratine> start --conf resin.cf

Baratine/0.8.5 start with watchdog at 127.0.0.1:6700
Baratine/0.8.5 launching watchdog at 127.0.0.1:6700
  starting *:8085 (cluster-8085)
  starting *:8086 (cluster-8086)
  starting *:8087 (cluster-8087)
  starting *:8088 (cluster-8088)
  starting *:8089 (cluster-8089)
  starting *:8090 (cluster-8090)



I am deploying my jar with:

deploy my.jar

I see that the pod is using the first three servers:

baratine> cat /proc/pods/mypod
{ "pod" : "pod",
  "type" : "solo",
  "sequence" : 0
  "servers" : [
    {"server" : "169.254.185.190:8085"},
    {"server" : "169.254.185.190:8086"},
    {"server" : "169.254.185.190:8087"}
  ],
  "nodes" : [
    [0, 1, 2]
  ]

From the source code and documation i see different types like "solo" ,  "triad" oder "cluster". How can i set the type and what is behind each type ? Are there any limitation by using multiple jvms on the same Machine ? Do i need to provide different hosts for baratine to switch to a different type ?


Can i modify the servers that were selected for my pod ? 


I can see in the logs that my normal Services are starting up on each node. but when i use them everything is done on the first jvm. So "solo" means that there is one active Node doing all the work and the other nodes are just standby nodes ? I would like the services to be spread over all available nodes, is this a configuration problem or do i need to put each service in one pod ?

Besides my normal "Service"s i have one ResourceService as well. I am accessing/creating 100 Resources with:


   String url = "http://localhost:8085/s/pod/";

        ClientHamp client = new ClientHamp(url);

        for (int i = 0; i < 100; i++) {
            DatasetService myService = client.lookup(
                    "remote:///datasetservice/" + i)

            .as(DatasetService.class);

            System.out.println("loading " + i + " " + myService.loadData());
        }


I can see in the logs that everything is created only on the first jvm and nothing gets partitioned ?!? Is this happening due to type = SOLO  ? Are 100 Resources and/or my urls not sufficient enough for the hashing to pick an other node ?



Thomas








Scott Ferguson

unread,
Nov 7, 2014, 5:40:48 PM11/7/14
to barat...@googlegroups.com
On 11/7/14, 2:21 PM, thomasm wrote:
Hi,

i am currently looking into the whole pod concept of Baratine. My current target setup is couple of Services and a ResourceService that get's distributed on all available cluster nodes.
From the source code and documation i see different types like "solo" ,  "triad" oder "cluster". How can i set the type and what is behind each type ? Are there any limitation by using multiple jvms on the same Machine ? Do i need to provide different hosts for baratine to switch to a different type ?


Can i modify the servers that were selected for my pod ?
Pods default to "solo".

Currently, you'll need to configure the pods in the baratine.cf. It looks like:

  cluster {
    pod id="pod" type="triad" {

      server 8085;
      server 8086;
      server 8087;
    }
    ...
  }

With that configuration, your /proc/pods/pod should show a type of "triad", and a more complicated value for "nodes".

  "solo" - the pod has one active servers, the others are backups
  "pair" - the pod has 2 active servers, with a 3rd server as a failover.
  "triad" - the pod has 3 servers (6 nodes for load-balance reasons)
  "cluster" - the pod uses all servers in the pod (with 2x the number of nodes for failover reasons)

The pod configuration and deployment is something we're revisiting to try to keep it as simple as possible.


So "solo" means that there is one active Node doing all the work and the other nodes are just standby nodes ?

Correct.


I would like the services to be spread over all available nodes, is this a configuration problem or do i need to put each service in one pod ?

Config.

Besides my normal "Service"s i have one ResourceService as well. I am accessing/creating 100 Resources with:


I can see in the logs that everything is created only on the first jvm and nothing gets partitioned ?!? Is this happening due to type = SOLO  ? Are 100 Resources and/or my urls not sufficient enough for the hashing to pick an other node ?

100 would be plenty. Even with 8 values, you'd have to be very unlucky for all resources to hash to the same node if you had any other pod type than solo.

-- Scott



Thomas








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

Reply all
Reply to author
Forward
0 new messages