JBoss Fuse—How to Setup Cluster of Servers in Fabric
Join the DZone community and get the full member experience.Join For Free
Staying in Beijing for a technical enablement, one question I have been ask a lot is how to setup a Fabric in a cluster of servers with JBoss Fuse?
I am going to setup 2 Fuse on 2 different servers, and then join them together to form a fabric cluster.
BUT! In the real world please make it at
least 3 servers, as zookeeper needs more then 3 to successfully setup
First we need to create a fabric, so unzip the JBoss Fuse zip file in Server1, setup password by editing etc/user.properties.
And please do the same thing to server2. If you are testing, and tries to setup on the same machine, please remember to go to "org.apache.karaf.management.cfg" under etc/ and change the RMI related port.
Also there are a few more port you need to adjust,
org.apache.karaf.shell.cfg, change the:
and last inside system.properties
Now, getting back to setting the cluster of fabric, start up JBoss Fuse by going into bin/ and execute fuse on server one. After it starts up, create a fabric by entering the following command:
This spins up a fabric on a container call root, now, start up JBoss Fuse on server2 by going to bin/ and execute fuse on server two. And instead of creating a fabric, we are going to join, by entering following command, as fabric:join [options] zookeeperUrl [containerName].
To find out what the zookeeper URL, go to your fuse command line console in Server1 and type:
This will give you your zookeeper details:
JBossFuse:karaf@root> config:proplist service.pid = io.fabric8.zookeeper zookeeper.password = ZKENC=YWRtaW4= zookeeper.url = 192.168.0.1:2181 fabric.zookeeper.pid = io.fabric8.zookeeper
And now we have successfully created a fabric on 2 servers. If you type in container-list in the command line, you should be able to see we now have 2 working server.
JBossFuse:karaf@root> container-list [id] [version] [connected] [profiles] [provision status] root* 1.0 true fabric, fabric-ensemble-0000-1, jboss-fuse-full success root1 1.0 true fabric
And if you login to Fuse management console, under Runtime-> Containers you will see the 2 root containers on both servers
To add a new container, click on +Create on top right hand corner of the page, select the parent container so it will run on the server base on the parent container. Then choose the profile you need to install on the container.
And we are done!
Published at DZone with permission of Christina Lin, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Extending Java APIs: Add Missing Features Without the Hassle
Comparing Cloud Hosting vs. Self Hosting
Observability Architecture: Financial Payments Introduction
Competing Consumers With Spring Boot and Hazelcast