How do I update the Zookeeper URL for a Fabric Server?
Environment
- Red Hat JBoss Fuse
- 6.0
- 6.1
- 6.2
- 6.3
Issue
- How do I update the Zookeeper URL for a Fabric Server?
Resolution
The Zookeeper URL can be updated for a container as follows:
6.0
First find out what the correct zookeeper URL is from one of the operational nodes by running the following command:
config:list "(service.pid=org.fusesource.fabric.zookeeper)"
or
config:list | grep zookeeper.url
Make note of the zookeeper.url property as it will be needed in the next step.
JBossFuse:karaf@root> config:edit org.fusesource.fabric.zookeeper
JBossFuse:karaf@root> config:proplist
service.pid = org.fusesource.fabric.zookeeper
zookeeper.url = incorrect.host.name:2181
fabric.zookeeper.pid = org.fusesource.fabric.zookeeper
JBossFuse:karaf@root> config:propset zookeeper.url myHostName:port
JBossFuse:karaf@root> config:update
Where "myHostName:port" is the updated zookeeper URL you found in the first step.
6.1/6.2/6.3
First find out what the correct zookeeper URL is from one of the operational nodes by running the following command:
config:proplist -p io.fabric8.zookeeper
or
config:list | grep zookeeper.url
Make note of the zookeeper.url property as it will be needed in the next step.
JBossFuse:karaf@root> config:edit io.fabric8.zookeeper
JBossFuse:karaf@root> config:proplist
service.pid = io.fabric8.zookeeper
zookeeper.password = ZKENC=YWRtaW4=
zookeeper.url = incorrect.host.name:2181
fabric.zookeeper.pid = io.fabric8.zookeeper
JBossFuse:karaf@root> config:propset zookeeper.url myHostName:port
JBossFuse:karaf@root> config:update
Where "myHostName:port" is the updated zookeeper URL you found in the first step.
Root Cause
This issue was encountered when the Zookeeper ensemble was updated and a Fabric Container did not detect the change within the Fabric Ensemble.
Diagnostic Steps
The Zookeeper URL can be verified by running the following command on the Fabric Server:
JBossFuse:karaf@root> config:list "(service.pid=org.fusesource.fabric.zookeeper)"
When running a fabric:container-list with an invalid Zookeeper URL, the command shell will display the following error:
JBossFuse:karaf@root> fabric:container-list
Error executing command: java.lang.IllegalStateException: Error waiting for ZooKeeper connection
This issue was also encountered when Fabric was setup in a development environment on a laptop where the user worked from multiple locations. As the machine was moved from one location to another the hostname changed. In this case adding an alias to the machines /etc/hosts for the Fabric Servers hostname also resolved the issue e.g.
127.0.0.1 my.incorrect.hostname.com
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
