-
Notifications
You must be signed in to change notification settings - Fork 118
Cluster Setup
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.
- go to Zookeeper
bindirectory and start it using the followingsudo ./zkServer.sh start - after Zookeeper running, go to Helix
bindirectory - execute the following command to create a cluster
./helix-admin.sh --zkSvr localhost:2188 --addCluster lock-demo- note that thelocalhost:2188is the Zookeeper address id (check yourzookeeper\conf\zoo.cfgconfig file`) - then you have to create a cluster controller
./run-helix-controller.sh --zkSvr localhost:2188 --cluster lock-demo 2>&1 > /tmp/controller.log &. Note thatlock-demois the name of your already created cluster. - 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 thevfs-lockresource here. - now it's time to add nodes to you cluster
./helix-admin.sh --zkSvr localhost:2188 --addNode lock-demo nodeOne:11- thenodename:numbernotation is not related to a real hostname and port - consider it as just a single unique identifier string for a logical node. - Repeat step 6 for each node
- 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 number2represents 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.