How to Deploy Dubbo with Zookeeper on CentOS: Step‑by‑Step Guide

This guide walks through installing prerequisites, configuring Zookeeper as a registry, setting up Dubbo, and deploying Tomcat to access the Dubbo web console on a CentOS 6.9 environment.

Full-Stack DevOps & Kubernetes
Full-Stack DevOps & Kubernetes
Full-Stack DevOps & Kubernetes
How to Deploy Dubbo with Zookeeper on CentOS: Step‑by‑Step Guide

Overview

Dubbo is an open‑source Java RPC framework that can use Apache Zookeeper as its service registry. Zookeeper provides centralized configuration, naming, synchronization, and group services.

1. Prepare the system

yum install -y gcc gcc-c++ vim-enhanced glibc make unzip openssl openssl-devel openssh-server openssh-clients wget

2. Synchronize time

yum install -y ntp
/usr/sbin/ntpdate cn.pool.ntp.org
# Add to crontab to run hourly
* */1 * * * /usr/sbin/ntpdate cn.pool.ntp.org > /dev/null 2>&1

3. Install JDK and Zookeeper on 192.168.199.175

rpm -ivh jdk-7u55-linux-x64.rpm
tar zxvf zookeeper-3.4.5.tar.gz
cd zookeeper-3.4.5
cp conf/zoo_sample.cfg conf/zoo.cfg

Edit conf/zoo.cfg with:

tickTime=2000
initLimit=10
syncLimit=5
dataDir=/dubbo/zookeeper/data
clientPort=2181
server.1=192.168.199.175:2555:3555
server.2=192.168.199.176:2555:3555

Create data directory and set the server id:

mkdir -p /dubbo/zookeeper/data
touch /dubbo/zookeeper/data/myid
echo 1 > /dubbo/zookeeper/data/myid

4. Install JDK and Zookeeper on 192.168.199.176

Repeat the steps above, but set myid to 2:

rpm -ivh jdk-7u55-linux-x64.rpm
tar zxvf zookeeper-3.4.5.tar.gz
cd zookeeper-3.4.5
cp conf/zoo_sample.cfg conf/zoo.cfg
# same zoo.cfg content as host 175
mkdir -p /dubbo/zookeeper/data
touch /dubbo/zookeeper/data/myid
echo 2 > /dubbo/zookeeper/data/myid

5. Start Zookeeper

On each host:

cd /root/zookeeper-3.4.5/bin
./zkServer.sh start

Successful start prints:

JMX enabled by default
Using config: /root/zookeeper-3.4.5/conf/zoo.cfg
Starting zookeeper ... STARTED

6. Deploy Dubbo admin console on 192.168.199.175

tar zxvf apache-tomcat-7.0.14.tar.gz
cd apache-tomcat-7.0.14
rm -rf webapps/ROOT
unzip /root/dubbo-admin-2.4.1.war -d webapps/ROOT

Edit webapps/ROOT/WEB-INF/dubbo.properties:

dubbo.registry.address=zookeeper://192.168.199.175:2181
dubbo.admin.root.password=root
dubbo.admin.guest.password=guest

Start Tomcat:

cd bin
sh startup.sh

7. Verify deployment

Open a browser to http://192.168.199.175:8080. Log in with username root and password root. The Dubbo management console appears, confirming that Zookeeper and Dubbo are correctly configured and running.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

DubboZooKeeperservice registrydeployment guideCentOSJava RPC
Full-Stack DevOps & Kubernetes
Written by

Full-Stack DevOps & Kubernetes

Focused on sharing DevOps, Kubernetes, Linux, Docker, Istio, microservices, Spring Cloud, Python, Go, databases, Nginx, Tomcat, cloud computing, and related technologies.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.