Testing Examples
ZooKeeper is used as the registration center. The provider registers its services with the registration center. The consumer obtains the address list of the service provider from the registration center.
- Start the ZooKeeper service.
cd /opt/zookeeper-3.4.14/bin/ sh zkServer.sh start

If Starting zookeeper ... STARTED is displayed, the Zookeeper service is started successfully.
- Check the ZooKeeper service status.
sh zkServer.sh status
- Check the Zookeeper process.
ps -ef | grep zookeeper
- Check the Zookeeper listening port.
netstat -anpt | grep 2181
- View the Zookeeper log information.
cat zookeeper.out
- Stop the ZooKeeper service.
cd /opt/zookeeper-3.4.14/bin/ sh zkServer.sh stop
- View the Zookeeper log information.
- Download dubbo-sample.
1 2 3
cd /home git config --global http.sslVerify false git clone https://github.com/apache/dubbo-samples.git
- Go to the /home/dubbo-samples/dubbo-samples-api directory.
1cd /home/dubbo-samples/dubbo-samples-api
- Start the provider.
1mvn clean package


1mvn -Djava.net.preferIPv4Stack=true -Dexec.mainClass=org.apache.dubbo.samples.provider.Application exec:java -Ddubbo.application.qos.port=33333 -Ddubbo.application.qos.enable=true -Ddubbo.application.qos.accept.foreign.ip=false


If dubbo service started is displayed, the provider is started successfully.
- View the listening port:
netstat -anpt | grep 33333 netstat -anpt | grep 20880

To stop the provider service, press Ctrl+C.
- Open a new window and go to the /home/dubbo-samples/dubbo-samples-api/ directory.
1cd /home/dubbo-samples/dubbo-samples-api/
- Start the consumer.
mvn clean package


1mvn -Djava.net.preferIPv4Stack=true -Dexec.mainClass=org.apache.dubbo.samples.client.Application exec:java -Dexec.cleanupDaemonThreads=false

If hi, dubbo is displayed, the consumer is started successfully.
Parent topic: Compilation