fix(executor-manager): 日志改为动态配置
This commit is contained in:
@@ -164,6 +164,7 @@ deploy:
|
|||||||
"[connector.hadoop.kerberos-principal]": ${deploy.runtime.user}/$\{hostname}.hdp.dc@ECLD.COM
|
"[connector.hadoop.kerberos-principal]": ${deploy.runtime.user}/$\{hostname}.hdp.dc@ECLD.COM
|
||||||
"[connector.hadoop.kerberos-keytab-path]": ${deploy.runtime.kerberos-keytab-path}
|
"[connector.hadoop.kerberos-keytab-path]": ${deploy.runtime.kerberos-keytab-path}
|
||||||
arguments:
|
arguments:
|
||||||
|
"[executor.loki-push-url]": ${deploy.runtime.loki.hudi-push-url}
|
||||||
"[executor.task-jar-path]": ${deploy.runtime.executor.task-jar-path}
|
"[executor.task-jar-path]": ${deploy.runtime.executor.task-jar-path}
|
||||||
"[executor.task-result-path]": ${deploy.runtime.executor.task-result-path}
|
"[executor.task-result-path]": ${deploy.runtime.executor.task-result-path}
|
||||||
service-web:
|
service-web:
|
||||||
|
|||||||
@@ -16,9 +16,18 @@ import org.springframework.stereotype.Component;
|
|||||||
public class ExecutorConfiguration {
|
public class ExecutorConfiguration {
|
||||||
private static final Logger logger = LoggerFactory.getLogger(ExecutorConfiguration.class);
|
private static final Logger logger = LoggerFactory.getLogger(ExecutorConfiguration.class);
|
||||||
|
|
||||||
|
private String lokiPushUrl;
|
||||||
private String taskJarPath;
|
private String taskJarPath;
|
||||||
private String taskResultPath;
|
private String taskResultPath;
|
||||||
|
|
||||||
|
public String getLokiPushUrl() {
|
||||||
|
return lokiPushUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLokiPushUrl(String lokiPushUrl) {
|
||||||
|
this.lokiPushUrl = lokiPushUrl;
|
||||||
|
}
|
||||||
|
|
||||||
public String getTaskJarPath() {
|
public String getTaskJarPath() {
|
||||||
return taskJarPath;
|
return taskJarPath;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import cn.hutool.core.util.IdUtil;
|
|||||||
import cn.hutool.core.util.ReUtil;
|
import cn.hutool.core.util.ReUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import com.lanyuanxiaoyao.service.common.Constants;
|
||||||
import com.lanyuanxiaoyao.service.executor.Runner;
|
import com.lanyuanxiaoyao.service.executor.Runner;
|
||||||
import com.lanyuanxiaoyao.service.executor.core.TaskConstants;
|
import com.lanyuanxiaoyao.service.executor.core.TaskConstants;
|
||||||
import com.lanyuanxiaoyao.service.executor.core.TaskContext;
|
import com.lanyuanxiaoyao.service.executor.core.TaskContext;
|
||||||
@@ -133,6 +134,7 @@ public class ExecutorTaskService {
|
|||||||
configuration.setString(YarnConfigOptions.APPLICATION_NAME, StrUtil.format("Service_Task {} #{}", name, taskId));
|
configuration.setString(YarnConfigOptions.APPLICATION_NAME, StrUtil.format("Service_Task {} #{}", name, taskId));
|
||||||
|
|
||||||
setEnvironment(configuration, "task_id", taskId);
|
setEnvironment(configuration, "task_id", taskId);
|
||||||
|
setEnvironment(configuration, Constants.LOKI_PUSH_URL, executorConfiguration.getLokiPushUrl());
|
||||||
|
|
||||||
// 业务jar包
|
// 业务jar包
|
||||||
String executorJarPath = getLatestExecutorJarPath();
|
String executorJarPath = getLatestExecutorJarPath();
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||||
<level>INFO</level>
|
<level>INFO</level>
|
||||||
</filter>
|
</filter>
|
||||||
<url>http://132.126.207.126:33100/loki/api/v1/push</url>
|
<url>${loki_push_url:- }</url>
|
||||||
<encoder>
|
<encoder>
|
||||||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [${HOSTNAME}] %-5level ${PID:- } --- [%t] %-40.40logger{39} #@# : %m%n</pattern>
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [${HOSTNAME}] %-5level ${PID:- } --- [%t] %-40.40logger{39} #@# : %m%n</pattern>
|
||||||
</encoder>
|
</encoder>
|
||||||
|
|||||||
Reference in New Issue
Block a user