未验证 提交 4c0147d0 编写于 作者: Q qiaozhanwei 提交者: GitHub

add LoggerServer RPC PORT modified. #1848 (#1849)

* fix #1775 bug,delete process definition when process instance is running

* revert CONTRIBUTING.md

* dockerfile modify

* dockerfile modify

* dockerfile modify

* remove install.sh server.servlet.context-path replace

* add LoggerServer RPC PORT modified. #1848
上级 cff8cc69
......@@ -444,9 +444,9 @@ public final class Constants {
/***
*
* rpc port
* logger server rpc port
*/
public static final int RPC_PORT = 50051;
public static final String LOGGER_SERVER_RPC_PORT = "loggerserver.rpc.port";
/**
* forbid running task
......
......@@ -92,3 +92,7 @@ yarn.resourcemanager.ha.rm.ids=192.168.xx.xx,192.168.xx.xx
yarn.application.status.address=http://ark1:8088/ws/v1/cluster/apps/%s
# logger server rpc port
loggerserver.rpc.port=50051
......@@ -24,6 +24,8 @@ import io.grpc.ServerBuilder;
import org.apache.dolphinscheduler.rpc.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.io.*;
import java.nio.file.Files;
......@@ -31,6 +33,7 @@ import java.nio.file.Paths;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.apache.dolphinscheduler.common.utils.PropertyUtils;
/**
* logger server
......@@ -50,7 +53,7 @@ public class LoggerServer {
*/
public void start() throws IOException {
/* The port on which the server should run */
int port = Constants.RPC_PORT;
int port = PropertyUtils.getInt(Constants.LOGGER_SERVER_RPC_PORT);
server = ServerBuilder.forPort(port)
.addService(new LogViewServiceGrpcImpl())
.build()
......@@ -114,7 +117,6 @@ public class LoggerServer {
request.getLimit());
List<String> list = readFile(request.getPath(), request.getSkipLineNum(), request.getLimit());
StringBuilder sb = new StringBuilder();
boolean errorLineFlag = false;
for (String line : list){
sb.append(line + "\r\n");
}
......@@ -215,7 +217,6 @@ public class LoggerServer {
StringBuilder sb = new StringBuilder();
try {
br = new BufferedReader(new InputStreamReader(new FileInputStream(path)));
boolean errorLineFlag = false;
while ((line = br.readLine()) != null){
sb.append(line + "\r\n");
}
......
......@@ -19,6 +19,7 @@ package org.apache.dolphinscheduler.server.utils;
import org.apache.dolphinscheduler.common.Constants;
import org.apache.dolphinscheduler.common.utils.CommonUtils;
import org.apache.dolphinscheduler.common.utils.OSUtils;
import org.apache.dolphinscheduler.common.utils.PropertyUtils;
import org.apache.dolphinscheduler.dao.entity.TaskInstance;
import org.apache.dolphinscheduler.server.rpc.LogClient;
import org.apache.commons.io.FileUtils;
......@@ -374,7 +375,8 @@ public class ProcessUtils {
public static void killYarnJob(TaskInstance taskInstance) {
try {
Thread.sleep(Constants.SLEEP_TIME_MILLIS);
LogClient logClient = new LogClient(taskInstance.getHost(), Constants.RPC_PORT);
int port = PropertyUtils.getInt(Constants.LOGGER_SERVER_RPC_PORT);
LogClient logClient = new LogClient(taskInstance.getHost(), port);
String log = logClient.viewLog(taskInstance.getLogPath());
if (StringUtils.isNotEmpty(log)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册