kezhenxu94 commented on a change in pull request #6480:
URL: https://github.com/apache/dolphinscheduler/pull/6480#discussion_r727065266



##########
File path: 
dolphinscheduler-standalone-server/src/main/java/org/apache/dolphinscheduler/server/StandaloneServer.java
##########
@@ -0,0 +1,99 @@
+/*
+ * 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.server;
+
+import static 
org.apache.dolphinscheduler.common.Constants.SPRING_DATASOURCE_DRIVER_CLASS_NAME;
+import static 
org.apache.dolphinscheduler.common.Constants.SPRING_DATASOURCE_PASSWORD;
+import static 
org.apache.dolphinscheduler.common.Constants.SPRING_DATASOURCE_URL;
+import static 
org.apache.dolphinscheduler.common.Constants.SPRING_DATASOURCE_USERNAME;
+
+import org.apache.dolphinscheduler.alert.AlertServer;
+import org.apache.dolphinscheduler.api.ApiApplicationServer;
+import org.apache.dolphinscheduler.common.utils.ScriptRunner;
+import org.apache.dolphinscheduler.dao.datasource.ConnectionFactory;
+import org.apache.dolphinscheduler.server.master.MasterServer;
+import org.apache.dolphinscheduler.server.worker.WorkerServer;
+
+import org.apache.curator.test.TestingServer;
+
+import java.io.FileReader;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.sql.SQLException;
+
+import javax.sql.DataSource;
+
+import org.h2.tools.Server;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.builder.SpringApplicationBuilder;
+
+@SpringBootApplication
+public class StandaloneServer {
+    private static final Logger LOGGER = 
LoggerFactory.getLogger(StandaloneServer.class);
+
+    public static void main(String[] args) throws Exception {
+        Thread.currentThread().setName("Standalone-Server");
+
+        System.setProperty("spring.profiles.active", "api");
+
+        startDatabase();
+
+        startRegistry();
+
+       // startAlertServer();
+
+        new SpringApplicationBuilder(
+                ApiApplicationServer.class,
+                MasterServer.class,
+                WorkerServer.class
+        ).run(args);
+    }
+
+    private static void startAlertServer() {
+        AlertServer.getInstance().start();
+    }

Review comment:
       Can you cherry-pick this part from the latest `dev` branch and uncomment 
line 61 to enable alert server?
   
   ```suggestion
       private static void startAlertServer() {
           final Path alertPluginPath = Paths.get(
                   
StandaloneServer.class.getProtectionDomain().getCodeSource().getLocation().getPath(),
                   
"../../../dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/pom.xml"
           ).toAbsolutePath();
           if (Files.exists(alertPluginPath)) {
               System.setProperty("alert.plugin.binding", 
alertPluginPath.toString());
               System.setProperty("alert.plugin.dir", "");
           }
           AlertServer.getInstance().start();
       }
   ```

##########
File path: 
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/zk/ZookeeperConfig.java
##########
@@ -56,6 +58,9 @@
     private int maxWaitTime;
 
     public String getServerList() {
+        if(StringUtils.isNotBlank(System.getProperty("zookeeper.quorum"))){

Review comment:
       Seems it's not formatted

##########
File path: 
dolphinscheduler-standalone-server/src/main/java/org/apache/dolphinscheduler/server/StandaloneServer.java
##########
@@ -0,0 +1,99 @@
+/*
+ * 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.server;
+
+import static 
org.apache.dolphinscheduler.common.Constants.SPRING_DATASOURCE_DRIVER_CLASS_NAME;
+import static 
org.apache.dolphinscheduler.common.Constants.SPRING_DATASOURCE_PASSWORD;
+import static 
org.apache.dolphinscheduler.common.Constants.SPRING_DATASOURCE_URL;
+import static 
org.apache.dolphinscheduler.common.Constants.SPRING_DATASOURCE_USERNAME;
+
+import org.apache.dolphinscheduler.alert.AlertServer;
+import org.apache.dolphinscheduler.api.ApiApplicationServer;
+import org.apache.dolphinscheduler.common.utils.ScriptRunner;
+import org.apache.dolphinscheduler.dao.datasource.ConnectionFactory;
+import org.apache.dolphinscheduler.server.master.MasterServer;
+import org.apache.dolphinscheduler.server.worker.WorkerServer;
+
+import org.apache.curator.test.TestingServer;
+
+import java.io.FileReader;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.sql.SQLException;
+
+import javax.sql.DataSource;
+
+import org.h2.tools.Server;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.builder.SpringApplicationBuilder;
+
+@SpringBootApplication
+public class StandaloneServer {
+    private static final Logger LOGGER = 
LoggerFactory.getLogger(StandaloneServer.class);
+
+    public static void main(String[] args) throws Exception {
+        Thread.currentThread().setName("Standalone-Server");
+
+        System.setProperty("spring.profiles.active", "api");
+
+        startDatabase();
+
+        startRegistry();
+
+       // startAlertServer();
+
+        new SpringApplicationBuilder(
+                ApiApplicationServer.class,
+                MasterServer.class,
+                WorkerServer.class
+        ).run(args);
+    }
+
+    private static void startAlertServer() {
+        AlertServer.getInstance().start();
+    }

Review comment:
       Well, the settings are totally different between this branch and `dev` 
branch?
   
   I can see
   
   ```properties
   alert.type=EMAIL
   plugin.dir=/Users/xx/your/path/to/plugin/dir
   ```
   
   vs 
   
   ```properties
   alert.plugin.binding=
   alert.plugin.dir=




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to