当前位置:网站首页>计算中间件 Apache Linkis参数解读
计算中间件 Apache Linkis参数解读
2022-07-05 14:44:00 【微众开源】
导语:本文主要对Linkis的参数体系进行介绍,包括Linkis服务端参数、客户端参数、管理台参数的介绍。
1. 参数分类
Linkis参数主要分为以下三个部分:
- Linkis 服务端参数,主要包含Linkis本身的参数和Spring的参数
- Linkis SDK、Restful等客户端端调用提交的参数
- Linkis 管理台参数
2. Linkis 服务端参数
(1)Linkis本身的参数
linkis本身的参数支持在配置文件里面进行设置,也支持通过环境变量和系统属性进行设置,推荐使用配置文件进行设置。
Linkis配置文件格式如下所示:
├──conf 配置目录 │ ├── application-eureka.yml│ ├── application-linkis.yml│ ├── linkis-cg-engineconnmanager.properties│ ├── linkis-cg-engineplugin.properties│ ├── linkis-cg-entrance.properties│ ├── linkis-cg-linkismanager.properties│ ├── linkis-mg-gateway.properties│ ├── linkis-ps-cs.properties│ ├── linkis-ps-data-source-manager.properties│ ├── linkis-ps-metadatamanager.properties│ ├── linkis-ps-publicservice.properties│ ├── linkis.properties│ ├── log4j2-console.xml│ ├── log4j2.xml每个服务会加载两个属性配置文件,一个为公用的主配置文件linkis.properties,以及服务配置文件linkis-serviceName.properties。设置的优先级为服务配置文件高于主配置文件建议通用的参数放置在主配置文件,个性配置文件放在服务配置文件
(2)Spring 参数Linkis服务是基于SpringBoot应用的,Spring相关的参数支持在application-linkis.yml进行设置,也支持在linkis配置文件里面进行配置。在linkis配置文件里面配置需要加上spring.的前缀。如下:
# spring port default server.port=9102# in linkis conf need spring prefixspring.server.port=91023. Linkis 客户端参数
Linkis客户端参数主要是指任务提交时的参数,主要在提交接口里面进行指定的参数。
(1)restful 如何设置参数:
{ "executionContent": {"code": "show tables", "runType": "sql"}, "params": { // 提交参数 "variable":{ //代码中需要的自定义变量 "k1":"v1" }, "configuration":{ "special":{ //特殊配置参数 如日志路径,结果集路径等 "k2":"v2" }, "runtime":{ //运行时参数,如JDBC引擎的的数据库连接参数,presto引擎的数据源参数 "k3":"v3" }, "startup":{ //启动参数,如启动EC的内存参数,spark引擎参数、hive引擎参数等 "k4":"v4" 如:spark.executor.memory:5G 设置Spark的执行器内存,底层Spark、hive等引擎参数keyName是和原生参数一致的 } } }, "labels": { //标签参数,支持设置引擎版本、用户和提应用 "engineType": "spark-2.4.3", "userCreator": "hadoop-IDE" }}(2)SDK如何设置参数:
注:注释在方法上面JobSubmitAction jobSubmitAction =JobSubmitAction.builder().addExecuteCode(code)//启动参数,如启动EC的内存参数,spark引擎参数、hive引擎参数等, 如:spark.executor.memory:5G 设置Spark的执行器内存,底层Spark、hive等引擎参数keyName是和原生参数一致的.setStartupParams(startupMap) //运行时参数,如JDBC引擎的的数据库连接参数,presto引擎的数据源参数.setRuntimeParams(runTimeMap) //代码中需要的自定义变量.setVariableMap(varMap) //标签参数,支持设置引擎版本、用户和提应用等.setLabels(labels)//submit user.setUser(user) // execute user.addExecuteUser(user) .build();(3)linkis-cli如何设置参数
linkis-cli -runtieMap key1=value -runtieMap key2=value -labelMap key1=value -varMap key1=value -startUpMap key1=value
注意: 客户端参数提交时,只有引擎相关参数和标签参数,以及Yarn队列设置可以生效,其他Linkis服务端参数和资源限制参数,如任务和引擎并发参数wds.linkis.rm.instances不支持任务设置
(4)常用标签参数:
Map<String, Object> labels = new HashMap<String, Object>(); labels.put(LabelKeyConstant.ENGINE_TYPE_KEY, "spark-2.4.3"); // 指定引擎类型和版本 labels.put(LabelKeyConstant.USER_CREATOR_TYPE_KEY, user + "-IDE");// 指定运行的用户和您的APPName labels.put(LabelKeyConstant.CODE_TYPE_KEY, "sql"); // 指定运行的脚本类型:spark支持:sql、scala、py;Hive:hql;shell:sh;python:python;presto:psql labels.put(LabelKeyConstant.JOB_RUNNING_TIMEOUT_KEY, "10");//job运行10s没完成自动发起Kill,单位为s labels.put(LabelKeyConstant.JOB_QUEUING_TIMEOUT_KEY, "10");//job排队超过10s没完成自动发起Kill,单位为s labels.put(LabelKeyConstant.RETRY_TIMEOUT_KEY, "10000");//job因为资源等原因失败重试的等待时间,单位为ms,如果因为队列资源不足的失败,会默认按间隔发起10次重试 labels.put(LabelKeyConstant.TENANT_KEY,"hduser02");//租户标签,任务如果指定了租户参数则任务会被路由到单独的ECM机器 labels.put(LabelKeyConstant.EXECUTE_ONCE_KEY,"");//执行一次标签,该参数不建议设置,设置后引擎不会复用任务运行完就会结束引擎,只有某个任务参数有特殊化的可以进行设置4. Linkis 管理台参数
Linkis管理台参数是方便用户指定资源限制参数和默认的任务参数提供的Web界面。全局配置参数:

主要包含了全局队列参数[wds.linkis.rm.yarnqueue],任务默认采用的Yarn队列,支持在客户端StartUPMap里面另外进行指定资源限制参数,这些参数不支持任务设置,支持管理台进行调整。
队列CPU使用上限[wds.linkis.rm.yarnqueue.cores.max],现阶段只支持限制Spark类型任务总队列资源的使用队列内存使用上限[wds.linkis.rm.yarnqueue.memory.max]全局各个引擎内存使用上限[wds.linkis.rm.client.memory.max] 该参数不是指总共只能使用的内存,而是指定某个Creator特定引擎总的内存使用,如限制IDE-SPARK任务只能使用10G内存全局各个引擎核心个数上限[wds.linkis.rm.client.core.max]该参数不是指总共只能使用的CPU,而是指定某个Creator特定引擎总的内存使用,如限制IDE-SPARK任务只能使用10Cores全局各个引擎最大并发数[wds.linkis.rm.instance],该参数有两层含义,一个是限制某个Creator特定引擎总共能启动多少个,以及限制某个Creator特定引擎任务同时能运行的任务数引擎配置参数:

主要指定引擎的启动参数和运行时参数,这些参数支持在客户端进行设置,建议使用客户端进行个性化提交设置,页面只设置默认值
5. 最后
社区当前正在举办征文大赛,最高奖励可得 “1000元京东卡+500元社区礼品”哦,点击下图查看详情

— END —
如何成为社区贡献者
1 ► 官方文档贡献。发现文档的不足、优化文档,持续更新文档等方式参与社区贡献。通过文档贡献,让开发者熟悉如何提交PR和真正参与到社区的建设。参考攻略:保姆级教程:如何成为Apache Linkis文档贡献者
2 ►代码贡献。我们梳理了社区中简单并且容易入门的的任务,非常适合新人做代码贡献。请查阅新手任务列表:https://github.com/apache/incubator-linkis/issues/1161
3 ►内容贡献:发布WeDataSphere开源组件相关的内容,包括但不限于安装部署教程、使用经验、案例实践等,形式不限,请投稿给小助手。例如:
4 ►社区答疑:积极在社区中进行答疑、分享技术、帮助开发者解决问题等;
5 ►其他:积极参与社区活动、成为社区志愿者、帮助社区宣传、为社区发展提供有效建议等;
边栏推荐
- 直播预告|如何借助自动化工具落地DevOps(文末福利)
- Solution of commercial supply chain collaboration platform in household appliance industry: lean supply chain system management, boosting enterprise intelligent manufacturing upgrading
- 两个BI开发,3000多张报表?如何做的到?
- GPS原始坐标转百度地图坐标(纯C代码)
- The function of qualifier in C language
- webRTC SDP mslabel lable
- 分享 12 个最常用的正则表达式,能解决你大部分问题
- Intelligent supply chain collaboration system solution for daily chemical products industry: digital intelligent SCM supply chain, which is the "acceleration" of enterprise transformation
- Section - left closed right open
- How can non-technical departments participate in Devops?
猜你喜欢

Chow Tai Fook fulfills the "centenary commitment" and sincerely serves to promote green environmental protection

Interview shock 62: what are the precautions for group by?

APR protocol and defense

黑马程序员-软件测试-10阶段2-linux和数据库-44-57为什么学习数据库,数据库分类关系型数据库的说明Navicat操作数据的说明,Navicat操作数据库连接说明,Navicat的基本使用,

Sharing the 12 most commonly used regular expressions can solve most of your problems

Thymeleaf th:with use of local variables

Solution of commercial supply chain collaboration platform in household appliance industry: lean supply chain system management, boosting enterprise intelligent manufacturing upgrading

【学习笔记】阶段测试1

Microframe technology won the "cloud tripod Award" at the global Cloud Computing Conference!

Under the crisis of enterprise development, is digital transformation the future savior of enterprises
随机推荐
Is the securities account given by the head teacher of qiniu school safe? Can I open an account?
How to protect user privacy without password authentication?
[C question set] of Ⅷ
做自媒体视频二次剪辑,怎样剪辑不算侵权
危机重重下的企业发展,数字化转型到底是不是企业未来救星
LeetCode_ 3 (longest substring without repeated characters)
裁员下的上海
Thymeleaf common functions
leetcode:881. lifeboat
Under the crisis of enterprise development, is digital transformation the future savior of enterprises
黑马程序员-软件测试-10阶段2-linux和数据库-44-57为什么学习数据库,数据库分类关系型数据库的说明Navicat操作数据的说明,Navicat操作数据库连接说明,Navicat的基本使用,
乌卡时代下,企业供应链管理体系的应对策略
美国费城发生“安全事故” 2名警察遭枪杀
循环不变式
浅谈Dataset和Dataloader在加载数据时如何调用到__getitem__()函数
LeetCode_ 2 (add two numbers)
Thymeleaf th:classappend属性追加 th:styleappend样式追加 th:data-自定义属性
Principle and performance analysis of lepton lossless compression
How to solve the problem of garbled code when installing dependency through NPM or yarn
一键更改多个文件名字