Skip to content
This repository has been archived by the owner on Feb 9, 2021. It is now read-only.

Cluster Setup

Alexandre Porcelli edited this page Jun 6, 2013 · 1 revision

This document describes very brieflie how to setup a VFS Cluster using JBoss Application Server (tested on 7.1.1 and EAP 6.1)

First you need to download Apache Zookeeper and Apache Helix - after download unzip both and place in a proper system folder like /opt or similar.

  1. go to Zookeeper bin directory and start it using the following sudo ./zkServer.sh start
  2. after Zookeeper running, go to Helix bin directory
  3. execute the following command to create a cluster ./helix-admin.sh --zkSvr localhost:2188 --addCluster lock-demo - note that the localhost:2188 is the Zookeeper address id (check your zookeeper\conf\zoo.cfg config file`)
  4. then you have to create a cluster controller ./run-helix-controller.sh --zkSvr localhost:2188 --cluster lock-demo 2>&1 > /tmp/controller.log &. Note that lock-demo is the name of your already created cluster.
  5. now you'll create a new clustering resource that controls the VFS lock ./helix-admin.sh --zkSvr localhost:2188 --addResource lock-demo vfs-lock 1 LeaderStandby AUTO_REBALANCE. The cluster name is used here again and you're defining the vfs-lock resource here.
  6. now it's time to add nodes to you cluster ./helix-admin.sh --zkSvr localhost:2188 --addNode lock-demo nodeOne:11 - the nodename:number notation is not related to a real hostname and port - consider it as just a single unique identifier string for a logical node.
  7. Repeat step 6 for each node
  8. Now you'll start the rebalnce of the cluster resource between existing nodes ./helix-admin.sh --zkSvr localhost:2188 --rebalance lock-demo vfs-lock 2 , the number 2 represents the number of cluster nodes

That's it.. you have your cluster setup and running. Now you'll use the following to start you jboss

sudo ./bin/standalone.sh -Djboss.node.name=nodeOne --server-config=standalone-ha.xml -Dorg.uberfire.cluster.id=lock-demo -Dorg.uberfire.cluster.zk=localhost:2188 -Dorg.uberfire.cluster.local.id=nodeOne_11 -Dorg.uberfire.cluster.vfs.lock=vfs-lock

Above statement start JBoss for the first node called nodeOne:11.

Here is the statement that you'll need for other nodes:

sudo ./bin/standalone.sh -Djboss.node.name=nodeTwo --server-config=standalone-ha.xml -Djboss.socket.binding.port-offset=100 -Dorg.uberfire.cluster.id=lock-demo -Dorg.uberfire.cluster.zk=localhost:2188 -Dorg.uberfire.cluster.local.id=nodeTwo_11 -Dorg.uberfire.cluster.vfs.lock=vfs-lock -Dorg.kie.nio.git.deamon.port=9419

Note that now we had to add the org.kie.nio.git.deamon.port argument in order to avoid port collision.

Clone this wiki locally