JBoss Fabric Zookeeper Troubleshooting

ZooKeeper is a centralized service for maintaining configuration information, naming, providing distributed synchronization, and providing group services. All of these kinds of services are used in some form or another by distributed applications.

JBoss Fuse Fabric uses this Zookeeper maintaining its configuration so that it could be accessible to all the containers in the fabric environment. Let’s look at some of the some of the issues we face or may face with Zookeeper in Fabric. Fabric container not detecting changes is done in Fabric Ensemble.

In your Fabric Ensemble, you can come across situations where you need to move the container to some other machine. Even if you move the server to another location, still the Zookeeper configuration needs to be updated with the latest hostname of the machine. One way of doing so is to add the previous hostname in the /etc/hosts something like shown below:

127.0.0.1 server0 server1

If the Zookeeper URL does not point to the updated or correct hostname, you can do the following steps:

Run the command on Karaf console to check the current Zookeeper URL it is pointing to.

Once you run the above command you can check to see the Zookeeper URL is updated.

It is sometimes seen that a fabric container behaves as it is not part of fabric anymore. In addition to this, we face an issue that we see that the process is running but no logs are written in the container. You’ll see an exception as:

This means the Zookeeper configuration is having a discrepancy with the number of containers running. To troubleshoot you need to compare the Zookeeper configuration with a running container and find the discrepancy and fix as above.

You can look for the zookeeper config file in the bundle cache at location:
Go to location ${karaf.home}/data/cache search for the zookeeper.config file.

The number of containers should equal to the number to comma-separated values in zookeeper.url. You can perform the steps mentioned at the start of the blog to update.

Click here to for an overview of Red Hat JBoss Fuse a lightweight and modular integration platform.

Download and learn more about Red Hat JBoss Fuse, an innovative modular, cloud-ready architecture, powerful management and automation, and world class developer productivity. It is Java™ EE 7 certified and features powerful, enterprise-grade features such as high availability clustering, distributed caching, messaging, transactions, and a full web services stack.