Skip to content

Commit

Permalink
add spring boot on alert server (apache#872)
Browse files Browse the repository at this point in the history
* Remove useless dependencies and add jsp-2.1-6.1.14

* Determine if principal is empty in getJdbcUrl method

* fix bug  when register worker but create master node in zookeeper

* Remove useless dependencies such as hive-shims and log4j

* upgrade commons-email from 1.2 to 1.5 and remove mail-1.4.5.jar

* add support for postgresql in upgrade database

* add support for postgresql in upgrade database

* update mysql in upgrade from 1.1.0 to next version

* add table name change ddl

* add spring boot on alert server
  • Loading branch information
lgcareer authored and qiaozhanwei committed Sep 24, 2019
1 parent 6525440 commit 5a13c4c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,33 @@
import cn.escheduler.alert.utils.Constants;
import cn.escheduler.common.thread.Stopper;
import cn.escheduler.dao.AlertDao;
import cn.escheduler.dao.DaoFactory;
import cn.escheduler.dao.model.Alert;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.context.annotation.ComponentScan;

import java.util.List;

/**
* alert of start
*/
public class AlertServer {
@ComponentScan("cn.escheduler")
public class AlertServer implements CommandLineRunner {
private static final Logger logger = LoggerFactory.getLogger(AlertServer.class);
/**
* Alert Dao
*/
private AlertDao alertDao = DaoFactory.getDaoInstance(AlertDao.class);
@Autowired
private AlertDao alertDao;

private AlertSender alertSender;

private static volatile AlertServer instance;

private AlertServer() {
public AlertServer() {

}

Expand Down Expand Up @@ -72,7 +77,12 @@ public void start(){


public static void main(String[] args){
SpringApplication app = new SpringApplication(AlertServer.class);
app.run(args);
}

@Override
public void run(String... strings) throws Exception {
AlertServer alertServer = AlertServer.getInstance();
alertServer.start();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
logging.config=classpath:alert_logback.xml

# server port
server.port=7789

2 changes: 1 addition & 1 deletion script/escheduler-daemon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ elif [ "$command" = "worker-server" ]; then
LOG_FILE="-Dspring.config.location=conf/application_worker.properties -Ddruid.mysql.usePingMethod=false"
CLASS=cn.escheduler.server.worker.WorkerServer
elif [ "$command" = "alert-server" ]; then
LOG_FILE="-Dlogback.configurationFile=conf/alert_logback.xml"
LOG_FILE="-Dspring.config.location=conf/application_alert.properties -Ddruid.mysql.usePingMethod=false"
CLASS=cn.escheduler.alert.AlertServer
elif [ "$command" = "logger-server" ]; then
CLASS=cn.escheduler.server.rpc.LoggerServer
Expand Down

0 comments on commit 5a13c4c

Please sign in to comment.