当前位置:网站首页>dolphinscheduler单机化改造
dolphinscheduler单机化改造
2022-07-30 12:15:00 【上帝】
dolphinscheduler单机化改造
转载请注明出处: https://www.cnblogs.com/funnyzpc/p/16466920.html
前面
其实如果单机的话直接走standalone-server就可以了,简单又快捷,如果更改的话 后期要升级可能又需要维护个版本才可,所以简单用standalone-server是最合适的。 好了,就说说我碰到的standalone-server模式下的一些不便的地方以及解决思路,还有种种折腾
standalone-server下没有日志
这是个很坑的问题,非常不利于调试,以下这是官方 dolphinscheduler-daemon.sh 的代码片段
elif [ "$command" = "standalone-server" ]; then
CLASS=org.apache.dolphinscheduler.server.StandaloneServer
export SPRING_PROFILES_ACTIVE="${SPRING_PROFILES_ACTIVE},standalone,${DATABASE_TYPE}"所以你大概需要改成这样:
elif [ "$command" = "standalone-server" ]; then
LOG_FILE="-Dlogging.config=classpath:logback-master.xml"
CLASS=org.apache.dolphinscheduler.server.StandaloneServer
export SPRING_PROFILES_ACTIVE="${SPRING_PROFILES_ACTIVE},standalone,${DATABASE_TYPE}"对于ide调试需要添加此参数:
任务执行用户与系统用户强绑定问题
你是不是系统搭建起来了,也创建worker账户了 而且也正确创建任务了 发现任务总执行失败呢,这个时候就该注意是不是linux没有创建对应worker同名的账户呢/(ㄒoㄒ)/~~ ,我也碰到了,也是看源码才知道的,所以在单机模式下有必要将这个限制去掉哈 (TaskExecuteThread)
这样下来,以后不管什么账户都是可以执行任务了,注意这功能不要在集群模式下去掉,至少为了安全吧~
standalone-server下用的是h2数据库
这是个坑,h2你可以理解为应用级别的内存表,很显然当你重启应用了数据就全丢失啦,刺不刺激意不意外 对于这个问题,很显然需要将数据库改为mysql或者postgresql(主要是目前官方只支持这两款数据库作为项目数据库),需要改的地方大致有两处:
- 一个地方是配置文件,在部署服务器
config目录下
- 还一个地方是启动类
StandaloneServer
对于配置文件肯定是要改的,至于这个配置文件也可以在启动命令行中指定此配置文件,以上只是个投机取巧的做法,也避免了修改启动脚本
去掉zookeeperclient及依赖
因为集群环境的复杂性,所以需要任务有zookeeper,但对于单机也就冗余复杂了,所以就索性去掉之
这里是从MasterServer开始移除zk支持,所以代码也是大改,所有关联的全部被我去掉了,太麻烦了。。。具体你们可以试试
日志可以不用rpc
本来到这一步应该也结束了,跑了几个任务发现没得日志,检查了下才发现代码告诉我他们是用 netty 实现了个rpc,使用前需要启动日志模块(standalone-server下默认不会启动此模块),日志用rpc调用logger模块来查询日志。。。,咋办,继续改。。。
主要也就以上两个地方需要修改,具体的可以参见我的源码(开头有提~)
简化不必要的启动模块
这其实是顺带做的,启动类 StandaloneServer 我去掉了TestingServer、AlertServer、PythonGatewayServer ,去掉后启动速度及资源占用有提升 下面是具体代码:
@EnableAutoConfiguration
@ComponentScan
public class StandaloneServer {
public static void main(String[] args) throws Exception {
// final TestingServer server = new TestingServer(true);
// System.setProperty("registry.servers", server.getConnectString());
new SpringApplicationBuilder(
ApiApplicationServer.class,
MasterServer.class,
WorkerServer.class
// AlertServer.class
// PythonGatewayServer.class
).profiles("master", "worker", "api",/* "alert", "python-gateway", "h2",*/ "standalone","postgresql").run(args);
}
}修改worker执行主机host获取方式
这也是个坑,主要是源码基于集群考虑这个问题,单机还是得修改才可:
以上两处只是关键部分,对于此问题修改的地方不止以上两处,具体可以参见我源码哈
边栏推荐
- SQL 根据时间范围查询数据
- 多表联查的学习
- What happened when the computer crashed?
- Execution order of select, from, join, on where groupby, etc. in MySQL
- Apifox generates interface documentation tutorial and operation steps
- 反转链表-迭代反转法
- I built another wheel: GrpcGateway
- 崩了,该来的终究躲不掉
- Reverse linked list - iterative inversion method
- LeetCode_236_Last Common Ancestor of a Binary Tree
猜你喜欢

崩了,该来的终究躲不掉

私有化部署的即时通讯平台,为企业移动业务安全保驾护航

概率论的学习整理4:全概率公式

PyQt5快速开发与实战 8.4 设置窗口背景 && 8.5 不规则窗口的显示

Apifox generates interface documentation tutorial and operation steps

周鸿祎:微软抄袭了360安全模式 所以成为美国最大的安全公司

Another blast!Ali's popular MySQL advanced collection is open source, reaching P7

历时两月,终拿字节跳动offer,算法面试题分享「带答案」
![[BJDCTF2020]Cookie is so stable-1|SSTI注入](/img/48/34955bbe3460ef09a5b8213c7cc161.png)
[BJDCTF2020]Cookie is so stable-1|SSTI注入

Verilog grammar basics HDL Bits training 07
随机推荐
概率论的学习整理2:如何对随机实验的对象:“事件” 进行计数呢? 四种计数方法,不只是排列组合
双击Idea图标打不开——解决办法
Another blast!Ali's popular MySQL advanced collection is open source, reaching P7
Apifox generates interface documentation tutorial and operation steps
External Force Estimation Based on Time Delay Estimation with Perturbed Kalman Filter
反转链表-迭代反转法
What happened when the computer crashed?
Zhou Hongyi: Microsoft copied the 360 security model and became the largest security company in the United States
TensorFlow custom training function
MySQL【排序与分页】
[BJDCTF2020]Cookie is so stable-1|SSTI注入
LinkedList与链表
【Kaggle:UW-Madison GI Tract Image Segmentation】肠胃分割比赛:赛后复盘+数据再理解
【32. 图中的层次(图的广度优先遍历)】
saltstack学习1入门基础
A tutorial on how to build a php environment under win
反转链表-递归反转法
CMake库搜索函数居然不搜索LD_LIBRARY_PATH
Unity Beginner 6 - Simple UI production (blood bar production) and audio addition and NPC dialogue bubbles (2d)
I built another wheel: GrpcGateway