forked from apache/dolphinscheduler
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature][Standalone]Support using JDBC registry plugin in standalone…
… mode. apache#15103
- Loading branch information
Showing
6 changed files
with
146 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Introduction | ||
|
||
This module is used to start the dolphinscheduler in standalone mode. Currently Zookeeper and JDBC plugin are enabled as registries, depending on the properties configuration. | ||
|
||
# How to use | ||
|
||
1. Select the type of registry you want. The default is Zookeeper | ||
|
||
- If you have chosen Zookeeper as the registry, you can refer to the dollinscheduler-registry-plugins dollinscheduler-registry-Zookeeper readme.md documentation for configuration. (note: the default is of type Zookeeper, and a mock Zookeeper server is created, without the need to actually install ZK) | ||
- If you choose JDBC as the Registry, you can refer to the readme.md documentation for configuration | ||
|
||
|
||
|
||
|
||
## |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
...one-server/src/main/java/org/apache/dolphinscheduler/registry/JdbcStandaloneRegistry.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.dolphinscheduler.registry; | ||
|
||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
public class JdbcStandaloneRegistry implements StandaloneRegistry { | ||
|
||
@Override | ||
public void init() { | ||
|
||
} | ||
|
||
@Override | ||
public boolean supports(String registryType) { | ||
return "jdbc".equalsIgnoreCase(registryType); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
...ndalone-server/src/main/java/org/apache/dolphinscheduler/registry/StandaloneRegistry.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.dolphinscheduler.registry; | ||
|
||
public interface StandaloneRegistry { | ||
|
||
void init(); | ||
|
||
boolean supports(String registryType); | ||
} |
42 changes: 42 additions & 0 deletions
42
...erver/src/main/java/org/apache/dolphinscheduler/registry/ZookeeperStandaloneRegistry.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.dolphinscheduler.registry; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
import org.apache.curator.test.TestingServer; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Slf4j | ||
@Component | ||
public class ZookeeperStandaloneRegistry implements StandaloneRegistry { | ||
|
||
@Override | ||
public void init() { | ||
try { | ||
TestingServer zookeeperServer = new TestingServer(true); | ||
System.setProperty("registry.zookeeper.connect-string", "localhost:2181"); | ||
} catch (Exception ex) { | ||
log.error("Zookeeper TestingServer create failed", ex); | ||
} | ||
} | ||
|
||
@Override | ||
public boolean supports(String registryType) { | ||
return "zookeeper".equalsIgnoreCase(registryType); | ||
} | ||
} |