2022-09-17 11:33:32 +08:00
## Function
DS use registry to do the below three things:
2022-09-06 22:25:19 +08:00
1. Store the metadata of master/worker so that it can get notify when nodes up and down.
2. Store the metadata of worker to do load balance.
2022-09-17 11:33:32 +08:00
3. Acquire a global lock when do failover.
2022-09-06 22:25:19 +08:00
2022-09-17 11:33:32 +08:00
So for DS, the registry need to notify the server when the server subscribe data have added/deleted/updated, support a way to create/release a global lock,
2022-09-06 22:25:19 +08:00
delete the server's metadata when server down.
## How to use
2022-09-17 11:33:32 +08:00
2022-09-06 22:25:19 +08:00
At present, we have implements three registry: Zookeeper(Default),Etcd,Mysql. If you
want to use them, you should config it at resource/application.yaml. The configuration details
2022-09-17 11:33:32 +08:00
can be viewed in the README of plugin under Module dolphinscheduler-registry-plugins
2022-09-06 22:25:19 +08:00
## Module
### dolphinscheduler-registry-all
2022-09-17 11:33:32 +08:00
This module is used for exporting the implemention of registry.
If you want to add new registry,you should add the dependency in the pom.xml
2022-09-06 22:25:19 +08:00
### dolphinscheduler-registry-api
2022-09-17 11:33:32 +08:00
2022-09-06 22:25:19 +08:00
This module contains the relevant interfaces involved in the use of the registry.
The following are several important interfaces
1. Registry Interface: If you want to implement your own registry, you just need to implement this interface
2. ConnectionListener Interface: This interface is responsible for the connection status between the client and the registry,
2022-09-17 11:33:32 +08:00
The connection state can be viewed in ConnectionState.java
2022-09-06 22:25:19 +08:00
3. SubscribeListener Interface: This interface is responsible for monitoring the state changes of child nodes under the specified prefix.
Event content can be viewed in event.java
### dolphinscheduler-registry-plugins
2022-09-17 11:33:32 +08:00
This module contains all registry implementations in DS