home/versioned_docs/version-1.8.0/help/zookeeper_sd.md
HertzBeat integrates with Zookeeper to automatically discover service instances stored in Zookeeper nodes and create monitoring tasks for them.
Zookeeper Service Discovery allows HertzBeat to connect to your Zookeeper server and automatically discover service instance information stored in specific path nodes. This is commonly used in Dubbo and other RPC frameworks that use Zookeeper as a registry center. When service instances change, HertzBeat will automatically create or delete corresponding monitoring tasks.
| Parameter name | Parameter help description |
|---|---|
| Target Name | Identify the name of this monitoring. The name needs to be unique. |
| Service Discovery Url | Zookeeper server connection address. Example: 192.168.1.100:2181 or zk1:2181,zk2:2181,zk3:2181 (cluster mode) |
| Service Discovery Path Prefix | The path prefix in Zookeeper for service discovery. Example: /dubbo or /services |
| Collection interval | Interval time of monitor periodic data collection, unit: second, and the minimum interval that can be set is 30 seconds. |
| Description remarks | For more information about identifying and describing this monitoring, users can note information here. |
Create Service Discovery Monitoring
Configure Monitoring Template
Automatic Discovery
View Discovered Instances
Suppose you have a Dubbo service registry running in Zookeeper at 192.168.1.100:2181, and service information is stored under the /dubbo path.
Configuration example:
Zookeeper-Dubbo-Discovery192.168.1.100:2181/dubbo60 secondsPort monitoringAfter configuration:
/dubbo pathIf you have a custom service registration mechanism using Zookeeper, and service information is stored under the /services path:
zk1:2181,zk2:2181,zk3:2181 (Zookeeper cluster)/servicesHertzBeat will discover all service instances under this path.
192.168.1.101:8080 or similar formats| Metric name | Metric unit | Metric help description |
|---|---|---|
| target | none | Discovered service instance target |
| host | none | Service instance host address |
| port | none | Service instance port number |
For Dubbo services, typical Zookeeper path structures include:
/dubbo/{serviceName}/providers - Service provider addresses/dubbo/{serviceName}/consumers - Service consumer addresses/dubbo/{serviceName}/routers - Routing rules/dubbo/{serviceName}/configurators - Configuration overridesWhen using Zookeeper service discovery with Dubbo, it's recommended to set the path prefix to /dubbo to discover all Dubbo services.