Unverified Commit 95f6e003 authored by Zzm0809's avatar Zzm0809 Committed by GitHub

[Feature] Implementing Yarn mode cluster configuration supports configuring the rs protocol (#3442)

parent 3695aaf9
...@@ -28,6 +28,7 @@ import org.dinky.gateway.config.AppConfig; ...@@ -28,6 +28,7 @@ import org.dinky.gateway.config.AppConfig;
import org.dinky.gateway.result.GatewayResult; import org.dinky.gateway.result.GatewayResult;
import org.dinky.gateway.result.YarnResult; import org.dinky.gateway.result.YarnResult;
import org.dinky.utils.LogUtil; import org.dinky.utils.LogUtil;
import org.dinky.utils.URLUtils;
import org.apache.flink.client.deployment.ClusterSpecification; import org.apache.flink.client.deployment.ClusterSpecification;
import org.apache.flink.client.deployment.application.ApplicationConfiguration; import org.apache.flink.client.deployment.application.ApplicationConfiguration;
...@@ -42,6 +43,8 @@ import java.util.Arrays; ...@@ -42,6 +43,8 @@ import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import cn.hutool.core.util.URLUtil;
/** /**
* YarnApplicationGateway * YarnApplicationGateway
* *
...@@ -54,6 +57,20 @@ public class YarnApplicationGateway extends YarnGateway { ...@@ -54,6 +57,20 @@ public class YarnApplicationGateway extends YarnGateway {
return GatewayType.YARN_APPLICATION; return GatewayType.YARN_APPLICATION;
} }
/**
* format url
* <p>if url is rs protocol, convert to file path</p>
* @param url url
* @return formatted url
*/
private String formatUrl(String url) {
if (URLUtil.url(url).getProtocol().equals("rs")) {
return URLUtils.toFile(url).getAbsolutePath();
} else {
return url;
}
}
@Override @Override
public GatewayResult submitJar(FlinkUdfPathContextHolder udfPathContextHolder) { public GatewayResult submitJar(FlinkUdfPathContextHolder udfPathContextHolder) {
if (Asserts.isNull(yarnClient)) { if (Asserts.isNull(yarnClient)) {
...@@ -61,7 +78,7 @@ public class YarnApplicationGateway extends YarnGateway { ...@@ -61,7 +78,7 @@ public class YarnApplicationGateway extends YarnGateway {
} }
AppConfig appConfig = config.getAppConfig(); AppConfig appConfig = config.getAppConfig();
configuration.set(PipelineOptions.JARS, Collections.singletonList(appConfig.getUserJarPath())); configuration.set(PipelineOptions.JARS, Collections.singletonList(formatUrl(appConfig.getUserJarPath())));
configuration.setString( configuration.setString(
"python.files", "python.files",
udfPathContextHolder.getPyUdfFile().stream().map(File::getName).collect(Collectors.joining(","))); udfPathContextHolder.getPyUdfFile().stream().map(File::getName).collect(Collectors.joining(",")));
......
...@@ -785,8 +785,10 @@ export default { ...@@ -785,8 +785,10 @@ export default {
'rc.cc.sqlSubmitJarPath': 'Jar File Path', 'rc.cc.sqlSubmitJarPath': 'Jar File Path',
'rc.cc.sqlSubmitJarPathHelp': 'rc.cc.sqlSubmitJarPathHelp':
'Please enter the Jar file path! eg: hdfs:///dinky/dinky-app-1.16-with-dependencies.jar', 'Please enter the Jar file path! eg: hdfs:///dinky/dinky-app-1.16-with-dependencies.jar',
'rc.cc.sqlSubmitJarPathHelpTips':
'In Yarn mode, this parameter can be set to: hdfs:///dinky/dinky-app-1.17-with-dependencies.jar Alternatively, if rs:/dinky/inky app 1.17 with dependencies. jar is set to the rs:/ protocol, the jar package needs to be uploaded to Dinky`s resource center and the path filled in. In K8s mode, only the local://protocol is supported',
'rc.cc.start': 'Start Session Cluster', 'rc.cc.start': 'Start Session Cluster',
'rc.cc.submitSqlConfig': 'Submit FlinkSQL Config items (required in Application mode)', 'rc.cc.submitSqlConfig': 'Submit FlinkSQL Config items',
'rc.cc.tmHeap': 'TaskManager Heap Memory', 'rc.cc.tmHeap': 'TaskManager Heap Memory',
'rc.cc.tmHeapHelp': 'rc.cc.tmHeapHelp':
'Please enter the TaskManager heap memory size! This parameter configuration item is', 'Please enter the TaskManager heap memory size! This parameter configuration item is',
......
...@@ -752,8 +752,10 @@ export default { ...@@ -752,8 +752,10 @@ export default {
'rc.cc.sqlSubmitJarPath': 'Jar 文件路径', 'rc.cc.sqlSubmitJarPath': 'Jar 文件路径',
'rc.cc.sqlSubmitJarPathHelp': 'rc.cc.sqlSubmitJarPathHelp':
'请输入 Jar 文件路径! eg: hdfs:///dinky/dinky-app-1.16-with-dependencies.jar', '请输入 Jar 文件路径! eg: hdfs:///dinky/dinky-app-1.16-with-dependencies.jar',
'rc.cc.sqlSubmitJarPathHelpTips':
'Yarn 模式下此参数可以设置为: hdfs:///dinky/dinky-app-1.17-with-dependencies.jar 或者 rs:/dinky/dinky-app-1.17-with-dependencies.jar 如果设置为 rs:/ 协议,则需要将该jar包上传到 Dinky 的资源中心中,然后填写该路径。K8s 模式下仅支持 local:// 协议',
'rc.cc.start': '启动 Session 集群', 'rc.cc.start': '启动 Session 集群',
'rc.cc.submitSqlConfig': '提交 FlinkSQL 配置项 (Application 模式必填)', 'rc.cc.submitSqlConfig': '提交 FlinkSQL 配置项',
'rc.cc.tmHeap': 'TaskManager 堆内存', 'rc.cc.tmHeap': 'TaskManager 堆内存',
'rc.cc.tmHeapHelp': '请输入 TaskManager 堆内存大小! 此参数配置项为', 'rc.cc.tmHeapHelp': '请输入 TaskManager 堆内存大小! 此参数配置项为',
'rc.cc.tmMem': 'TaskManager 内存', 'rc.cc.tmMem': 'TaskManager 内存',
......
...@@ -28,10 +28,16 @@ const ApplicationConfig = () => { ...@@ -28,10 +28,16 @@ const ApplicationConfig = () => {
<ProFormGroup labelLayout={'inline'}> <ProFormGroup labelLayout={'inline'}>
<ProFormText <ProFormText
width={'xl'} width={'xl'}
rules={[
{
required: true,
message: l('rc.cc.sqlSubmitJarPathHelp')
}
]}
name={['config', 'appConfig', 'userJarPath']} name={['config', 'appConfig', 'userJarPath']}
placeholder={l('rc.cc.sqlSubmitJarPathHelp')} placeholder={l('rc.cc.sqlSubmitJarPathHelp')}
label={l('rc.cc.sqlSubmitJarPath')} label={l('rc.cc.sqlSubmitJarPath')}
tooltip={l('rc.cc.sqlSubmitJarPathHelp')} tooltip={l('rc.cc.sqlSubmitJarPathHelpTips')}
/> />
</ProFormGroup> </ProFormGroup>
</> </>
......
...@@ -31,8 +31,10 @@ title: 集群 ...@@ -31,8 +31,10 @@ title: 集群
3. 自动注册的集群无需关心注册过多的情况, 系统会定时清理过期的 自动注册的 Flink 实例,手动注册的无影响 3. 自动注册的集群无需关心注册过多的情况, 系统会定时清理过期的 自动注册的 Flink 实例,手动注册的无影响
4. 手动注册的集群需要手动管理 Flink 实例, 如需删除 Flink 实例,请鼠标悬浮某一 Flink 实例,点击删除按钮即可删除 Flink 实例 4. 手动注册的集群需要手动管理 Flink 实例, 如需删除 Flink 实例,请鼠标悬浮某一 Flink 实例,点击删除按钮即可删除 Flink 实例
5. 提供手动进行心跳检测 5. 提供手动进行心跳检测
6. 所有Flink 实例删除前会进行引用检测,如果有引用,则无法删除(此为避免实际运行中的任务关联到该Flink 实例,从而导致一系列问题) 6. 所有Flink 实例删除前会进行引用检测,如果有引用,则无法删除(此为避免实际运行中的任务关联到该Flink
7. 手动注册的集群可以直接删除(前提是未被使用),如果自动注册的集群如果状态为`健康`需要先停止 Flink 实例,然后再删除 Flink 实例. 实例,从而导致一系列问题)
7. 手动注册的集群可以直接删除(前提是未被使用),如果自动注册的集群如果状态为`健康`需要先停止 Flink 实例,然后再删除 Flink
实例.
如需查看 自动注册 和 手动注册 下的 Flink 实例,请点击切换按钮进行查看 如需查看 自动注册 和 手动注册 下的 Flink 实例,请点击切换按钮进行查看
::: :::
...@@ -47,13 +49,13 @@ title: 集群 ...@@ -47,13 +49,13 @@ title: 集群
### 参数解读 ### 参数解读
| 参数 | 说明 | 是否必填 | 默认值 | 示例值 | | 参数 | 说明 | 是否必填 | 默认值 | 示例值 |
|-----------------|------------------------------------------------------------------------------------|:----:|:-----:|:-------------:| |------------------|----------------------------------------------------------------------------------|:----:|:-----:|:-------------:|
| 集群名称 | 集群名称, 用于区分不同集群 | 是 | 无 | flink-session | | 集群名称 | 集群名称, 用于区分不同集群 | 是 | 无 | flink-session |
| 集群别名 | 集群别名, 用于区分不同集群, 如不填默认同集群名称 | 否 | 同集群名称 | flink-session | | 集群别名 | 集群别名, 用于区分不同集群, 如不填默认同集群名称 | 否 | 同集群名称 | flink-session |
| 集群类型 | 集群类型, 目前支持 Local, Standalone, Yarn Session, Kubernetes Session | 是 | 无 | Standalone | | 集群类型 | 集群类型, 目前支持 Local, Standalone, Yarn Session, Kubernetes Session | 是 | 无 | Standalone |
| JobManager 高可用地址 | 添加 Flink 集群的 JobManager 的 RestApi 地址。当 HA 模式时,地址间用英文逗号分隔,例如:192.168.123.101:8081 | 是 | 无 | | JobManager 高可用地址 | 添加 Flink 集群的 JobManager 的 RestApi 地址。当 HA 模式时,地址间用英文逗号分隔,例如:192.168.123.101:8081 | 是 | 无 |
| 备注 | 备注, 用于备注集群信息 | 否 | 无 | flink-session | | 备注 | 备注, 用于备注集群信息 | 否 | 无 | flink-session |
## 集群配置 ## 集群配置
...@@ -91,9 +93,9 @@ title: 集群 ...@@ -91,9 +93,9 @@ title: 集群
- 提交 FlinkSQL 配置项 (Application 模式必填)-公共配置 - 提交 FlinkSQL 配置项 (Application 模式必填)-公共配置
| 参数 | 说明 | 是否必填 | 默认值 | 示例值 | | 参数 | 说明 | 是否必填 | 默认值 | 示例值 |
|----------|----------------------------------------------------------------------------------------------------------|:----:|:---:|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:| |----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:----:|:---:|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
| Jar 文件路径 | 指定 Jar 文件路径,如果该集群配置用于提交 Application 模式任务时 则必填<br/>需要包含以下文件:dinky-app-{version}-jar-with-dependencies.jar | 否 | 无 | hdfs:///dinky/dinky-app-1.16-1.0.0-SNAPSHOT-jar-with-dependencies.jar <br/>请注意: 如果使用 Kubernetes 模式,路径需要指定为: local:///dinky/dinky-app-1.16-1.0.0-SNAPSHOT-jar-with-dependencies.jar | | Jar 文件路径 | 指定 Jar 文件路径,如果该集群配置用于提交 Application 模式任务时 则必填<br/>需要包含以下文件:dinky-app-{version}-jar-with-dependencies.jar<br/>Yarn 模式下此参数可以设置为: hdfs:///dinky/dinky-app-1.17-with-dependencies.jar 或者 rs:/dinky/dinky-app-1.17-with-dependencies.jar <br/>如果设置为 rs:/ 协议,则需要将该jar包上传到 Dinky 的资源中心中,然后填写该路径。<br/>K8s 模式下仅支持 local:// 协议 | 是 | 无 | hdfs:///dinky/dinky-app-1.16-1.0.0-SNAPSHOT-jar-with-dependencies.jar <br/>请注意: 如果使用 Kubernetes 模式,路径需要指定为: local:///dinky/dinky-app-1.16-1.0.0-SNAPSHOT-jar-with-dependencies.jar |
- Flink 预设配置(高优先级)-公共配置 - Flink 预设配置(高优先级)-公共配置
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment