From 29aa5c2e23d4eaf0f8dee0754e885ac6521f43f1 Mon Sep 17 00:00:00 2001 From: Zzm0809 <934230207@qq.com> Date: Wed, 5 Jun 2024 15:26:42 +0800 Subject: [PATCH] [Doc] Document version archive 1.0 (#3560) Signed-off-by: Zzm0809 <934230207@qq.com> --- docs/docs/developer_guide/local_debug.md | 7 +- docs/docusaurus.config.js | 18 +- .../current.json | 6 +- .../version-1.0.json | 118 ++++++ .../en/docusaurus-theme-classic/footer.json | 4 +- .../current.json | 6 +- .../version-1.0.json | 118 ++++++ .../zh/docusaurus-theme-classic/footer.json | 4 +- .../versioned_docs/version-1.0/comminicate.md | 19 + .../version-1.0/deploy_guide/_category_.json | 4 + .../deploy_guide/compile_deploy.md | 127 ++++++ .../version-1.0/deploy_guide/docker_deploy.md | 131 ++++++ .../deploy_guide/kubernetes_deploy.md | 363 +++++++++++++++++ .../deploy_guide/normal_deploy.mdx | 258 ++++++++++++ .../deploy_guide/upgrade/_category_.json | 4 + .../deploy_guide/upgrade/upgrade_075to100.md | 52 +++ .../deploy_guide/upgrade/upgrade_overview.md | 18 + .../developer_guide/_category_.json | 4 + .../contribution/_category_.json | 4 + .../developer_guide/contribution/auto_sync.md | 19 + .../contribution/code_format.md | 66 +++ .../contribution/commit_code.md | 86 ++++ .../contribution/commit_message.md | 97 +++++ .../developer_guide/contribution/document.md | 52 +++ .../contribution/how_contribute.md | 59 +++ .../developer_guide/contribution/issue.md | 152 +++++++ .../contribution/pull_request.md | 55 +++ .../developer_guide/local_debug.md | 220 ++++++++++ .../version-1.0/extend/_category_.json | 4 + .../extend/expand_statements/_category_.json | 4 + .../expand_statements/add_file_statement.md | 59 +++ .../expand_statements/add_jar_statement.md | 50 +++ .../expand_statements/aggtable_statement.md | 66 +++ .../create_temporal_function.md | 34 ++ .../extend/expand_statements/execute_jar.md | 60 +++ .../expand_statements/flinkcdc_pipeline.md | 57 +++ .../extend/expand_statements/print_table.md | 45 +++ .../expand_statements/variable_statement.md | 78 ++++ .../extend/function_expansion/_category_.json | 4 + .../function_expansion/global_var_ext.md | 43 ++ docs/versioned_docs/version-1.0/faq.md | 240 +++++++++++ .../version-1.0/get_started/_category_.json | 4 + .../version-1.0/get_started/overview.md | 35 ++ .../get_started/quick_experience.md | 130 ++++++ .../version-1.0/openapi/CancelFlinkJob.md | 80 ++++ .../version-1.0/openapi/ExplainSql.md | 177 ++++++++ .../version-1.0/openapi/ExportSql.md | 78 ++++ .../version-1.0/openapi/GetJobInstance.md | 96 +++++ .../openapi/GetJobInstanceByTaskId.md | 96 +++++ .../version-1.0/openapi/GetJobPlan.md | 202 ++++++++++ .../version-1.0/openapi/GetStreamGraph.md | 201 ++++++++++ .../version-1.0/openapi/GetTaskLineage.md | 76 ++++ .../version-1.0/openapi/RestartTask.md | 190 +++++++++ .../version-1.0/openapi/SavepointTrigger.md | 113 ++++++ .../version-1.0/openapi/SubmitTaskById.md | 194 +++++++++ .../version-1.0/openapi/SubmitTaskJob.md | 196 +++++++++ .../version-1.0/openapi/_category_.json | 4 + .../version-1.0/openapi/openapi_overview.md | 379 ++++++++++++++++++ .../Integration_practice/_category_.json | 4 + .../dinky_integration_ds.md | 156 +++++++ .../dinky_integration_flink.md | 276 +++++++++++++ .../practical_guide/_category_.json | 4 + .../cdcsource_practice/_category_.json | 4 + .../cdcsource_practice/cdcsource_faq.md | 55 +++ .../cdcsource_mysqlcdc2ck.md | 50 +++ .../cdcsource_mysqlcdc2dinkycatalog.md | 31 ++ .../cdcsource_mysqlcdc2doris.md | 82 ++++ .../cdcsource_mysqlcdc2hivecatalog.md | 31 ++ .../cdcsource_mysqlcdc2hudi.md | 71 ++++ .../cdcsource_mysqlcdc2kafka.md | 88 ++++ .../cdcsource_mysqlcdc2multiplesink.md | 54 +++ .../cdcsource_mysqlcdc2mysql.md | 80 ++++ .../cdcsource_mysqlcdc2oracle.md | 45 +++ .../cdcsource_mysqlcdc2paimon.md | 63 +++ .../cdcsource_mysqlcdc2pg.md | 47 +++ .../cdcsource_mysqlcdc2print.md | 32 ++ .../cdcsource_mysqlcdc2starrocks.md | 51 +++ .../cdcsource_practice/cdcsource_overview.md | 151 +++++++ .../run_mode_practice/_category_.json | 4 + .../application_model_submit.md | 53 +++ .../dinky_k8s_quick_start.mdx | 199 +++++++++ .../k8s_native_model_submit.md | 8 + .../k8s_operater_model_submit.md | 8 + .../k8s_session_model_submit.md | 8 + .../run_mode_practice/local_model_submit.md | 8 + .../run_mode_practice/projob_model_submit.md | 8 + .../standalone_model_submit.md | 8 + .../yarnsession_model_submit.md | 8 + .../scenario_practice/_category_.json | 4 + .../scenario_practice/mysqlcdc2doris.md | 8 + .../scenario_practice/mysqlcdc2hudi.md | 7 + .../scenario_practice/mysqlcdc2paimon.md | 7 + .../scenario_practice/mysqlcdc2starrocks.md | 7 + docs/versioned_docs/version-1.0/roadmap.md | 22 + docs/versioned_docs/version-1.0/thanks.md | 58 +++ .../version-1.0/user_guide/_category_.json | 4 + .../user_guide/auth_center/_category_.json | 4 + .../user_guide/auth_center/menu.md | 43 ++ .../user_guide/auth_center/role.md | 44 ++ .../user_guide/auth_center/row_limits.md | 29 ++ .../user_guide/auth_center/tenant.md | 35 ++ .../user_guide/auth_center/token.md | 30 ++ .../user_guide/auth_center/user.md | 96 +++++ .../user_guide/devops_center/_category_.json | 4 + .../user_guide/devops_center/job_details.md | 112 ++++++ .../user_guide/devops_center/job_overview.md | 55 +++ .../user_guide/metrics_overview.md | 28 ++ .../register_center/_category_.json | 4 + .../register_center/alert/_category_.json | 4 + .../register_center/alert/alert_group.md | 27 ++ .../register_center/alert/alert_instance.md | 178 ++++++++ .../register_center/alert/alert_overview.md | 36 ++ .../register_center/alert/alert_strategy.md | 50 +++ .../register_center/alert/alert_template.md | 56 +++ .../register_center/cluster_manage.md | 165 ++++++++ .../register_center/datasource_manage.md | 133 ++++++ .../register_center/document_manager.md | 42 ++ .../user_guide/register_center/git_project.md | 38 ++ .../user_guide/register_center/global_var.md | 173 ++++++++ .../user_guide/register_center/resource.md | 50 +++ .../user_guide/register_center/udf.md | 35 ++ .../user_guide/studio/_category_.json | 4 + .../version-1.0/user_guide/studio/catalog.md | 6 + .../user_guide/studio/execute_env_config.md | 164 ++++++++ .../studio/flink_env_task_devlop.md | 6 + .../studio/flink_sql_task_devlop.md | 201 ++++++++++ .../user_guide/studio/jdbc_task_devlop.md | 6 + .../user_guide/studio/studio_overview.md | 53 +++ .../user_guide/system_setting/_category_.json | 4 + .../global_settings/_category_.json | 4 + .../global_settings/dinky_setting.md | 32 ++ .../dolphinscheduler_setting.md | 50 +++ .../global_settings/flink_setting.md | 28 ++ .../system_setting/global_settings/ldap.md | 80 ++++ .../global_settings/maven_setting.md | 23 ++ .../global_settings/metrics_setting.md | 25 ++ .../global_settings/resource_setting.md | 70 ++++ .../user_guide/system_setting/system_log.md | 26 ++ .../version-1.0-sidebars.json | 8 + docs/versions.json | 1 + 140 files changed, 9108 insertions(+), 24 deletions(-) create mode 100644 docs/i18n/en/docusaurus-plugin-content-docs/version-1.0.json create mode 100644 docs/i18n/zh/docusaurus-plugin-content-docs/version-1.0.json create mode 100644 docs/versioned_docs/version-1.0/comminicate.md create mode 100644 docs/versioned_docs/version-1.0/deploy_guide/_category_.json create mode 100644 docs/versioned_docs/version-1.0/deploy_guide/compile_deploy.md create mode 100644 docs/versioned_docs/version-1.0/deploy_guide/docker_deploy.md create mode 100644 docs/versioned_docs/version-1.0/deploy_guide/kubernetes_deploy.md create mode 100644 docs/versioned_docs/version-1.0/deploy_guide/normal_deploy.mdx create mode 100644 docs/versioned_docs/version-1.0/deploy_guide/upgrade/_category_.json create mode 100644 docs/versioned_docs/version-1.0/deploy_guide/upgrade/upgrade_075to100.md create mode 100644 docs/versioned_docs/version-1.0/deploy_guide/upgrade/upgrade_overview.md create mode 100644 docs/versioned_docs/version-1.0/developer_guide/_category_.json create mode 100644 docs/versioned_docs/version-1.0/developer_guide/contribution/_category_.json create mode 100644 docs/versioned_docs/version-1.0/developer_guide/contribution/auto_sync.md create mode 100644 docs/versioned_docs/version-1.0/developer_guide/contribution/code_format.md create mode 100644 docs/versioned_docs/version-1.0/developer_guide/contribution/commit_code.md create mode 100644 docs/versioned_docs/version-1.0/developer_guide/contribution/commit_message.md create mode 100644 docs/versioned_docs/version-1.0/developer_guide/contribution/document.md create mode 100644 docs/versioned_docs/version-1.0/developer_guide/contribution/how_contribute.md create mode 100644 docs/versioned_docs/version-1.0/developer_guide/contribution/issue.md create mode 100644 docs/versioned_docs/version-1.0/developer_guide/contribution/pull_request.md create mode 100644 docs/versioned_docs/version-1.0/developer_guide/local_debug.md create mode 100644 docs/versioned_docs/version-1.0/extend/_category_.json create mode 100644 docs/versioned_docs/version-1.0/extend/expand_statements/_category_.json create mode 100644 docs/versioned_docs/version-1.0/extend/expand_statements/add_file_statement.md create mode 100644 docs/versioned_docs/version-1.0/extend/expand_statements/add_jar_statement.md create mode 100644 docs/versioned_docs/version-1.0/extend/expand_statements/aggtable_statement.md create mode 100644 docs/versioned_docs/version-1.0/extend/expand_statements/create_temporal_function.md create mode 100644 docs/versioned_docs/version-1.0/extend/expand_statements/execute_jar.md create mode 100644 docs/versioned_docs/version-1.0/extend/expand_statements/flinkcdc_pipeline.md create mode 100644 docs/versioned_docs/version-1.0/extend/expand_statements/print_table.md create mode 100644 docs/versioned_docs/version-1.0/extend/expand_statements/variable_statement.md create mode 100644 docs/versioned_docs/version-1.0/extend/function_expansion/_category_.json create mode 100644 docs/versioned_docs/version-1.0/extend/function_expansion/global_var_ext.md create mode 100644 docs/versioned_docs/version-1.0/faq.md create mode 100644 docs/versioned_docs/version-1.0/get_started/_category_.json create mode 100644 docs/versioned_docs/version-1.0/get_started/overview.md create mode 100644 docs/versioned_docs/version-1.0/get_started/quick_experience.md create mode 100644 docs/versioned_docs/version-1.0/openapi/CancelFlinkJob.md create mode 100644 docs/versioned_docs/version-1.0/openapi/ExplainSql.md create mode 100644 docs/versioned_docs/version-1.0/openapi/ExportSql.md create mode 100644 docs/versioned_docs/version-1.0/openapi/GetJobInstance.md create mode 100644 docs/versioned_docs/version-1.0/openapi/GetJobInstanceByTaskId.md create mode 100644 docs/versioned_docs/version-1.0/openapi/GetJobPlan.md create mode 100644 docs/versioned_docs/version-1.0/openapi/GetStreamGraph.md create mode 100644 docs/versioned_docs/version-1.0/openapi/GetTaskLineage.md create mode 100644 docs/versioned_docs/version-1.0/openapi/RestartTask.md create mode 100644 docs/versioned_docs/version-1.0/openapi/SavepointTrigger.md create mode 100644 docs/versioned_docs/version-1.0/openapi/SubmitTaskById.md create mode 100644 docs/versioned_docs/version-1.0/openapi/SubmitTaskJob.md create mode 100644 docs/versioned_docs/version-1.0/openapi/_category_.json create mode 100644 docs/versioned_docs/version-1.0/openapi/openapi_overview.md create mode 100644 docs/versioned_docs/version-1.0/practical_guide/Integration_practice/_category_.json create mode 100644 docs/versioned_docs/version-1.0/practical_guide/Integration_practice/dinky_integration_ds.md create mode 100644 docs/versioned_docs/version-1.0/practical_guide/Integration_practice/dinky_integration_flink.md create mode 100644 docs/versioned_docs/version-1.0/practical_guide/_category_.json create mode 100644 docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/_category_.json create mode 100644 docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_faq.md create mode 100644 docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2ck.md create mode 100644 docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2dinkycatalog.md create mode 100644 docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2doris.md create mode 100644 docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2hivecatalog.md create mode 100644 docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2hudi.md create mode 100644 docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2kafka.md create mode 100644 docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2multiplesink.md create mode 100644 docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2mysql.md create mode 100644 docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2oracle.md create mode 100644 docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2paimon.md create mode 100644 docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2pg.md create mode 100644 docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2print.md create mode 100644 docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2starrocks.md create mode 100644 docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_overview.md create mode 100644 docs/versioned_docs/version-1.0/practical_guide/run_mode_practice/_category_.json create mode 100644 docs/versioned_docs/version-1.0/practical_guide/run_mode_practice/application_model_submit.md create mode 100644 docs/versioned_docs/version-1.0/practical_guide/run_mode_practice/dinky_k8s_quick_start.mdx create mode 100644 docs/versioned_docs/version-1.0/practical_guide/run_mode_practice/k8s_native_model_submit.md create mode 100644 docs/versioned_docs/version-1.0/practical_guide/run_mode_practice/k8s_operater_model_submit.md create mode 100644 docs/versioned_docs/version-1.0/practical_guide/run_mode_practice/k8s_session_model_submit.md create mode 100644 docs/versioned_docs/version-1.0/practical_guide/run_mode_practice/local_model_submit.md create mode 100644 docs/versioned_docs/version-1.0/practical_guide/run_mode_practice/projob_model_submit.md create mode 100644 docs/versioned_docs/version-1.0/practical_guide/run_mode_practice/standalone_model_submit.md create mode 100644 docs/versioned_docs/version-1.0/practical_guide/run_mode_practice/yarnsession_model_submit.md create mode 100644 docs/versioned_docs/version-1.0/practical_guide/scenario_practice/_category_.json create mode 100644 docs/versioned_docs/version-1.0/practical_guide/scenario_practice/mysqlcdc2doris.md create mode 100644 docs/versioned_docs/version-1.0/practical_guide/scenario_practice/mysqlcdc2hudi.md create mode 100644 docs/versioned_docs/version-1.0/practical_guide/scenario_practice/mysqlcdc2paimon.md create mode 100644 docs/versioned_docs/version-1.0/practical_guide/scenario_practice/mysqlcdc2starrocks.md create mode 100644 docs/versioned_docs/version-1.0/roadmap.md create mode 100644 docs/versioned_docs/version-1.0/thanks.md create mode 100644 docs/versioned_docs/version-1.0/user_guide/_category_.json create mode 100644 docs/versioned_docs/version-1.0/user_guide/auth_center/_category_.json create mode 100644 docs/versioned_docs/version-1.0/user_guide/auth_center/menu.md create mode 100644 docs/versioned_docs/version-1.0/user_guide/auth_center/role.md create mode 100644 docs/versioned_docs/version-1.0/user_guide/auth_center/row_limits.md create mode 100644 docs/versioned_docs/version-1.0/user_guide/auth_center/tenant.md create mode 100644 docs/versioned_docs/version-1.0/user_guide/auth_center/token.md create mode 100644 docs/versioned_docs/version-1.0/user_guide/auth_center/user.md create mode 100644 docs/versioned_docs/version-1.0/user_guide/devops_center/_category_.json create mode 100644 docs/versioned_docs/version-1.0/user_guide/devops_center/job_details.md create mode 100644 docs/versioned_docs/version-1.0/user_guide/devops_center/job_overview.md create mode 100644 docs/versioned_docs/version-1.0/user_guide/metrics_overview.md create mode 100644 docs/versioned_docs/version-1.0/user_guide/register_center/_category_.json create mode 100644 docs/versioned_docs/version-1.0/user_guide/register_center/alert/_category_.json create mode 100644 docs/versioned_docs/version-1.0/user_guide/register_center/alert/alert_group.md create mode 100644 docs/versioned_docs/version-1.0/user_guide/register_center/alert/alert_instance.md create mode 100644 docs/versioned_docs/version-1.0/user_guide/register_center/alert/alert_overview.md create mode 100644 docs/versioned_docs/version-1.0/user_guide/register_center/alert/alert_strategy.md create mode 100644 docs/versioned_docs/version-1.0/user_guide/register_center/alert/alert_template.md create mode 100644 docs/versioned_docs/version-1.0/user_guide/register_center/cluster_manage.md create mode 100644 docs/versioned_docs/version-1.0/user_guide/register_center/datasource_manage.md create mode 100644 docs/versioned_docs/version-1.0/user_guide/register_center/document_manager.md create mode 100644 docs/versioned_docs/version-1.0/user_guide/register_center/git_project.md create mode 100644 docs/versioned_docs/version-1.0/user_guide/register_center/global_var.md create mode 100644 docs/versioned_docs/version-1.0/user_guide/register_center/resource.md create mode 100644 docs/versioned_docs/version-1.0/user_guide/register_center/udf.md create mode 100644 docs/versioned_docs/version-1.0/user_guide/studio/_category_.json create mode 100644 docs/versioned_docs/version-1.0/user_guide/studio/catalog.md create mode 100644 docs/versioned_docs/version-1.0/user_guide/studio/execute_env_config.md create mode 100644 docs/versioned_docs/version-1.0/user_guide/studio/flink_env_task_devlop.md create mode 100644 docs/versioned_docs/version-1.0/user_guide/studio/flink_sql_task_devlop.md create mode 100644 docs/versioned_docs/version-1.0/user_guide/studio/jdbc_task_devlop.md create mode 100644 docs/versioned_docs/version-1.0/user_guide/studio/studio_overview.md create mode 100644 docs/versioned_docs/version-1.0/user_guide/system_setting/_category_.json create mode 100644 docs/versioned_docs/version-1.0/user_guide/system_setting/global_settings/_category_.json create mode 100644 docs/versioned_docs/version-1.0/user_guide/system_setting/global_settings/dinky_setting.md create mode 100644 docs/versioned_docs/version-1.0/user_guide/system_setting/global_settings/dolphinscheduler_setting.md create mode 100644 docs/versioned_docs/version-1.0/user_guide/system_setting/global_settings/flink_setting.md create mode 100644 docs/versioned_docs/version-1.0/user_guide/system_setting/global_settings/ldap.md create mode 100644 docs/versioned_docs/version-1.0/user_guide/system_setting/global_settings/maven_setting.md create mode 100644 docs/versioned_docs/version-1.0/user_guide/system_setting/global_settings/metrics_setting.md create mode 100644 docs/versioned_docs/version-1.0/user_guide/system_setting/global_settings/resource_setting.md create mode 100644 docs/versioned_docs/version-1.0/user_guide/system_setting/system_log.md create mode 100644 docs/versioned_sidebars/version-1.0-sidebars.json diff --git a/docs/docs/developer_guide/local_debug.md b/docs/docs/developer_guide/local_debug.md index 365bb68fa8..8fbe672e09 100644 --- a/docs/docs/developer_guide/local_debug.md +++ b/docs/docs/developer_guide/local_debug.md @@ -101,6 +101,8 @@ Install/Package 过程中报错代码格式化问题,请参考 [代码格式化] ### Profile 说明 +> 注意: scale 相关 profile 从 Dinky v1.1.0 版本移除,默认使用 scala 2.12 版本(Flink 1.15 及以上版本不再单独支持 scala 2.11) + | Profile | 说明 | |:--------------------:|:----------------------------------------------------------------------------------:| | dev | 开发环境/本地调试,默认不选中,此功能主要用于本地调试或者二次开发,用于加载相关依赖 | @@ -118,8 +120,6 @@ Install/Package 过程中报错代码格式化问题,请参考 [代码格式化] | mac | 用于适配在 mac 系统上进行调试 | | maven-central | 用于指定 maven 仓库为中央仓库 | | prod | 生产环境,默认选中,此功能主要用于编译打包,此 profile 会将部分依赖排除掉,不会打进最终 tar.gz 包内 | -| scala-2.11 | 用于指定 Scala 版本为 2.11,只能单选 | -| scala-2.12 | 用于指定 Scala 版本为 2.12,只能单选 | | web | 打包前端资源,需要勾选 | :::warning 注意 @@ -159,8 +159,7 @@ Dinky开发环境配置有两种模式,分别是 provided 环境和 compile ### 修改配置文件 -> 以 MySQL 为例, 如果使用 PostgreSQL/H2 请自行修改,注意: 使用 H2 -> 数据库时无需修改如下配置,直接进行 [启动后端服务](#启动后端服务) +> 以 MySQL 为例, 如果使用 PostgresSQL/H2 请自行修改,注意: 默认使用 H2 数据库时无需修改如下配置,直接 [启动后端服务](#启动后端服务) - 修改 dinky-admin/src/main/resources/application-mysql.yml 文件,配置相应的数据库连接信息 diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index b78c5cd01c..1750b59c74 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -84,22 +84,28 @@ const config = { /** @type {import('@docusaurus/preset-classic').Options} */ ({ docs: { - lastVersion: 'current', + includeCurrentVersion: true, + lastVersion: '1.0', versions: { current: { - label: '1.0', + label: 'Dev', path: '/next', + banner: 'unreleased', }, - 0.6: { - label: '0.6', - path: '/0.6', - banner: 'unmaintained', + '1.0': { + label: '1.0', + path: '/1.0', }, 0.7: { label: '0.7', path: '/0.7', banner: 'unmaintained', }, + 0.6: { + label: '0.6', + path: '/0.6', + banner: 'unmaintained', + }, }, sidebarPath: require.resolve('./sidebars.js'), sidebarCollapsible: true, diff --git a/docs/i18n/en/docusaurus-plugin-content-docs/current.json b/docs/i18n/en/docusaurus-plugin-content-docs/current.json index ead59acbed..f3cb8f83de 100644 --- a/docs/i18n/en/docusaurus-plugin-content-docs/current.json +++ b/docs/i18n/en/docusaurus-plugin-content-docs/current.json @@ -1,6 +1,6 @@ { "version.label": { - "message": "1.0", + "message": "Dev", "description": "The label for version current" }, "sidebar.tutorialSidebar.category.deploy_guide": { @@ -103,10 +103,6 @@ "message": "Quick Use", "description": "The label for category Quick Use in sidebar tutorialSidebar" }, - "sidebar.tutorialSidebar.category.快速使用": { - "message": "快速使用", - "description": "The label for category 快速使用 in sidebar tutorialSidebar" - }, "sidebar.tutorialSidebar.category.upgrade": { "message": "Upgrade", "description": "The label for category upgrade in sidebar tutorialSidebar" diff --git a/docs/i18n/en/docusaurus-plugin-content-docs/version-1.0.json b/docs/i18n/en/docusaurus-plugin-content-docs/version-1.0.json new file mode 100644 index 0000000000..ead59acbed --- /dev/null +++ b/docs/i18n/en/docusaurus-plugin-content-docs/version-1.0.json @@ -0,0 +1,118 @@ +{ + "version.label": { + "message": "1.0", + "description": "The label for version current" + }, + "sidebar.tutorialSidebar.category.deploy_guide": { + "message": "Deploy Guide", + "description": "The label for category deploy_guide in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.studio": { + "message": "Data Studio", + "description": "The label for category studio in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.development_control": { + "message": "Basic Introduction", + "description": "The label for category development_control in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.devops_center": { + "message": "Devops Center", + "description": "The label for category devops_center in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.register_center": { + "message": "Register Center", + "description": "The label for category register_center in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.system_setting": { + "message": "Setting Center", + "description": "The label for category system_setting in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.contribution": { + "message": "Contribution", + "description": "The label for category contribution in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.extend": { + "message": "Extend", + "description": "The label for category extend in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.function_extension": { + "message": "Function Extension", + "description": "The label for category function_extension in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.practical_guide": { + "message": "Practical Guide", + "description": "The label for category practical_guide in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.get_started": { + "message": "Get Started", + "description": "The label for category get_started in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.platform_intro": { + "message": "Dinky Intro", + "description": "The label for category platform_intro in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.quick_start": { + "message": "SQL Quick Start", + "description": "The label for category quick_start in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.cdcsource_practice": { + "message": "CDCSource Practice", + "description": "The label for category cdcsource_practice in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.run_mode_practice": { + "message": "Flink Mode Submission Practice", + "description": "The label for category run_mode_practice in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.scenario_practice": { + "message": "Scenario Practice", + "description": "The label for category scenario_practice in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.Integration_practice": { + "message": "Integration Practice", + "description": "The label for category Integration_practice in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.user_guide": { + "message": "Manual", + "description": "The label for category user_guide in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.alert": { + "message": "Alert", + "description": "The label for category alert in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.auth_center": { + "message": "Auth Center", + "description": "The label for category auth_center in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.global_settings": { + "message": "Global Config", + "description": "The label for category global_settings in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.udf_develop": { + "message": "UDFFunction Develop", + "description": "The label for category udf_develop in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.developer_guide": { + "message": "Developer Guide", + "description": "The label for category developer_guide in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.extended_grammar": { + "message": "Extended Grammar", + "description": "The label for category extended_grammar in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.quick_use": { + "message": "Quick Use", + "description": "The label for category Quick Use in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.快速使用": { + "message": "快速使用", + "description": "The label for category 快速使用 in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.upgrade": { + "message": "Upgrade", + "description": "The label for category upgrade in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.openapi": { + "message": "OpenAPI", + "description": "The label for category openapi in sidebar tutorialSidebar" + } +} diff --git a/docs/i18n/en/docusaurus-theme-classic/footer.json b/docs/i18n/en/docusaurus-theme-classic/footer.json index 3e72113470..83e2510ebc 100644 --- a/docs/i18n/en/docusaurus-theme-classic/footer.json +++ b/docs/i18n/en/docusaurus-theme-classic/footer.json @@ -13,11 +13,11 @@ }, "link.item.label.doc_home": { "message": "Doc Home", - "description": "The label of footer link with label=doc_home linking to /docs/next/platform_intro/overview" + "description": "The label of footer link with label=doc_home linking to /docs/next/get_started/overview" }, "link.item.label.openapi": { "message": "Open Api", - "description": "The label of footer link with label=openapi linking to /docs/next/openapi" + "description": "The label of footer link with label=openapi linking to /docs/next/openapi/openapi_overview" }, "link.item.label.issue": { "message": "Issue", diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current.json b/docs/i18n/zh/docusaurus-plugin-content-docs/current.json index 9c6a0e29db..45b65e0324 100644 --- a/docs/i18n/zh/docusaurus-plugin-content-docs/current.json +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current.json @@ -1,6 +1,6 @@ { "version.label": { - "message": "1.0", + "message": "Dev", "description": "The label for version current" }, "sidebar.tutorialSidebar.category.deploy_guide": { @@ -103,10 +103,6 @@ "message": "扩展语法", "description": "The label for category extended_grammar in sidebar tutorialSidebar" }, - "sidebar.tutorialSidebar.category.快速使用": { - "message": "快速使用", - "description": "The label for category 快速使用 in sidebar tutorialSidebar" - }, "sidebar.tutorialSidebar.category.upgrade": { "message": "升级", "description": "The label for category upgrade in sidebar tutorialSidebar" diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.0.json b/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.0.json new file mode 100644 index 0000000000..9c6a0e29db --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.0.json @@ -0,0 +1,118 @@ +{ + "version.label": { + "message": "1.0", + "description": "The label for version current" + }, + "sidebar.tutorialSidebar.category.deploy_guide": { + "message": "安装部署", + "description": "The label for category deploy_guide in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.user_guide": { + "message": "使用手册", + "description": "The label for category user_guide in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.studio": { + "message": "数据开发", + "description": "The label for category studio in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.development_control": { + "message": "基本介绍", + "description": "The label for category development_control in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.devops_center": { + "message": "运维中心", + "description": "The label for category devops_center in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.register_center": { + "message": "注册中心", + "description": "The label for category register_center in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.system_setting": { + "message": "配置中心", + "description": "The label for category system_setting in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.extend": { + "message": "扩展", + "description": "The label for category extend in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.function_extension": { + "message": "功能扩展", + "description": "The label for category function_extension in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.practical_guide": { + "message": "实践指南", + "description": "The label for category practical_guide in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.developer_guide": { + "message": "开发者指南", + "description": "The label for category developer_guide in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.contribution": { + "message": "参与贡献", + "description": "The label for category contribution in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.quick_use": { + "message": "快速使用", + "description": "The label for category 快速使用 in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.get_started": { + "message": "快速开始", + "description": "The label for category get_started in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.platform_intro": { + "message": "Dinky 介绍", + "description": "The label for category platform_intro in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.quick_start": { + "message": "SQL 快速入门", + "description": "The label for category quick_start in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.cdcsource_practice": { + "message": "整库同步实践", + "description": "The label for category cdcsource_practice in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.run_mode_practice": { + "message": "Flink模式提交实践", + "description": "The label for category run_mode_practice in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.scenario_practice": { + "message": "场景实践", + "description": "The label for category scenario_practice in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.Integration_practice": { + "message": "集成实践", + "description": "The label for category Integration_practice in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.alert": { + "message": "告警", + "description": "The label for category alert in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.auth_center": { + "message": "认证中心", + "description": "The label for category auth_center in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.global_settings": { + "message": "全局配置", + "description": "The label for category global_settings in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.udf_develop": { + "message": "函数开发", + "description": "The label for category udf_develop in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.extended_grammar": { + "message": "扩展语法", + "description": "The label for category extended_grammar in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.快速使用": { + "message": "快速使用", + "description": "The label for category 快速使用 in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.upgrade": { + "message": "升级", + "description": "The label for category upgrade in sidebar tutorialSidebar" + }, + "sidebar.tutorialSidebar.category.openapi": { + "message": "OpenAPI", + "description": "The label for category openapi in sidebar tutorialSidebar" + } +} diff --git a/docs/i18n/zh/docusaurus-theme-classic/footer.json b/docs/i18n/zh/docusaurus-theme-classic/footer.json index d959dfe385..96de541e03 100644 --- a/docs/i18n/zh/docusaurus-theme-classic/footer.json +++ b/docs/i18n/zh/docusaurus-theme-classic/footer.json @@ -13,11 +13,11 @@ }, "link.item.label.doc_home": { "message": "文档首页", - "description": "The label of footer link with label=doc_home linking to /docs/next/platform_intro/overview" + "description": "The label of footer link with label=doc_home linking to /docs/next/get_started/overview" }, "link.item.label.openapi": { "message": "Open Api", - "description": "The label of footer link with label=openapi linking to /docs/next/openapi" + "description": "The label of footer link with label=openapi linking to /docs/next/openapi/openapi_overview" }, "link.item.label.issue": { "message": "Issue", diff --git a/docs/versioned_docs/version-1.0/comminicate.md b/docs/versioned_docs/version-1.0/comminicate.md new file mode 100644 index 0000000000..1017474e2f --- /dev/null +++ b/docs/versioned_docs/version-1.0/comminicate.md @@ -0,0 +1,19 @@ +--- +sidebar_position: 998 +id: comminicate +title: 交流与贡献 +--- + +欢迎您加入社区交流分享,也欢迎您为社区贡献自己的力量。 + +在此非常感谢大家的支持~ + +QQ社区群:**543709668**,申请备注 “ Dinky ”,不写不批 + +微信社区群(推荐):添加微信号 wenmo_ai 邀请进群,申请备注 “ Dinky + 企业名 + 职位”,不写不批 + +**公众号(最新消息获取建议关注):** +- **微信搜索公众号:** `Dinky开源` +- **扫码关注公众号:** 扫下图二维码,关注公众号 + +![Dinky开源](http://pic.dinky.org.cn/dinky/docs/zh-CN/comminicate/datalink.jpg) \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0/deploy_guide/_category_.json b/docs/versioned_docs/version-1.0/deploy_guide/_category_.json new file mode 100644 index 0000000000..8b1f05fa20 --- /dev/null +++ b/docs/versioned_docs/version-1.0/deploy_guide/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "deploy_guide", + "position": 2 +} diff --git a/docs/versioned_docs/version-1.0/deploy_guide/compile_deploy.md b/docs/versioned_docs/version-1.0/deploy_guide/compile_deploy.md new file mode 100644 index 0000000000..29ea26478d --- /dev/null +++ b/docs/versioned_docs/version-1.0/deploy_guide/compile_deploy.md @@ -0,0 +1,127 @@ +--- +sidebar_position: 3 +position: 3 +id: compile_deploy +title: 编译部署 +--- + +:::tip 提示 +1. 如果你只想部署 Dinky,可以跳过本章节,直接查看[常规部署](./normal_deploy)章节 + +2. 如果你想对 Dinky 做二次开发,参考[本地调试](../developer_guide/local_debug)章节,从而搭建开发环境。开发完成之后,再参考本章节,进行编译。 + +3. 自 Dinky v1.0.0 版本开始,Dinky 在打包时仅支持单个版本的打包方式,即: 你只能选择一个 Flink 版本进行打包,而不能同时打包多个版本。 +::: + + +## 环境准备 + +环境要求请参考 [本地调试-环境要求](../developer_guide/local_debug#环境要求) 章节! 各个环境安装请自行搜索 + + +--- + + +:::warning 注意 +当你看到这里的时候,说明你已经完成了所有的环境准备,接下来就是编译 Dinky 了。 + +接下来将从 IDEA 和 Linux Shell 两个方面介绍如何编译 Dinky。请注意环境要求是一致的,否则可能会出现编译失败的情况。 +::: + +### IDEA 编译 + +> 推荐使用 IDEA 进行编译,因为 IDEA 在打开项目时会自动下载依赖,而且编译速度快,方便调试. + +#### Clone 项目 +> 注意: 本次直接 clone 的是 Dinky 主仓库,如果你想要二次开发/基于自己的仓库进行二次开发,请先 fork 项目,然后再 clone 你自己的仓库 + +![compile_clone_1](http://pic.dinky.org.cn/dinky/docs/zh-CN/complie/complie_clone_1.png) + +Clone 完成后, 等待 IDEA 自动下载依赖(前提 IDEA 已经正确配置了 Maven) ,下载完成后, 请按照下一步中的步骤(Profile)进行编译 + + +#### 编译打包 + + +:::danger 注意 +请注意: 有关于各个 Profile 的详细介绍,请查看 [Profile 说明](../developer_guide/local_debug#Profile-说明) +::: + + +- 打包 Profile + +> 注意: 需要勾选 web,否则无法打包前端资源 + +![locadenug_single_package_profile](http://pic.dinky.org.cn/dinky/docs/zh-CN/developer_guide/local_debug/locadenug_single_package_profile.png) + + + + +:::danger 注意 +1. 请严格按照上述 Profile 进行编译打包,否则可能会出现编译失败的情况。如出现编译失败,请检查环境是否正确,Profile 是否正确。请务必仔细核对。 +2. 如果出现编译失败,请查看 IDEA 控制台输出的错误信息,根据错误信息自行进行排查。如果无法解决,请百度/谷歌/Stackoverflow 解决。最后如果还是无法解决,请提交 [Issue](https://github.com/DataLinkDC/dinky/issues/new/choose) +3. 编译完成后,请查看编译后的目录,如果编译成功,会在 `dinky/build` 目录下生成对应的版本的 jar 包。 +::: + +#### 编译结果 + +编译完成后,请查看编译后的目录,如果编译成功,会在 `dinky/build` 目录下生成对应的版本的 tar.gz 包。 + + +以上就是 IDEA 编译 Dinky 的详细步骤,接下来将介绍如何使用 Linux Shell 进行编译。 + +--- + +### Linux Shell 编译 + +> 注意: 本次直接 clone 的是 Dinky 主仓库,如果你想要二次开发/基于自己的仓库进行二次开发,请先 fork 项目,然后再 clone 你自己的仓库 + +#### Clone 项目 + +```bash +# 创建某一路径用来存放 Dinky 源码 +mkdir -p /opt/dinky-source-code +cd /opt/dinky-source-code +# Clone 项目 +git clone https://github.com/DataLinkDC/dinky.git +``` + +#### 编译打包 + +> 如果你看到此处,那么默认你是对 Maven 有一定了解并熟练使用的,如果你不了解 Maven/不会使用 Maven,请自行百度/谷歌/Stackoverflow...解决 + +```bash +cd /opt/dinky-source-code + +# 编译打包 Profile, 注意 scala 支持 2.11 和 2.12, 请根据实际情况进行选择,jdk 支持 8/11,请根据实际情况进行选择,不选jdk11默认使用系统内的jdk8 +mvn clean package -DskipTests=true -P prod,jdk11,flink-single-version,scala-2.12,aliyun,flink-1.16,web + +``` + +:::danger 注意 +请注意: 有关于各个 Profile 的详细介绍,请查看 [Profile 说明](../developer_guide/local_debug#Profile-说明) +::: + +:::danger 注意 +1. 请严格按照上述 Profile 进行编译打包,否则可能会出现编译失败的情况。如出现编译失败,请检查环境是否正确,Profile 是否正确。请务必仔细核对。 +2. 如果出现编译失败,请查看 IDEA 控制台输出的错误信息,根据错误信息自行进行排查。如果无法解决,请百度/谷歌/Stackoverflow 解决。最后如果还是无法解决,请提交 [Issue](https://github.com/DataLinkDC/dinky/issues) +::: + +#### 编译结果 + +编译完成后,请查看编译后的目录,如果编译成功,会在 `dinky/build` 目录下生成对应的版本的 tar.gz 包。 + +以上就是 Linux Shell 编译 Dinky 的详细步骤, + +--- + +:::info +上述两种方式,任选其一即可。如果已经正常编译成功,接下来将你可以按照 [部署文档](./normal_deploy) 进行部署了。 +::: + + + + + + + diff --git a/docs/versioned_docs/version-1.0/deploy_guide/docker_deploy.md b/docs/versioned_docs/version-1.0/deploy_guide/docker_deploy.md new file mode 100644 index 0000000000..67cdda9f8a --- /dev/null +++ b/docs/versioned_docs/version-1.0/deploy_guide/docker_deploy.md @@ -0,0 +1,131 @@ +--- +sidebar_position: 2 +position: 2 +id: docker_deploy +title: Docker 部署 +--- + +:::danger 注意 + +Dinky v1.0.0 的 Docker 镜像正在开发中,敬请期待。以下步骤目前由于镜像未发布,无法使用。请耐心等待。如您对 Docker 镜像有兴趣,欢迎加入我们的开发群,一起参与开发。 + +::: + + +## Docker 快速使用教程 +本教程使用三种不同的方式通过 Docker 完成 Dinky 的部署,如果你想要快速体验,推荐使用 standalone-server 镜像, 如果你想要体验比较完整的服务,推荐使用 docker-compose 启动服务。如果你已经有自己的数据库服务 你想要沿用这些基础服务,你可以参考沿用已有的 Mysql 、 Hadoop 和 Flink 服务完成部署。 + +## 前置条件 +- Docker 1.13.1+ +- Docker Compose 1.28.0+(可选) + +## Docker启动 +使用 H2 本地数据库快速启动 +```shell +docker run --restart=always -p 8888:8888 \ + --name dinky \ + dinky/dinky:1.0.3-flink1.17 + +``` +使用 外部mysql数据库 +```bash +docker run --restart=always -p 8888:8888 \ + --name dinky \ + -e DB_ACTIVE=mysql \ + -e MYSQL_ADDR=127.0.0.1:3306 \ + -e MYSQL_DATABASE=dinky \ + -e MYSQL_USERNAME=dinky \ + -e MYSQL_PASSWORD=dinky \ + -v /opt/lib:/opt/flink/lib/customJar/ \ + dinky/dinky:1.0.3-flink1.17 + +``` +:::tip 说明 +由于mysql与Apache 2.0协议不兼容,dinky无法默认提供mysql驱动,所以需要您手动提供mysql依赖并放到`/opt/flink/lib/customJar/` +下面,上面已经给出了映射,如果你有自己的依赖目录,修改即可 +::: + +使用 外部postgres数据库 +```bash +docker run --restart=always -p 8888:8888 \ + --name dinky \ + -e DB_ACTIVE=pgsql \ + -e POSTGRES_ADDR=127.0.0.1:5432 \ + -e POSTGRES_DATABASE=dinky \ + -e POSTGRES_USERNAME=dinky \ + -e POSTGRES_PASSWORD=dinky \ + -v /opt/lib:/opt/flink/lib/customJar/ \ + dinky/dinky:1.0.3-flink1.17 +``` +--- +### 使用docker-compose +docker-compose可快速帮你搭建起来dinky与flink集群环境, +下载dinky源码后,在 `deploy/docker` 下面即可找到`docker-compose.yml`和 `.env` 文件, +```bash +cd deploy/docker/ +ls -al +-rwxrwxrwx 1 root root 765 May 29 11:29 docker-compose.dev.yml +-rwxrwxrwx 1 root root 699 May 29 11:29 docker-compose.yml +-rwxrwxrwx 1 root root 1603 May 29 11:29 Dockerfile +-rwxrwxrwx 1 root root 1718 May 29 11:46 .env + +``` +编辑 `.env` 文件,修改你想要的配置,如果只是快速体验,无需修改任何内容 +```shell +#定义dinky版本号 +DINKY_VERSION=1.0.3 +#定义Flink版本(不要写小版本号) +FLINK_VERSION=1.17 + +# 自定义jar包依赖本地路径(例如:mysql驱动) +CUSTOM_JAR_PATH=/opt/dinky/extends/ + +# 使用那种数据库,默认h2 +DB_ACTIVE=h2 +# h2数据库持久化文件路径 +H2_DB=./tmp/db/h2 + +## 使用mysql数据库时打开注释并填写内容 +## 如果 DB_ACTIVE 配置为mysaql,请修改下面配置,否则忽略 +##MYSQL_ADDR=127.0.0.1:3306 +#MYSQL_DATABASE=dinky +#MYSQL_USERNAME=dinky +#MYSQL_PASSWORD=dinky + +## 使用pg数据库时打开注释并填写内容 +## 如果 DB_ACTIVE 配置为pgsql,请修改下面配置,否则忽略 +##POSTGRES_USER=dinky +#POSTGRES_PASSWORD=dinky +#POSTGRES_ADDR=localhost:5432 +#POSTGRES_DB=dinky + +# 时区 +TZ=Asia/Shanghai +# 自带Flink集群配置,一般不用改 +FLINK_PROPERTIES="jobmanager.rpc.address: jobmanager" + +``` +启动集群 +```shell +docker-compose up -d +``` + + +## 本地开发 + +可使用 +```shell +docker compose --profile standalone -f docker-compose.yml -f docker-compose.dev.yml up +``` +进行docker镜像的构建及运行(/docker/.env文件配置相关环境变量). + +如果需要前后端分离, 可使用 +```shell +docker compose --profile ms -f docker-compose.yml -f docker-compose.dev.yml up +``` +(适配自身nginx的docker/web/default.conf配置) +对于1.15上版本,需要手动将容器中/opt/diny/plugin/flink{version}/flink-table-planner-loader*.jar移除, +替换为相应版本的flink-table-planner_*.jar文件. +创建容器时,可映射到容器/opt/diny/customJar文件夹,添加自定义jar包. + +欢迎补充 diff --git a/docs/versioned_docs/version-1.0/deploy_guide/kubernetes_deploy.md b/docs/versioned_docs/version-1.0/deploy_guide/kubernetes_deploy.md new file mode 100644 index 0000000000..aa22074922 --- /dev/null +++ b/docs/versioned_docs/version-1.0/deploy_guide/kubernetes_deploy.md @@ -0,0 +1,363 @@ +--- +sidebar_position: 4 +position: 4 +id: kubernetes_deploy +title: kubernetes 部署 +--- + +Kubernetes 部署目的是在 Kubernetes 集群中部署 dinky 服务,能快速、便捷在生产中部署。 + +## 前置条件 +- Helm 3.1.0+ +- Kubernetes 1.12+ + +## 安装 dinky +### 下载安装包 +https://www.dinky.org.cn/download/download + +### 修改配置 +#### 修改镜像地址 +cd dinky-release-${FLINK-VERSION}-${DINKY-VERSION}/deploy/kubernetes/helm/dinky +```yaml +image: + repository: "docker.dinky.org.cn:32451/dinky/dev/dinky-txh" + pullPolicy: "Always" + tag: "1.0.2" + pullSecret: "" +``` +#### 内部数据源(同一个k8环境中部署mysql服务) +修改values.yaml 为mysql数据源 +```yaml +mysql: + enabled: true + url: "172.168.1.111:31476" + auth: + username: "dinky" + password: "bigdata123!@#" + database: "dinky-dev-1-17" +``` +如果数据源为postgresql,则修改如下 +```yaml +postgresql: + enabled: true + url: "172.168.1.111:31476" + auth: + username: "dinky" + password: "bigdata123!@#" + database: "dinky-dev-1-17" +``` +修改flink版本,如下修改为1.17版本 +```yaml +spec: + replicaCount: 1 + containerPort: 8888 + name: rest + extraEnv: + flinkVersion: "1.17" +``` +例如,mysql数据源完整配置如下: +完整配置如下: +```yaml +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# + +timezone: "Asia/Shanghai" + +nameOverride: "" +fullnameOverride: "" + +image: + repository: "docker.dinky.org.cn:32451/dinky/dev/dinky-txh" + pullPolicy: "Always" + tag: "1.0.2" + pullSecret: "" + +mysql: + enabled: true + url: "172.168.1.111:31476" + auth: + username: "dinky" + password: "bigdata123!@#" + database: "dinky-dev-1-17" + +postgresql: + enabled: false + url: "172.168.1.111:31476" + auth: + username: "dinky" + password: "bigdata123!@#" + database: "dinky-dev-1-17" + +externalDatabase: + enabled: false + type: "mysql" + url: "10.43.2.12:3306" + auth: + username: "root" + password: "Dinky@1234567!" + database: "dinky" + +externalDatabaseService: + clusterIP: 10.43.2.12 + port: 3306 + +externalDatabaseEndpoints: + ip: 172.168.1.110 + port: 3306 + +rbac: + create: true + +spec: + replicaCount: 1 + containerPort: 8888 + name: rest + extraEnv: + flinkVersion: "1.17" + + affinity: {} + nodeSelector: {} + tolerations: [] + resources: {} + # resources: + # limits: + # memory: "2Gi" + # cpu: "1" + # requests: + # memory: "1Gi" + # cpu: "500m" + livenessProbe: + enabled: true + initialDelaySeconds: "90" + periodSeconds: "30" + timeoutSeconds: "20" + failureThreshold: "3" + successThreshold: "1" + + readinessProbe: + enabled: true + initialDelaySeconds: "90" + periodSeconds: "30" + timeoutSeconds: "20" + failureThreshold: "3" + successThreshold: "1" + +ingress: + enabled: false + className: "" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: demo.dinky.org.cn + paths: + - path: / + pathType: ImplementationSpecific + tls: [] + + +service: + ## type determines how the Service is exposed. Defaults to ClusterIP. Valid options are ExternalName, ClusterIP, NodePort, and LoadBalancer + type: "ClusterIP" + name: "dinky" + +dinkyDefaultConfiguration: + create: true + append: true + +dinkyServiceAccount: + create: true + annotations: {} + name: "dinky" +``` +注意:数据源只能启用一个,不能同时启用mysql和postgresql + +#### 外部数据源 +修改k8s集群外mysql服务配置 +```yaml +externalDatabaseEndpoints: + ip: 172.168.1.110 + port: 3306 +``` +修改k8s集群内映射mysql服务配置 +```yaml +externalDatabaseService: + clusterIP: 10.43.2.12 + port: 3306 +``` +修改mysql服务配置 +```yaml +externalDatabase: + enabled: true + type: "mysql" + url: "10.43.2.12:3306" + auth: + username: "root" + password: "Dinky@1234567!" + database: "dinky" +``` + +完整案例如下: +```yaml +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# + +timezone: "Asia/Shanghai" + +nameOverride: "" +fullnameOverride: "" + +image: + repository: "docker.dinky.org.cn:32451/dinky/dev/dinky-txh" + pullPolicy: "Always" + tag: "1.0.2" + pullSecret: "" + +mysql: + enabled: false + url: "172.168.1.111:31476" + auth: + username: "dinky" + password: "bigdata123!@#" + database: "dinky-dev-1-17" + +postgresql: + enabled: false + url: "172.168.1.111:31476" + auth: + username: "dinky" + password: "bigdata123!@#" + database: "dinky-dev-1-17" + +externalDatabase: + enabled: true + type: "mysql" + url: "10.43.2.12:3306" + auth: + username: "root" + password: "Dinky@1234567!" + database: "dinky" + +externalDatabaseService: + clusterIP: 10.43.2.12 + port: 3306 + +externalDatabaseEndpoints: + ip: 172.168.1.110 + port: 3306 + +rbac: + create: true + +spec: + replicaCount: 1 + containerPort: 8888 + name: rest + extraEnv: + flinkVersion: "1.17" + + affinity: {} + nodeSelector: {} + tolerations: [] + resources: {} + # resources: + # limits: + # memory: "2Gi" + # cpu: "1" + # requests: + # memory: "1Gi" + # cpu: "500m" + livenessProbe: + enabled: true + initialDelaySeconds: "90" + periodSeconds: "30" + timeoutSeconds: "20" + failureThreshold: "3" + successThreshold: "1" + + readinessProbe: + enabled: true + initialDelaySeconds: "90" + periodSeconds: "30" + timeoutSeconds: "20" + failureThreshold: "3" + successThreshold: "1" + +ingress: + enabled: false + className: "" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: demo.dinky.org.cn + paths: + - path: / + pathType: ImplementationSpecific + tls: [] + + +service: + ## type determines how the Service is exposed. Defaults to ClusterIP. Valid options are ExternalName, ClusterIP, NodePort, and LoadBalancer + type: "ClusterIP" + name: "dinky" + +dinkyDefaultConfiguration: + create: true + append: true + +dinkyServiceAccount: + create: true + annotations: {} + name: "dinky" +``` + +### 部署 +将名为 dinky 的版本(release) 发布到 dinky 的命名空间中: +```shell +cd dinky-release-${FLINK-VERSION}-${DINKY-VERSION}/deploy/kubernetes/helm/dinky + +helm install dinky . -n dinky +``` + +### 卸载 +```shell +cd dinky-release-${FLINK-VERSION}-${DINKY-VERSION}/deploy/kubernetes/helm/dinky + +helm uninstall dinky -n dinky +``` + + + + + diff --git a/docs/versioned_docs/version-1.0/deploy_guide/normal_deploy.mdx b/docs/versioned_docs/version-1.0/deploy_guide/normal_deploy.mdx new file mode 100644 index 0000000000..8c004324fd --- /dev/null +++ b/docs/versioned_docs/version-1.0/deploy_guide/normal_deploy.mdx @@ -0,0 +1,258 @@ +--- +sidebar_position: 1 +position: 1 +id: normal_deploy +title: 常规部署 +--- + +--- + +## 数据库初始化 + +Dinky 采用 mysql 作为后端的存储库,mysql 支持 5.7+。这里假设你已经安装了 mysql 。首先需要创建 Dinky 的后端数据库,这里以配置文件中默认库创建。 + +在 Dinky 根目录 sql 文件夹下分别放置了 dinky-mysql.sql 、 upgrade/${version}_schema/mysql/ddl 和 dml。如果第一次部署,可以直接将 sql/dinky-mysql.sql 文件在 dinky 数据库下执行。(如果之前已经部署,那 upgrade 目录下存放了各版本的升级 sql ,根据版本号按需执行即可) + + + + +```sql +#登录mysql +mysql -uroot -p +#创建数据库 +mysql> +create database dinky; +#授权 +mysql> +grant all privileges on dinky.* to 'dinky'@'%' identified by 'dinky' with grant option; +mysql> +flush privileges; +#此处用 dinky 用户登录 +mysql -h fdw1 -udinky -pdinky +``` + + + + +```sql +#登录mysql +mysql -uroot -p +#创建数据库 +mysql> +CREATE DATABASE dinky; +#创建用户并允许远程登录 +mysql> +create user 'dinky'@'%' IDENTIFIED WITH mysql_native_password by 'dinky'; +#授权 +mysql> +grant ALL PRIVILEGES ON dinky.* to 'dinky'@'%'; +mysql> +flush privileges; +``` + + + + + +#### 第一次部署 + +```sql +#首先登录 mysql +mysql -h fdw1 -udinky -pdinky +mysql> use dinky; +mysql> source /opt/dinky/sql/dinky-mysql.sql +``` + + +## Dinky 部署 + +:::danger 注意事项 + +自 Dinky v1.0.0 版本开始,Dinky 采用了新的打包部署方式, 提供了适配每个 Flink 版本的二进制包(tar.gz) ,需要根据 Flink 版本选择对应的 Dinky 版本,不再支持多个版本共存在单一二进制包内,请根据实际情况选择对应版本 + +::: + + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + + + + +** 解压到指定目录 ** + +```shell +tar -zxf dinky-release-${flink.version}-${dinky.version}.tar.gz +mv dinky-release-${flink.version}-${dinky.version} dinky +cd dinky +``` + + + + + +### 配置文件 + +创建好数据库后,修改 Dinky 配置文件,选择默认数据源为 mysql。 + +```shell +cd /opt/dinky/config/ +vim application.yml +# 修改 Dinky 所使用的数据库类型为 mysql +spring: + application: + name: Dinky + profiles: + # The h2 database is used by default. If you need to use other databases, please set the configuration active to: mysql, currently supports [mysql, pgsql, h2] + # If you use mysql database, please configure mysql database connection information in application-mysql.yml + # If you use pgsql database, please configure pgsql database connection information in application-pgsql.yml + # If you use the h2 database, please configure the h2 database connection information in application-h2.yml, + # note: the h2 database is only for experience use, and the related data that has been created cannot be migrated, please use it with caution + active: ${DB_ACTIVE:mysql} #[h2,mysql,pgsql] +``` + +修改 Dinky 的 mysql 的配置文件。 + +```shell +vim application-mysql.yml +# 修改 Dinky 的 mysql 链接配置 +spring: + datasource: + url: jdbc:mysql://${MYSQL_ADDR:127.0.0.1:3306}/${MYSQL_DATABASE:dinky}?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true + username: ${MYSQL_USERNAME:dinky} + password: ${MYSQL_PASSWORD:dinky} + driver-class-name: com.mysql.cj.jdbc.Driver +``` + +### 上传依赖 + +Dinky 需要具备内置的 Flink 环境,该 Flink 环境的实现需要用户自己在 Dinky 根目录下 extends/flink${FLINK_VERSION} 文件夹上传相关的 Flink 依赖,如 flink-dist, flink-table 等,具体见下文。当然也可在启动文件中指定 FLINK_HOME,但不建议这样做。 + +:::warning 注意事项 +1. Dinky 并没有内置的 mysql/postgres 数据库驱动,需要用户自己上传 mysql-connector-java-xxx.jar/postgresql-xxx.jar 等jdbc 驱动到 `lib 下`或者`extends 下` +2. Dinky 当前版本的 yarn 的 per-job 与 application 执行模式依赖 flink-shaded-hadoop ,需要额外添加 flink-shaded-hadoop-uber 包,如果您使用的是`flink-shaded-hadoop-uber-3`请手动删除该包内部的 javax.servlet 等冲突内容。 +当然如果你的 Hadoop 为 3+ 也可以自行编译对于版本的 dinky-client-hadoop.jar 以替代 uber 包, +3. Dinky所有监控相关功能目前强依赖hadoop,即使你不需要任何hadoop功能,也需要上传flink-shaded-hadoop-uber,否则会导致监控功能无法正常使用 +::: + +将 flink-shaded-hadoop 上传到到 extends 文件目录下,使用 flink-shaded-hadoop-3 地址如下: + +``` +https://mvnrepository.com/artifact/org.apache.flink/flink-shaded-hadoop-3-uber?repo=cloudera-repos +``` + +如果是 CDH 及 HDP 使用开源 flink-shaded 对 Dinky 目前没有影响,其他用到的依赖取决于 CDH 或者 HDP 与开源版本的兼容性,需要自行根据兼容性添加依赖即可正常使用 Dinky 的所有功能。 + +最终项目根目录如下,仅供参考: + +``` +├── auto.sh -- 启动停止脚本 +├── config -- 配置文件 +│ ├── jmx +│ │ └── jmx_exporter_config.yaml -- JMX 监控集成 +│ ├── application.yml -- 主要程序运行配置文件 +│ ├── application-h2.yml -- h2 配置文件 +│ ├── application-jmx.yml -- jmx 配置文件 +│ ├── application-mysql.yml -- mysql 配置文件 +│ ├── application-pgsql.yml -- pgsql 配置文件 +│ ├── DinkyFlinkDockerfile -- k8s 集群配置自动构建镜像的Dockerfile +│ └── log4j2.xml -- 日志配置 +├── dinky-loader +│ ├── ExpressionVariableClass -- 全局变量动态加载的表达式扫描配置文件 +│ └── FlinkConfClass -- 全局变量动态加载 Flink 配置的扫描配置文件 +├── extends +│ ├── flink1.14 -- 适配 Flink1.14.x +│ │ └── dinky +│ │ ├── dinky-catalog-mysql-1.14-${VERSION}.jar -- dinky 的 catalog 实现 +│ │ ├── dinky-client-1.14-${VERSION}.jar +│ │ └── dinky-connector-jdbc-1.14-${VERSION}.jar -- dinky 的 jdbc 连接器增强实现 +│ ├── flink1.15 -- 适配 Flink1.15.x +│ │ └── dinky +│ │ ├── dinky-catalog-mysql-1.15-${VERSION}.jar -- dinky 的 catalog 实现 +│ │ └── dinky-client-1.15-${VERSION}.jar +│ ├── flink1.16 -- 适配 Flink1.16.x +│ │ └── dinky +│ │ ├── dinky-catalog-mysql-1.16-${VERSION}.jar -- dinky 的 catalog 实现 +│ │ └── dinky-client-1.16-${VERSION}.jar +│ ├── flink1.17 -- 适配 Flink1.17.x +│ │ └── dinky +│ │ ├── dinky-catalog-mysql-1.17-${VERSION}.jar -- dinky 的 catalog 实现 +│ │ └── dinky-client-1.17-${VERSION}.jar +│ └── flink1.18 -- 适配 Flink1.18.x +│ │ └── dinky +│ │ ├── dinky-catalog-mysql-1.18-${VERSION}.jar -- dinky 的 catalog 实现 +│ │ └── dinky-client-1.18-${VERSION}.jar +├── jar +│ ├── dinky-app-1.14-${VERSION}-jar-with-dependencies.jar -- 适配 Flink1.14.x application +│ ├── dinky-app-1.15-${VERSION}-jar-with-dependencies.jar -- 适配 Flink1.15.x application +│ ├── dinky-app-1.16-${VERSION}-jar-with-dependencies.jar -- 适配 Flink1.16.x application +│ ├── dinky-app-1.17-${VERSION}-jar-with-dependencies.jar -- 适配 Flink1.17.x application +│ └── dinky-app-1.18-${VERSION}-jar-with-dependencies.jar -- 适配 Flink1.18.x application +├── lib +│ └── ... -- Dinky 的内部依赖 +└── sql + ├── dinky-mysql.sql -- Mysql 首次初始化脚本 + ├── dinky-pg.sql -- PGSql 首次初始化脚本 + └── upgrade -- 各个版本的升级 SQL +``` +对应 `Flink` 版本的依赖,放在Dinky 安装目录下 extends/flink${FLINK_VERSION} 下,例如: +```shell +flink-cep-1.16.1.jar +flink-connector-files-1.16.1.jar +flink-connector-jdbc-1.16.1.jar +flink-csv-1.16.1.jar +flink-dist-1.16.1.jar +flink-json-1.16.1.jar +flink-scala_2.12-1.16.1.jar +flink-shaded-hadoop-2-uber-2.7.5-8.0.jar +flink-shaded-zookeeper-3.5.9.jar +flink-table-api-java-uber-1.16.1.jar +# !!!特别注意,flink自带lib里的planner是带loader的,比如:flink-table-planner-loader-1.16.1.jar, +# 需要删除带loader的jar包,换一个不带loader的jar, 可前往flink根下的opt目录中找到 +# 对于standalone,hdfs,k8s等集群上的flink集群同样要做此操作 +flink-table-planner_2.12-1.16.1.jar + +flink-table-runtime-1.16.1.jar +log4j-1.2-api-2.17.1.jar +log4j-api-2.17.1.jar +log4j-core-2.17.1.jar +log4j-slf4j-impl-2.17.1.jar +``` +:::tip +1.0.0 之前的版本 Flink 相关依赖是放在 plugins 目录下,1.0.0 及之后是放在 extends 目录下。 + +推荐公共 jar 包放在 extends 目录下,Flink 版本的依赖放在 extends/flink${FLINK_VERSION} 下 +::: + +### 启动 Dinky + +```shell +#启动 +sh auto.sh start +#停止 +sh auto.sh stop +#重启 +sh auto.sh restart +#查看状态 +sh auto.sh status + +# 前台启动(调试使用,会输出日志,阻塞当前终端,结束请Ctrl+C,但是会直接退出服务,仅供启动时无日志输出且在排查问题时使用) +sh auto.sh startOnPending + +``` + +#### 版本适配 +启动指令的第二个参数则是版本选择,支持 【1.14, 1.15, 1.16, 1.17, 1.18, 1.19】,参考指令如下: +> 自 1.0.2 版本开始加入了自动检测 Flink 版本的功能,如果不传入版本号,则会自动检测 Flink 版本作为启动版本(即检测 extends 目录下的 flink${FLINK_VERSION} 文件夹) +```shell +#启动 +sh auto.sh start 1.16 +``` + +:::tip 说明 +服务启动后,默认端口 8888,[http://127.0.0.1:8888](http://127.0.0.1:8888) , 默认用户名/密码: admin/dinky123!@# ,如需修改,请使用默认用户名/密码登录后,在`认证中心`->`用户`中修改 + +Dinky 部署需要 MySQL5.7 以上版本 + +::: + diff --git a/docs/versioned_docs/version-1.0/deploy_guide/upgrade/_category_.json b/docs/versioned_docs/version-1.0/deploy_guide/upgrade/_category_.json new file mode 100644 index 0000000000..b65f1a32d6 --- /dev/null +++ b/docs/versioned_docs/version-1.0/deploy_guide/upgrade/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "upgrade", + "position": 4 +} diff --git a/docs/versioned_docs/version-1.0/deploy_guide/upgrade/upgrade_075to100.md b/docs/versioned_docs/version-1.0/deploy_guide/upgrade/upgrade_075to100.md new file mode 100644 index 0000000000..cc391c7ca5 --- /dev/null +++ b/docs/versioned_docs/version-1.0/deploy_guide/upgrade/upgrade_075to100.md @@ -0,0 +1,52 @@ +--- +sidebar_position: 4 +position: 4 +id: upgrade_075to100 +title: 0.7.5 升级到 1.0.0 +--- + + +:::warning 说明 + +1. 本文档为 Dinky v1.0.0 版本升级文档, 适用于从 0.7.5 升级到 1.0.0 版本. +2. 自 0.7.5 升级到 1.0.0 变化较大,存在部分不兼容变更,如果作业数量不多的情况下,建议重新建库部署,手动迁移任务. +3. 如果作业数量较大,建议先进行备份,然后执行升级脚本.但是升级脚本无法完全平滑升级,可能会存在部分数据丢失的情况,请谨慎操作. +4. 自 Dinky v1.0.0 之后, 默认密码为: dinky123!@# + +::: + +## 备份数据 + +> 自行备份数据,以防升级失败,导致数据丢失. + +## 升级 SQL + +### 使用升级脚本 + +```shell +# 假设你的 Dinky 部署在 /opt/dinky 目录下 + +# 登录到数据库,用户名和密码请自行修改 +mysql -uroot -p123455 + +# 切换到 dinky 数据库 +use dinky + +# 导入升级脚本 请注意: 先执行 ddl.sql,再执行 dml.sql +source /opt/dinky/sql/upgrade/1.0.0_schema/mysql/dinky_ddl.sql +source /opt/dinky/sql/upgrade/1.0.0_schema/mysql/dinky_dml.sql + +# 升级完成后,请检查是否有错误信息,如果有错误信息,请根据错误信息进行处理 + +# 退出数据库 +exit +``` + +### 使用数据库管理工具 + +1. 打开数据库管理工具,如 Navicat 或者 MySQL Workbench,连接到数据库,用户名和密码请自行修改. +2. 导入升级脚本,请注意: 先执行 ddl.sql,再执行 dml.sql. +3. 升级完成后,请检查是否有错误信息,如果有错误信息,请根据错误信息进行处理. +4. 退出数据库管理工具. + +> 如需手动 cv 执行, 请自行找到对应的 SQL 语句,复制到数据库管理工具中依次执行. diff --git a/docs/versioned_docs/version-1.0/deploy_guide/upgrade/upgrade_overview.md b/docs/versioned_docs/version-1.0/deploy_guide/upgrade/upgrade_overview.md new file mode 100644 index 0000000000..ceb49cb2c6 --- /dev/null +++ b/docs/versioned_docs/version-1.0/deploy_guide/upgrade/upgrade_overview.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 1 +position: 1 +id: upgrade_overview +title: 版本升级介绍 +--- + +:::caution 注意 +1. 自 Dinky 0.7.5 开始进行升级教程, 后续版本更新将在此文档及子文档中进行更新。 +2. 所有版本的升级 SQL 在部署目录下的 sql/upgrade 目录下, 升级 SQL 按照版本号进行排序, 升级 SQL 目录命名规则为 0.7.5_schema/mysql +3. 自 Dinky v1.0.0 开始支持 PostgreSQL,作为后端数据存储库实现, 升级 SQL 目录命名规则为 1.0.0_schema/postgresql +4. 注意: Dinky v1.0.0 刚支持 PostgreSQL,此数据库类型不存在升级脚本,直接执行`sql/dinky-pg.sql`即可) +5. 升级时请注意,先执行 `{version}_schema/mysql`/`{version}_schema/postgresql` 下的 `dinky_ddl.sql`,再执行 `{version}_schema/mysql`/`{version}_schema/postgresql` 下的 `dinky_dml.sql` +::: + +### 版本升级列表 + +- [0.7.5 升级到 1.0.0](upgrade_075to100) \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0/developer_guide/_category_.json b/docs/versioned_docs/version-1.0/developer_guide/_category_.json new file mode 100644 index 0000000000..1ae7ef1a79 --- /dev/null +++ b/docs/versioned_docs/version-1.0/developer_guide/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "developer_guide", + "position": 12 +} diff --git a/docs/versioned_docs/version-1.0/developer_guide/contribution/_category_.json b/docs/versioned_docs/version-1.0/developer_guide/contribution/_category_.json new file mode 100644 index 0000000000..5eb8872202 --- /dev/null +++ b/docs/versioned_docs/version-1.0/developer_guide/contribution/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "contribution", + "position": 1 +} diff --git a/docs/versioned_docs/version-1.0/developer_guide/contribution/auto_sync.md b/docs/versioned_docs/version-1.0/developer_guide/contribution/auto_sync.md new file mode 100644 index 0000000000..e80dfb5e00 --- /dev/null +++ b/docs/versioned_docs/version-1.0/developer_guide/contribution/auto_sync.md @@ -0,0 +1,19 @@ +--- +sidebar_position: 105 +position: 105 +id: auto_sync +title: 自动同步主仓库 +--- + + + +:::info 简介 + 自动同步主仓库 (upstream) 的代码到你的仓库 (origin),保持你的仓库代码与主仓库代码同步。 +::: + +## 步骤 + +1. Fork 主仓库到你的 GitHub 账号下. +2. 点击 Fork 之后的仓库, 点击 `Actions` 标签. +3. 会提示一些介绍, 点击 `I understand my workflows, go ahead and enable them` 按钮. +4. 完成之后,会在每天的 00:00:00 执行同步操作. 后续该 workflow 文件不改变的情况下,会一直按照定时配置自动执行同步操作. diff --git a/docs/versioned_docs/version-1.0/developer_guide/contribution/code_format.md b/docs/versioned_docs/version-1.0/developer_guide/contribution/code_format.md new file mode 100644 index 0000000000..a1118e9115 --- /dev/null +++ b/docs/versioned_docs/version-1.0/developer_guide/contribution/code_format.md @@ -0,0 +1,66 @@ +--- +sidebar_position: 111 +position: 111 +id: code_format +title: 代码格式化 +--- + +:::info 简介 + +如果你在 Dinky 基础上进行了二次开发/bugfix/实现了新功能,并打算贡献到社区,基于代码格式化要求,你必须执行格式化代码,满足规范后方可被合并. + +但是在 Dinky 1.0.0 之后,格式化插件升级后要求 JDK 环境为 JDK 11,如果你的 JDK 环境为 JDK 8,那么则需要升级 JDK 环境/配置服务端格式化,否则无法使用格式化插件.你的 Pull Request 的代码检查结果将会失败,从而无法被合并 + +基于上述说明,下面介绍多种方式,如何执行格式化并满足格式化要求. +::: + +## 升级 JDK 环境 + +> 此为单个 JDK 环境的升级 + +Dinky 1.0.0 之后,全面支持 JDK 11,如果你的 JDK 环境为 JDK 8,那么可以选择升级 JDK 环境,具体 JDK11 的安装方式自行搜索即可. + +## JDK 环境并存 + +如果你需要有多个 JDK 环境,那么你可以通过以下方式来实现 JDK 环境并存: + +1. 下载 JDK 11 并安装.不需要配置环境变量,只需要在 IDEA 中配置即可.前提是你所需的 JDK 主版本非 JDK11, 如果你想要设置 JDK 11 为默认,那么可以自行配置环境变量. +2. 在 IDEA 打开的 Dinky 工程中配置 JDK 11,并勾选 Maven Profile 中的 `jdk11`,并刷新 Maven Profile,使其重新加载. +3. 找到 Maven => Dinky 根下的 插件 => 展开 spotless, 双击 spotless:apply ,等待格式化完成. + +## 服务端格式化 + +如果你只需要单个 JDK 环境,并且本地的 JDK 环境版本为 JDK 8, 不想升级 JDK 环境,那么你可以通过以下方式来实现: + +> 注意: 此操作需要在你提交本地代码到你的仓库前进行. + +1. 登录你的 GitHub 账号,转到 https://github.com/settings/tokens +2. 点击下图路径, 创建 token,并指定名称为 `FORMAT`,请注意大小写,创建完成之后请牢记该 Token 值, 后续将会用到 +![create_token](http://pic.dinky.org.cn/dinky/docs/zh-CN/developer_guide/contribution/code_format/create_token.png) +3. 打开你的 GitHub 中 Fork 的 Dinky 仓库 -> Settings -> Secrets and variables -> Actions +![secrets_url](http://pic.dinky.org.cn/dinky/docs/zh-CN/developer_guide/contribution/code_format/secrets_url.png) +4. 点击 Secrets Tag -> New repository secret -> 名称指定为 `TOKEN` , 粘贴你在第一步中创建的 token 值, 点击 Add secret +5. 点击 Variables -> New repository variable -> 名称指定为 `FORMAT` , 值为`true`, 点击 Add variable +![variables_url](http://pic.dinky.org.cn/dinky/docs/zh-CN/developer_guide/contribution/code_format/variables_url.png) + +6. 基于此方式,可以一劳永逸,无需在 IDEA 中手动执行格式化,并无需安装 JDK 11 环境. 只需要正常修改/新增代码 -> 提交到你的 Dinky 仓库即可,服务端会自动执行格式化,并将结果反馈在 下图所示的 Actions 界面中. +![show_actions](http://pic.dinky.org.cn/dinky/docs/zh-CN/developer_guide/contribution/code_format/show_actions.png) +此方式使用 GITHUB 的 Actions 服务,每次提交代码都会触发 Actions 服务,并执行格式化,如果格式化失败,则会反馈失败信息,如果格式化成功,则会反馈成功信息. + + +## 前端格式化 +> 由于在 Dinky 1.0.0 之后,前端代码也需要进行格式化,但是在 本地只能通过手动执行格式化的方式来实现,所以在此提供一种方案,进行前端代码格式化. 如果配置了服务端格式化,那么可以忽略此步骤.由 GITHUB Actions 服务来执行格式化. + +步骤: +1. 进入 dinky-web 目录,执行 `npm install -f` 安装依赖 +2. 执行 `npm run prettier` 进行格式化. + + +:::tip 提示 + +以上为几种如何实现格式化的方案, 请根据你的实际情况选择合适的方式.推荐使用 [服务端格式化](#服务端格式化) 的方式,因为它更加方便,而且不会影响你的本地环境. + +如果你在提交没有进行代码格式化且没有配置服务端格式化, 那么你的 Pull Request 将 actions 失败,并提示你进行格式化.如果你的 JDK 环境为 JDK 8,那么你需要升级 JDK 环境或者配置服务端格式化,否则无法通过格式化检查. +如果 JDK 环境为 JDK 11,那么你可以在 IDEA 中配置 JDK 11,并勾选 Maven Profile 中的 `jdk11`,并刷新 Maven Profile,使其重新加载,然后再修改的类中再次回车触发修改,使该文件处于变更列表内,然后执行格式化即可.最后再进行提交. + +::: \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0/developer_guide/contribution/commit_code.md b/docs/versioned_docs/version-1.0/developer_guide/contribution/commit_code.md new file mode 100644 index 0000000000..e0ae0f49ba --- /dev/null +++ b/docs/versioned_docs/version-1.0/developer_guide/contribution/commit_code.md @@ -0,0 +1,86 @@ +--- +sidebar_position: 108 +position: 108 +id: commit_code +title: 提交代码须知 +--- + + + +# 提交代码 + +* 首先从远端仓库 *https://github.com/DataLinkDC/dinky.git* fork 一份代码到自己的仓库中 + +* 远端仓库中分支: + * dev 日常开发分支: 日常 dev 开发分支,新提交的代码都可以 pull request 到这个分支上。 + * 0.7.x 发布版本分支: 0.7.x 发布版本分支,目前仅接受 bugfix + * 1.x.x 发布版本分支 + +* 把自己仓库 clone 到本地 + + ```sh + git clone https://github.com/DataLinkDC/dinky.git + ``` + +* 添加远端仓库地址,命名为 upstream + + ```sh + git remote add upstream https://github.com/DataLinkDC/dinky.git + ``` + + + +* 查看仓库 + + ```sh + git remote -v + ``` + +> 此时会有两个仓库:origin(自己的仓库)和 upstream(远端仓库) + +* 获取/更新远端仓库代码(已经是最新代码,就跳过) + + ```sh + git fetch upstream + ``` + + +* 同步远端仓库代码到本地仓库 + + ```sh + git checkout origin/dev + git merge --no-ff upstream/dev + ``` + +如果远端分支有新加的分支比如`dev-1.0`,需要同步这个分支到本地仓库 + + ```sh + git checkout -b dev-1.0 upstream/dev-1.0 + git push --set-upstream origin dev-1.0 + ``` + +* 新建分支 + + ```sh + git checkout -b xxx origin/dev + ``` + +确保分支 `xxx` 是基于官方 dev 分支的最新代码 + + +* 在新建的分支上本地修改代码以后,提交到自己仓库: + + ```sh + git commit -m 'commit content' + git push origin xxx --set-upstream + ``` + +* 将修改提交到远端仓库 + + * 在 github 的 Pull Request 页面,点击 "New pull request" + + * 选择修改完的本地分支和要合并的目的分支,点击 "Create pull request" + +* 接着社区 Committer 们会做 CodeReview,然后他会与您讨论一些细节(包括设计,实现,性能等)。当团队中所有人员对本次修改满意后,会将提交合并到 dev 分支 + +* 最后,恭喜您已经成为了 Dinky 的官方贡献者! \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0/developer_guide/contribution/commit_message.md b/docs/versioned_docs/version-1.0/developer_guide/contribution/commit_message.md new file mode 100644 index 0000000000..ae0fffd0dd --- /dev/null +++ b/docs/versioned_docs/version-1.0/developer_guide/contribution/commit_message.md @@ -0,0 +1,97 @@ +--- +sidebar_position: 109 +position: 109 +id: commit_message +title: Commit Message 须知 +--- + + +一个好的 commit message 是能够帮助其他的开发者(或者未来的开发者)快速理解相关变更的上下文,同时也可以帮助项目管理人员确定该提交是否适合包含在发行版中。但当我们在查看了很多开源项目的 commit log 后,发现一个有趣的问题,一部分开发者,代码质量很不错,但是 commit message 记录却比较混乱,当其他贡献者或者学习者在查看代码的时候,并不能通过 commit log 很直观的了解 +该提交前后变更的目的,正如 Peter Hutterer 所言:Re-establishing the context of a piece of code is wasteful. We can’t avoid it completely, so our efforts should go to reducing it as much as possible. Commit messages can do exactly that and as a result, a commit message shows whether a developer is a good collaborator. 因此,DolphinScheduler 结合其他社区以及 Apache 官方文档制定了该规约。 + +### Commit Message RIP + +#### 1:明确修改内容 + +commit message 应该明确说明该提交解决了哪些问题(bug 修复、功能增强等),以便于用户开发者更好的跟踪问题,明确版本迭代过程中的优化情况。 + +#### 2:关联相应的Pull Request 或者Issue + +当我们的改动较大的时候,commit message 最好能够关联 GitHub 上的相关 Issue 或者 Pull Request,这样,我们的开发者在查阅代码的时候能够通过关联信息较为迅速的了解改代码提交的上下文情景,如果当前 commit 针对某个 issue,那么可以在 Footer 部分关闭这个 issue。 + +#### 3:统一的格式 + +格式化后的 CommitMessage 能够帮助我们提供更多的历史信息,方便快速浏览,同时也可以直接从 commit 生成 Change Log。 + +Commit message 应该包括三个部分:Header,Body 和 Footer。其中,Header 是必需的,Body 和 Footer 可以省略。 + +##### header + +Header 部分只有一行,包括三个字段:type(必需)、scope(可选)和 subject(必需)。 + +[ISSUE编号][type] subject + +(1) type 用于说明 commit 的类别,只允许使用下面7个标识。 + +* feat:新功能(feature) +* fix:修补bug +* docs:文档(documentation) +* style: 格式(不影响代码运行的变动) +* refactor:重构(即不是新增功能,也不是修改bug的代码变动) +* test:增加测试 +* chore:构建过程或辅助工具的变动 + +如果 type 为 feat 和 fix,则该 commit 将肯定出现在 Change log 之中。其他情况(docs、chore、style、refactor、test)建议不放入。 + +(2)scope + +scope 用于说明 commit 影响的范围,比如 admin、alert 等,如果没有更合适的范围,你可以用 *。 + +(3) subject + +subject 是 commit 目的的简短描述,不超过50个字符。 + +##### Body + +Body 部分是对本次 commit 的详细描述,可以分成多行,换行符将以72个字符换行,避免自动换行影响美观。 + +Body 部分需要注意以下几点: + +* 使用动宾结构,注意使用现在时,比如使用 change 而非 changed 或 changes + +* 首字母不要大写 + +* 语句最后不需要 ‘.’ (句号) 结尾 + + +##### Footer + +Footer只适用于两种情况 + +(1) 不兼容变动 + +如果当前代码与上一个版本不兼容,则 Footer 部分以 BREAKING CHANGE 开头,后面是对变动的描述、以及变动理由和迁移方法。 + +(2) 关闭 Issue + +如果当前 commit 针对某个issue,那么可以在 Footer 部分关闭这个 issue,也可以一次关闭多个 issue 。 + +##### 举个例子 + +[DS-001][docs-zh] add commit message + +* commit message RIP +* build some conventions +* help the commit messages become clean and tidy +* help developers and release managers better track issues + and clarify the optimization in the version iteration + +This closes #001 + +### 参考文档 + +[提交消息格式](https://cwiki.apache.org/confluence/display/GEODE/Commit+Message+Format) + +[On commit messages-Peter Hutterer](http://who-t.blogspot.com/2009/12/on-commit-messages.html) + +[RocketMQ Community Operation Conventions](https://mp.weixin.qq.com/s/LKM4IXAY-7dKhTzGu5-oug) \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0/developer_guide/contribution/document.md b/docs/versioned_docs/version-1.0/developer_guide/contribution/document.md new file mode 100644 index 0000000000..f8388ff5cf --- /dev/null +++ b/docs/versioned_docs/version-1.0/developer_guide/contribution/document.md @@ -0,0 +1,52 @@ +--- +sidebar_position: 110 +position: 110 +id: document +title: 文档贡献 +--- + +良好的使用文档对任何类型的软件都是至关重要的。欢迎任何可以改进 Dinky 文档的贡献。 + +### 获取文档项目 + +Dinky 项目的文档维护在 [dinky主仓库/docs 下](https://github.com/DataLinkDC/dinky/tree/dev/docs) 。 + +首先你需要先将源项目 fork 到自己的 github 仓库中,然后将 fork 的文档克隆到本地计算机中。 + +```shell +git clone https://github.com//dinky +``` +### 文档环境 + +Docusaurus 网站由 [Docusaurus](https://docusaurus.io/docs/category/getting-started) 提供支持。 + +请确保你已经安装了 nodejs 和 npm 。详细安装步骤可以查阅本地调试。 + +### 文档构建 + +在 Dinky 的根目录下执行: + +```shell +# 推荐 +npm install +# 运行 Docusaurus serve 启动一个本地服务器 +npm start +``` + +可以方便地实时预览效果。默认访问地址 [http://localhost:3000](http://localhost:3000/) + +### 文档规范 + +汉字与英文、数字之间需空格,中文标点符号与英文、数字之间不需空格,以增强中英文混排的美观性和可读性。 + +建议在一般情况下使用 “你” 即可。当然必要的时候可以使用 “您” 来称呼,比如有 warning 提示的时候。 + +### 怎样提交文档 Pull Request + +不要使用“git add.”提交所有更改。只需推送更改的文件,例如:*.md。 + +向 dev 分支提交 Pull Request。 + +### 参考文档 + +更多规范请参考 [Apache Flink 中文文档规范](https://cwiki.apache.org/confluence/display/FLINK/Flink+Translation+Specifications) \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0/developer_guide/contribution/how_contribute.md b/docs/versioned_docs/version-1.0/developer_guide/contribution/how_contribute.md new file mode 100644 index 0000000000..f8dc0a3892 --- /dev/null +++ b/docs/versioned_docs/version-1.0/developer_guide/contribution/how_contribute.md @@ -0,0 +1,59 @@ +--- +sidebar_position: 104 +position: 104 +id: how_contribute +title: 如何贡献 +--- + + + +## 如何贡献 + +首先非常感谢大家选择和使用 Dinky & Apache Flink,真诚地欢迎大家加入 Dinky 社区与 Apache Flink 中文社区,融入开源世界,打造新一代实时计算框架与平台,共建共赢! + +我们鼓励任何形式的参与社区,如: + +- 将遇到的问题通过 github 上 [issue](https://github.com/DataLinkDC/dinky/issues) 的形式反馈出来 +- 回答别人遇到的 [issue](https://github.com/DataLinkDC/dinky/issues) 问题 +- 讨论新 Feature 的实现方案 +- 帮助完善文档及官网 +- 帮助项目增加测试用例 +- 为代码添加注释 +- 为代码添加国际化 +- 提交修复 Bug 或者 Feature 的 PR +- 发表应用案例实践、扩展组件分享或者与 Flink SQL 相关的技术文章 +- 帮助推广 Dinky,基于 Dinky 实践参与其他社区文章发表、技术大会或者 meetup 的分享等 +- 提供或赞助云服务器资源搭建云 Dinky 学习环境 + +欢迎加入贡献的队伍,加入开源从提交第一个 PR 开始 + +- 比如添加代码注释或找到带有 ”easy to fix” 标记或一些非常简单的 issue(拼写错误等)等等,先通过第一个简单的 PR 熟悉提交流程 + +注:贡献不仅仅限于 PR,对促进项目发展的都是贡献 + +相信参与 Dinky,一定会让您从开源中受益匪浅! + +## 参与文档贡献 + +请查阅 [文档贡献](./document) + +## 参与代码贡献 + +IDEA 调试请查阅 [本地调试](../local_debug) 及 [远程调试](../remote_debug) + +贡献请查阅 [Issue 需知](./issue),[Pull Request 需知](./pull_request),[Commit Message 需知](./commit_message) + +## 如何领取 Issue,提交 Pull Request + +如果你想实现某个 Feature 或者修复某个 Bug。请参考以下内容: + +- 所有的 Bug 与新 Feature 建议使用 Issues Page 进行管理。 +- 如果想要开发实现某个 Feature 功能,请先回复该功能所关联的 Issue,表明你当前正在这个 Issue 上工作。 并在回复的时候为自己设置一个最后期限,并添加到回复内容中。 +- 你应该新建一个分支来开始你的工作,分支的名字参考 [Pull Request 需知](./pull_request)。比如,你想完成 feature 功能并提交了 Issue demo,那么你的 branch 名字应为 feature-demo。 功能名称可与导师讨论后确定。 +- 完成后,发送一个 Pull Request 到 Dinky 的 dev 分支,提交过程具体请参考下面《[提交代码须知](./commit_code)》。 + +如果是想提交 Pull Request 完成某一个 Feature 或者修复某个 Bug,这里都建议大家从小处做起,完成一个小功能就提交一次,每次别改动太多文件,改动文件太多也会给 Reviewer 造成很大的心理压力,建议通过多次 Pull Request 的方式完成。 + +:::info 信息 +本文档参考了《 [DolphinScheduler Contribute](https://dolphinscheduler.apache.org/zh-cn/community/development/contribute.html) 》,非常感谢 DolphinScheduler 社区的支持。 +::: \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0/developer_guide/contribution/issue.md b/docs/versioned_docs/version-1.0/developer_guide/contribution/issue.md new file mode 100644 index 0000000000..9494d88479 --- /dev/null +++ b/docs/versioned_docs/version-1.0/developer_guide/contribution/issue.md @@ -0,0 +1,152 @@ +--- +sidebar_position: 106 +position: 106 +id: issue +title: Issue 须知 +--- +Issues 功能被用来追踪各种特性,Bug,功能等。项目维护者可以通过 Issues 来组织需要完成的任务。 + +Issue 是引出一个 Feature 或 Bug 等的重要步骤,在单个 Issue 中可以讨论的内容包括但不限于 Feature 的包含的功能,存在的 Bug 产生原因,前期方案的调研,以及其对应的实现设计和代码思路。 + +并且只有当 Issue 被 approve 之后才需要有对应的 Pull Request 去实现。 + +如果是一个 Issue 对应的是一个大 Feature,建议先将其按照功能模块等维度分成多个小的 Issue。 + +### Issue 标题 + +标题格式:[`Issue 类型`][`模块名`] `Issue 描述` + +其中`Issue 类型`如下: + + +| Issue 类型 | 描述 | 样例 | +| ------------- | ------------------------------------------------------------------------------------------ | ---------------------------------------------------- | +| Feature | 包含所期望的`新功能`和`新特性 ` | [Feature][admin] Add xxx admin in xxx controller | +| Bug | 程序中存在的`Bug` | [Bug][admin] Throw exception when xxx | +| Improvement | 针对目前程序的一些`改进`,不限于`代码格式`,`程序性能`等 | [Improvement][executor] Improve xxx on executor | +| Test | 专门针对`测试用例`部分 | [Test][metadata-mysql] Add xxx metadata-mysql test | +| Sub-Task | 一般都是属于`Feature` 类的子任务,针对大 Feature,可以将其分成很多个小的子任务来一一完成 | [Sub-Task][executor] Implement xxx in xxx | + +其中`模块名`如下: + + +| 模块名 | 描述 | +| ------------ | ---------------------- | +| admin | 管理模块 | +| alert | 报警模块 | +| app | Flink APP 模块 | +| assembly | 打包模块 | +| client | Flink Client 模块 | +| common | 基础模块 | +| connectors | Flink Connector 模块 | +| core | 核心模块 | +| doc | 资源模块 | +| docs | 官网文档 | +| executor | 执行器模块 | +| extends | 扩展模块 | +| function | Flink UDF 模块 | +| gateway | 提交网关模块 | +| metadata | 元数据模块 | +| web | Web 模块 | + +### Issue 内容模板 + +[Issue 模板](https://github.com/DataLinkDC/dinky/tree/dev/.github/ISSUE_TEMPLATE) + +### Bug 类 Issue + +当您发现一个 Bug 时,请提交一个 Issue 类的 Bug,提交前: + +* 请先在 issue 列表里查找一下是否该 Bug 已经提交,如果已经有此 Bug,请在此 Bug 下接着回复。 +* 如果该 Bug 是可以复现的。请尽量提供完整的重现步骤。 + +请在 Issues 页面中提交 Bug。 + +一个高质量的 Bug 通常有以下特征: + +* 使用一个清晰并有描述性的标题来定义 Bug。 +* 详细的描述复现 Bug 的步骤。包括您的配置情况,预计产生的结果,实际产生的结果。并附加详细的 TRACE 日志。 +* 如果程序抛出异常,请附加完整的堆栈日志。 +* 如有可能,请附上屏幕截图或动态的 GIF 图,这些图片能帮助演示整个问题的产生过程。 +* 哪个版本。 +* 需要修复的优先级(危急、重大、次要、细微)。 + +下面是 **Bug 的 Markdown 内容模板**,请按照该模板填写 issue。 + +```shell +**标题** +标题格式: [BUG][Priority] bug标题 +Priority分为四级: Critical、Major、Minor、Trivial + +**问题描述** +[清晰准确描述遇到的问题] + +**问题复现步骤:** +1. [第一步] +2. [第二步] +3. [...] + +**期望的表现:** +[在这里描述期望的表现] + +**观察到的表现:** +[在这里描述观察到的表现] + +**屏幕截图和动态GIF图** +![复现步骤的屏幕截图和动态GIF图](图片的url) + +**Dinky 版本:(以0.6.0为例)** + -[0.6.0] + +**补充的内容:** +[请描述补充的内容,比如] + +**需求或者建议** +[请描述你的需求或者建议] +``` + +### Feature 类 Issue + +提交前: + +* 请确定这不是一个重复的功能增强建议。 查看 Issue Page 列表,搜索您要提交的功能增强建议是否已经被提交过。 + +请在 issues 页面中提交 Feature。 + +一个高质量的 Feature 通常有以下特征: + +* 一个清晰的标题来定义 Feature +* 详细描述 Feature 的行为模式 +* 说明为什么该 Feature 对大多数用户是有用的。新功能应该具有广泛的适用性。 +* 尽量列出其他平台已经具备的类似功能。商用与开源软件均可。 + +以下是 **Feature 的 Markdown 内容模板**,请按照该模板填写 issue 内容。 + +```shell +**标题** +标题格式: [Feature][Priority] feature标题 +Priority分为四级: Critical、Major、Minor、Trivial + +**Feature的描述** +[描述新Feature应实现的功能] + +**为什么这个新功能是对大多数用户有用的** +[解释这个功能为什么对大多数用户是有用的] + +**补充的内容** +[列出其他的调度是否包含该功能,是如何实现的] + +``` + +### Contributor + +除一些特殊情况之外,在开始完成 Issue 之前,建议先在 Issue 下或者邮件列表中和大家讨论确定设计方案或者提供设计方案,以及代码实现思路。 + +如果存在多种不同的方案,建议通过邮件列表或者在 Issue 下进行投票决定,最终方案和代码实现思路被 approve 之后,再去实现,这样做的主要目的是避免在 +Pull Request review 阶段针对实现思路的意见不同或需要重构而导致 waste time。 + +### 相关问题 + +- 当出现提出 Issue 的用户不清楚该 Issue 对应的模块时的处理方式。 + + 确实存在大多数提出 Issue 用户不清楚这个 Issue 是属于哪个模块的,其实这在很多开源社区都是很常见的。在这种情况下,其实 committer/contributor 是知道这个 Issue 影响的模块的,如果之后这个 Issue 被 committer 和 contributor approve 确实有价值,那么 committer 就可以按照 Issue 涉及到的具体的模块去修改 Issue 标题,或者留言给提出 Issue 的用户去修改成对应的标题。 diff --git a/docs/versioned_docs/version-1.0/developer_guide/contribution/pull_request.md b/docs/versioned_docs/version-1.0/developer_guide/contribution/pull_request.md new file mode 100644 index 0000000000..63dc3cbf22 --- /dev/null +++ b/docs/versioned_docs/version-1.0/developer_guide/contribution/pull_request.md @@ -0,0 +1,55 @@ +--- +sidebar_position: 107 +position: 107 +id: pull_request +title: Pull Request 须知 +--- +Pull Request 本质上是一种软件的合作方式,是将涉及不同功能的代码,纳入主干的一种流程。这个过程中,可以进行讨论、审核和修改代码。 + +在 Pull Request 中尽量不讨论代码的实现方案,代码及其逻辑的大体实现方案应该尽量在 Issue 或者邮件列表中被讨论确定,在 Pull Request 中我们尽量只关注代码的格式以及代码规范等信息,从而避免实现方式的意见不同而导致 waste time。 + +### Pull Request 标题 + +标题格式:[`Pull Request 类型`-`Issue 号`][`模块名`] `Pull Request 描述` + +例如:`[Fix-3333][admin] Fix global variables are not valid` + +其中`Pull Request 类型`和`Issue 类型`的对应关系如下: + + +| Issue 类型 | Pull Request 类型 | 样例(假设 Issue 号为 3333) | +| ------------- | ----------------------- |-----------------------------------------------------| +| Feature | Feature | [Feature-3333][admin] Implement xxx | +| Bug | Fix | [Fix-3333][web] Fix xxx | +| Optimization | Optimization | [Optimization-3333][alert] Optimize xxx | +| Improve | Improve | [Improve-3333][core] Improve xxx | +| Test | Test | [Test-3333][metadata-mysql] Add the e2e test of xxx | +| Document | Document | [Document-3333][cdc] Add the document of xxx | + +其中 `Issue 号`是指当前 Pull Request 对应要解决的 Issue 号,`模块名`同 Issue 的模块名。 + +### Pull Request 分支名 + +分支名格式:`Pull Request 类型`-`Issue 号`,举例:Feature-1。 + +### Pull Request 内容 + +请参阅到 commit message 篇。 + +### Pull Request Code Style + +当你向 Dinky 提交 pull request 的时候 code-style 是你不得不考虑的问题。我们在 CI 中使用 Spotless 来保持代码风格的统一,它是一种帮助开发者编写遵循编码规范的 Java 代码格式化工具。如果你的 pull request 没有通过 Spotless 的检测,那它将不会被合并到主库中。你可以在提交 pull request 前使用 Spotless 来检测或者格式化你的代码。 + +1. 在提交 pull request 前格式化你的代码:执行 `mvn spotless:apply -P flink-all` 自动格式化。格式化代码的最佳时间是将你的修改提交到本地 git 版本库之前 + +2. 在提交 pull request 前编译整个项目:在 IDEA 中的 Profiles 中选择 aliyun,flink-all,nexus,prod,scala-2.12,web,重载项目后执行 `mvn clean install -P aliyun,prod,scala-2.12,web,flink-all`,编译成功后即可提交代码 + +### 相关问题 + +- 怎样处理一个 Pull Request 对应多个 Issue 的场景。 + + 首先 Pull Request 和 Issue 一对多的场景是比较少的。Pull Request 和 Issue 一对多的根本原因就是出现了多个 + Issue 需要做大体相同的一件事情的场景,通常针对这种场景就是把多个功能相同的 Issue 合并到同一个 Issue 上,然后把其他的 + Issue 进行关闭。 + + 尽量把一个 Pull Request 作为最小粒度。如果一个 Pull Request 只做一件事,Contributor 容易完成,Pull Request 影响的范围也会更加清晰,对 reviewer 的压力也会小。 diff --git a/docs/versioned_docs/version-1.0/developer_guide/local_debug.md b/docs/versioned_docs/version-1.0/developer_guide/local_debug.md new file mode 100644 index 0000000000..1b9911ccf6 --- /dev/null +++ b/docs/versioned_docs/version-1.0/developer_guide/local_debug.md @@ -0,0 +1,220 @@ +--- +sidebar_position: 2 +id: local_debug +title: 本地调试 +--- + +# 开发者本地调试手册 + +:::tip +前置知识: + +- Flink, Java, Maven, Node, React, Ant Design Pro +- MySQL/PostgreSQL/H2 +- IntelliJ IDEA + +::: + +## 前置条件 + +在搭建Dinky开发环境之前请确保你已经安装如下软件 + +- Git:版本控制软件 +- JDK环境:后端开发环境,支持 Java8 和 Java11 +- Maven:Java包管理 +- Node:前端开发; +- MySQL/PostgreSQL/H2:数据库 +- IntelliJ IDEA:IDEA开发工具(建议使用 2023.2 版本以上,旧版本对 Maven Profile 支持不友好) +- Lombok:IDEA插件,用于简化代码 + +### 环境要求 + +| 环境 | 版本 | +|:----------------:|:------------------------:| +| npm | 10+ | +| node.js | 18+ | +| jdk | Java8 或者 Java11 | +| maven | 3.8+ | +| lombok | IDEA插件安装 | +| MySQL/PostgreSQL | MySQL5.7+ / PostgreSQL15 | + +### 代码克隆 + +请通过 git 管理工具/IDEA 进行代码克隆,从 GitHub 中拉取 Dinky 源码 + +```shell +mkdir workspace +cd workspace +git clone https://github.com/DataLinkDC/dinky.git +#或者 +git clone git://github.com/DataLinkDC/dlink.git +``` + +### 导入 Dinky + +1. 启动 IDEA 并选择 Open。 +2. 选择已克隆的 Dinky 存储库的根文件夹。 +3. 等待项目加载完成。 +4. 设置 JDK 1.8 和 Maven 3.8+。 + +## 前端环境 + +推荐使用 nvm 管理 node 版本,安装 nvm 后,执行以下命令安装 node + +```bash +# linux/mac +curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash +``` + +> 在 Windows 上推荐使用 [nvm-desktop](https://github.com/1111mp/nvm-desktop) 管理软件进行安装,安装完成后在界面中选择合适版本的 +> node 版本安装即可 + +### 初始化依赖 + +代码 Clone 完成后,进入 `dinky-web` 目录,执行以下命令安装依赖 + +```bash +npm install --force +``` + +### 启动前端 + +在 `dinky-web` 目录下执行以下命令启动前端,也可在 IDEA 中打开`dinky-web`下的`package.json`文件,点击`dev`左侧启动按钮启动前端 + +```bash +npm run dev +``` + +## 后端环境 + +:::warning 注意 +在此默认将使用 IDEA 进行后端代码调试. 所有操作都基于 IDEA 进行界面化操作.不再进行命令行操作. + +由于目前 Dinky 各个模块未发布到 Maven 中央仓库,所以需要先进行 Install 编译。从而在本地仓库中生成相应的依赖。 + +如果你是第一次编译 Dinky,那么请勾选以下 Maven Profile,然后双击下图中的`生命周期 -> Install`进行编译。如果在 +Install/Package 过程中报错代码格式化问题,请参考 [代码格式化](contribution/code_format)章节 +::: + +![localdebug_profile](http://pic.dinky.org.cn/dinky/docs/zh-CN/developer_guide/local_debug/localdebug_profile.png) + +### Profile 说明 + +| Profile | 说明 | +|:--------------------:|:----------------------------------------------------------------------------------:| +| dev | 开发环境/本地调试,默认不选中,此功能主要用于本地调试或者二次开发,用于加载相关依赖 | +| aliyun | 加速依赖下载 | +| fast | 主要用于跳过代码检查和代码格式化
注意:如果 JDK 环境为 jdk8 需要勾选此 profile,否则会报错
如果 JDK 环境为 11 无需勾选 | +| flink-1.14 | 用于指定 Flink 版本为 1.14,只能单选,需要勾选 flink-single-version | +| flink-1.15 | 用于指定 Flink 版本为 1.15,只能单选,需要勾选 flink-single-version | +| flink-1.16 | 用于指定 Flink 版本为 1.16,只能单选,需要勾选 flink-single-version | +| flink-1.17 | 用于指定 Flink 版本为 1.17,只能单选,需要勾选 flink-single-version | +| flink-1.18 | 用于指定 Flink 版本为 1.18,只能单选,需要勾选 flink-single-version | +| flink-1.19 | 用于指定 Flink 版本为 1.19,只能单选,需要勾选 flink-single-version | +| flink-all | 主要用于本地的 install 生成依赖到本地仓库,不适合用打包部署 | +| flink-single-version | 配合单版本打包或者调试下勾选 | +| jdk11 | 用于指定 JDK 版本为 11,前提是本地已经安装了 JDK 11,如果没有安装 jdk11,则默认使用本地的 jdk8 | +| mac | 用于适配在 mac 系统上进行调试 | +| maven-central | 用于指定 maven 仓库为中央仓库 | +| prod | 生产环境,默认选中,此功能主要用于编译打包,此 profile 会将部分依赖排除掉,不会打进最终 tar.gz 包内 | +| scala-2.11 | 用于指定 Scala 版本为 2.11,只能单选 | +| scala-2.12 | 用于指定 Scala 版本为 2.12,只能单选 | +| web | 打包前端资源,需要勾选 | + +:::warning 注意 + +- 其他差异化配置为自己的 Maven 的 settings.xml 文件中的 profile 配置,请忽略 +- 如果无JDK11环境, 默认使用JDK8,如果需要使用JDK11,请在IDEA中配置JDK11环境 +- 注意 Profile 之间的冲突,如 flink-1.14 和 flink-1.15 不能同时勾选,否则会报错 +- 注意 Profile 是否是灰色,如果是灰色,说明此 Profile 被默认选中了,请根据自己的需求进行勾选或者取消勾选 + +::: + +### 开发者须知 + +Dinky开发环境配置有两种模式,分别是 provided 环境和 compile 环境 + +- provided:即上述 Profile 中的 `prod` ,此环境适合打包部署,或者二次开发后打包部署 +- compile: 即上述 Profile 中的 `dev`,此环境适合二次开发或者熟悉源码,此模式不需要额外安装Flink,通过Flink自带的local模式便可调试开发 + +### 本地调试 Profile + +![localdebug_dev_profile](http://pic.dinky.org.cn/dinky/docs/zh-CN/developer_guide/local_debug/localdebug_dev_profile.png) + +### 打包部署 Profile + +![locadenug_single_package_profile](http://pic.dinky.org.cn/dinky/docs/zh-CN/developer_guide/local_debug/locadenug_single_package_profile.png) + +## Dinky 本地开发环境搭建 + +### 分支选择 + +开发不同的代码需要不同的分支 + +- 如果要基于二进制包进行开发,需要切换到对应的分支代码,如 `realease-1.0.0` 分支; +- 如果想要开发新代码,切换到dev分支即可; + +下面说明在启动前如何修改相应的代码,为本地启动做准备。修改 + +### 修改配置文件 + +> 以 MySQL 为例, 如果使用 PostgresSQL/H2 请自行修改,注意: 默认使用 H2 数据库时无需修改如下配置,直接 [启动后端服务](#启动后端服务) + +- 修改 dinky-admin/src/main/resources/application-mysql.yml 文件,配置相应的数据库连接信息 + +```yaml +spring: + datasource: + url: jdbc:mysql://${MYSQL_ADDR:192.168.1.22:3306}/${MYSQL_DATABASE:dinky}?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true + username: ${MYSQL_USERNAME:root} + password: ${MYSQL_PASSWORD:root} + driver-class-name: com.mysql.cj.jdbc.Driver +``` + +- 修改 dinky-admin/src/main/resources/application.yml 文件,将`spring.profiles.active` 设置为 mysql + +```yaml +spring: + # Dinky application name + application: + name: Dinky + profiles: + # The h2 database is used by default. If you need to use other databases, please set the configuration active to: mysql, currently supports [mysql, pgsql, h2] + # If you use mysql database, please configure mysql database connection information in application-mysql.yml + # If you use pgsql database, please configure pgsql database connection information in application-pgsql.yml + # If you use the h2 database, please configure the h2 database connection information in application-h2.yml, + # note: the h2 database is only for experience use, and the related data that has been created cannot be migrated, please use it with caution + active: mysql #[h2,mysql,pgsql] +``` + +### 初始化数据库 + +在 MySQL 数据库自行创建用户/使用默认 root 用户,并创建 dinky 数据库,在 dinky 数据库中执行 script/sql/dinky-mysql.sql +文件。此外 script/sql/upgrade 目录下存放了了各版本的升级 sql ,如需执行:请依次按照版本号执行。 + +以上文件修改完成后,就可以启动Dinky。 + +### 启动后端服务 + +启动 dinky-admin/src/main/java/org/dinky/ 下的 Dinky 启动类,可见如下信息: + +![localdebug_idea_console_log](http://pic.dinky.org.cn/dinky/docs/zh-CN/developer_guide/local_debug/localdebug_idea_console_log.png) + +:::warning 注意 + +上述地址全为后端端口,前端端口为 8000, 如果在 [启动前端](#启动前端) 已经成功启动, 则直接访问 127.0.0.1:8000 即可 + +如果在 [启动前端](#启动前端) 未成功启动, 则需要先启动前端, 再访问 127.0.0.1:8000 + +注意: 默认用户名/密码为 admin/dinky123!@# ,如需修改,请使用默认用户名/密码登录后,在`认证中心`->`用户`中修改 +::: + +:::tip 说明 +以上内容是 Dinky 在 IDEA 本地环境搭建步骤,并简单介绍了如何在本地配置/启动 Dinky。在了解上述步骤后,可以动手改造 Dinky。 + +如果你在 Dinky 的基础上进行了二次开发,并有意向将代码贡献给 Dinky,请参考 [代码贡献](./contribution/how_contribute) 文档。 +::: + +## 常见问题 + +请参考 [本地调试 FAQ](../faq#本地调试FAQ) 文档。 \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0/extend/_category_.json b/docs/versioned_docs/version-1.0/extend/_category_.json new file mode 100644 index 0000000000..4f75863a25 --- /dev/null +++ b/docs/versioned_docs/version-1.0/extend/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "extend", + "position": 13 +} diff --git a/docs/versioned_docs/version-1.0/extend/expand_statements/_category_.json b/docs/versioned_docs/version-1.0/extend/expand_statements/_category_.json new file mode 100644 index 0000000000..37138fcbd9 --- /dev/null +++ b/docs/versioned_docs/version-1.0/extend/expand_statements/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "extended_grammar", + "position": 2 +} diff --git a/docs/versioned_docs/version-1.0/extend/expand_statements/add_file_statement.md b/docs/versioned_docs/version-1.0/extend/expand_statements/add_file_statement.md new file mode 100644 index 0000000000..7dd3b42c1a --- /dev/null +++ b/docs/versioned_docs/version-1.0/extend/expand_statements/add_file_statement.md @@ -0,0 +1,59 @@ +--- +sidebar_position: 8 +position: 4 +id: add_file_statement +title: ADD FILE +--- + +:::info 背景 + +在某些场景下,用户不仅需要将 jar 上传到 Flink 集群中,可能还需要添加一些其他类型的文件到环境中,比如配置文件、资源文件等。 + +为了支持这种场景,我们在 Dinky 中新增了`ADD FILE` 语法, 原理与`ADD CUSTOMJAR`类似, 用于将文件添加到环境中, 以供 Flink 任务使用。 + +同样支持全模式提交。也支持从资源中心(rs:/ 协议)中获取文件。 + +ADD FILE 同样可以达到 `ADD CUSTOMJAR` 的效果, 但是从设计上 ADD CUSTOMJAR 更适合于添加 jar 包, ADD FILE 更适合于添加其他类型的文件。 + +::: + +> 语法: +```sql +ADD FILE '.jar' +``` + + +## 实战范围 + + + +当需要添加一些文件到环境中时,可以使用 ADD FILE 语法,比如: + +```sql + +ADD FILE '/tmp/dinky/resource/file.properties' +``` + +## 实战场景 + +> 在 Dinky v1.0.0 版本中,支持了`资源管理`,同时扩展了 rs 协议, 使得用户可以通过 rs 协议调用该 jar , 有关 `资源管理rs 协议`的使用请参考 [资源管理](../../user_guide/register_center/resource)。 + +> 如果使用 rs 协议访问, 请参考 [资源管理](../../user_guide/register_center/resource) 中的使用方式, 以下示例中,我们使用 rs 协议访问资源中心中的 jar 资源 + +eg: 假设: + +1. 在 `配置中心` -> `Resource 配置` 中使用 `LOCAL` 协议 ,并设置了 `上传根路径`为 /tmp/dinky/resource +2. 在资源中心 Root 根目录下上传了一个 app.jar 文件,则该文件真实路径为 /tmp/dinky/resource/file.properties +3. 其访问方式如下: + +```sql +ADD FILE 'rs:/file.properties' +``` + +:::tip 提示 + +1. 如果使用 rs 协议访问, 请注意路径,不要带上 Root 节点 +2. 推荐使用 rs 协议访问, 以便于在 Flink 中支持除 k8s 模式之外的所有模式提交。 +3. 此功能可以覆盖 ADD CUSTOMJAR 功能, 可自由选择使用 + +::: diff --git a/docs/versioned_docs/version-1.0/extend/expand_statements/add_jar_statement.md b/docs/versioned_docs/version-1.0/extend/expand_statements/add_jar_statement.md new file mode 100644 index 0000000000..fbfb14f994 --- /dev/null +++ b/docs/versioned_docs/version-1.0/extend/expand_statements/add_jar_statement.md @@ -0,0 +1,50 @@ +--- +sidebar_position: 4 +position: 4 +id: add_jar_statement +title: ADD CUSTOMJAR +--- + +:::info 背景 + +在某些场景下,用户需要将自定义 jar 添加到 classpath,以便于在 SQL 中使用自定义 jar 中的函数。但是 Flink 原生的 ADD JAR 语法 无法在所有 Flink 版本中通用, 因此我们在 Flink SQL 中添加了 ADD CUSTOMJAR 语法,用于将用户 jar 添加到 classpath。 + +以达到在 Dinky 支持的所有 Flink 版本都可使用, 且不影响原生 ADD JAR 语法的目的。同时支持除 k8s 模式之外的所有模式提交。 + + +::: + +> 语法: +```sql +ADD CUSTOMJAR '.jar' +``` + + +## 实战范围 +当连接器和第三方依赖过多时,经常容易导致 jar依赖冲突; + +add CUSTOMJAR 可以选择性的识别添加到服务器,做到环境隔离 + + +## 实战场景 + +> 在 Dinky v1.0.0 版本中,支持了`资源管理`,同时扩展了 rs 协议, 使得用户可以通过 rs 协议调用该 jar , 有关 `资源管理rs 协议`的使用请参考 [资源管理](../../user_guide/register_center/resource)。 + +> 如果使用 rs 协议访问, 请参考 [资源管理](../../user_guide/register_center/resource) 中的使用方式, 以下示例中,我们使用 rs 协议访问资源中心中的 jar 资源 + +eg: 假设: + +1. 在 `配置中心` -> `Resource 配置` 中使用 `LOCAL` 协议 ,并设置了 `上传根路径`为 /tmp/dinky/resource +2. 在资源中心 Root 根目录下上传了一个 app.jar 文件,则该文件真实路径为 /tmp/dinky/resource/app.jar +3. 其访问方式如下: + +```sql +ADD CUSTOMJAR 'rs:/app.jar' +``` + +:::tip 提示 + +1. 如果使用 rs 协议访问, 请注意路径,不要带上 Root 节点 +2. 推荐使用 rs 协议访问, 以便于在 Flink 中支持除 k8s 模式之外的所有模式提交。 + +::: diff --git a/docs/versioned_docs/version-1.0/extend/expand_statements/aggtable_statement.md b/docs/versioned_docs/version-1.0/extend/expand_statements/aggtable_statement.md new file mode 100644 index 0000000000..5d793a24e8 --- /dev/null +++ b/docs/versioned_docs/version-1.0/extend/expand_statements/aggtable_statement.md @@ -0,0 +1,66 @@ +--- +sidebar_position: 3 +position: 3 +id: agg_table_statement +title: AggTable +--- + +## 表值聚合 + +Dinky 对 Flink 的表值聚合功能的应用与增强。增强主要在于定义了 AGGTABLE 来通过 FlinkSql 进行表值聚合的实现。 + +### 语法结构 + +```sql +CREATE AGGTABLE agg_name AS +SELECT [columns1,columns2,columns3,.....] +FROM table_name +GROUP BY columns1,...... +AGG BY columns2,.....; +``` + +### 示例 + +```sql +jdbcconfig:='connector' = 'jdbc', + 'url' = 'jdbc:mysql://127.0.0.1:3306/data?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true', + 'username'='dlink', + 'password'='dlink',; +CREATE TABLE student ( + sid INT, + name STRING, + PRIMARY KEY (sid) NOT ENFORCED +) WITH ( + ${jdbcconfig} + 'table-name' = 'student' +); +CREATE TABLE score ( + cid INT, + sid INT, + cls STRING, + score INT, + PRIMARY KEY (cid) NOT ENFORCED +) WITH ( + ${jdbcconfig} + 'table-name' = 'score' +); +CREATE TABLE scoretop2 ( + cls STRING, + score INT, + `rank` INT, + PRIMARY KEY (cls,`rank`) NOT ENFORCED +) WITH ( + ${jdbcconfig} + 'table-name' = 'scoretop2' +); +CREATE AGGTABLE aggscore AS +SELECT cls,score,rank +FROM score +GROUP BY cls +AGG BY TOP2(score) as (score,rank); + +insert into scoretop2 +select +b.cls,b.score,b.`rank` +from aggscore b +``` diff --git a/docs/versioned_docs/version-1.0/extend/expand_statements/create_temporal_function.md b/docs/versioned_docs/version-1.0/extend/expand_statements/create_temporal_function.md new file mode 100644 index 0000000000..2baa3fb6e7 --- /dev/null +++ b/docs/versioned_docs/version-1.0/extend/expand_statements/create_temporal_function.md @@ -0,0 +1,34 @@ +--- +sidebar_position: 2 +position: 2 +id: create_temporal_function +title: CTF +--- + +:::info 介绍 + +CTF 意指: Create Temporal Function, 用于在 FlinkSQL 中定义临时函数. + +::: + +CREATE TEMPORAL FUNCTION 实现在sql中定义[Defining a Temporal Table Function](https://nightlies.apache.org/flink/flink-docs-release-1.17/docs/dev/table/concepts/temporal_table_function/#defining-a-temporal-table-function:~:text=pure%20SQL%20DDL.-,Defining%20a%20Temporal%20Table%20Function,-%23) 功能,语法结构如下: +```sql +CREATE TEMPORAL [TEMPORARY|TEMPORARY SYSTEM] FUNCTION + [IF NOT EXISTS] [catalog_name.][db_name.]function_name + AS SELECT update_time, target FROM tableName +``` +其中`update_time`列为版本时间属性列,`target` 是一个或多个键值列, `talbeName`表示版本表名。 +```sql +create temporal temporary function + IF NOT EXISTS rates + as select update_time, currency from currency_rates; + +``` +该语句等价table API示例: +```java + TemporalTableFunction rates = tEnv + .from("currency_rates") + .createTemporalTableFunction("update_time", "currency"); + + tEnv.createTemporarySystemFunction("rates", rates); +``` diff --git a/docs/versioned_docs/version-1.0/extend/expand_statements/execute_jar.md b/docs/versioned_docs/version-1.0/extend/expand_statements/execute_jar.md new file mode 100644 index 0000000000..08a60c3a7d --- /dev/null +++ b/docs/versioned_docs/version-1.0/extend/expand_statements/execute_jar.md @@ -0,0 +1,60 @@ +--- +sidebar_position: 6 +position: 6 +id: execute_jar +title: EXECUTE JAR +--- + +:::info 背景 + +该功能是为了解决在执行 JAR 类型任务时,去除各种繁杂交互, 以及统一任务提交方式, 使得用户可以更加方便的提交任务。 + +::: +:::warning 注意事项 + +如果使用 `Checkpoint` 或 `Savepoint` ,请在右边作业,选择 `Savepoint策略`,其次检查点 跳过 请使用 execution.savepoint.ignore-unclaimed-state: true 参数控制 + + +此flink sql jar任务支持 `set` 和 `add customjar` 联动使用 +::: + +## 语法结构 + +```sql + +EXECUTE JAR WITH ( +'uri'='.jar', -- 该参数 必填 +'main-class'='', -- 该参数 必填 +'args'='' -- 主类入参 该参数可选 +); + +``` + +## Jar包任务提交 Demo: + +```sql +EXECUTE JAR WITH ( +'uri'='rs:/jar/flink/demo/SocketWindowWordCount.jar', +'main-class'='org.apache.flink.streaming.examples.socket.SocketWindowWordCount', +'args'=' --hostname localhost ' +); +``` +:::warning 注意 + +1. 以上示例中, uri 的值为 rs:/jar/flink/demo/SocketWindowWordCount.jar, 该值为资源中心中的资源路径, + 请确保资源中心中存在该资源,请忽略资源中心 Root 节点(该节点为虚拟节点) +2. 如果要读取S3,HDFS,LOCAL等存储上面的文件均可通过rs协议进行桥接使用,请参考 [资源管理](../../user_guide/register_center/resource) 中 rs 协议使用方式 +::: + +## PyFlink 任务提交: + +```sql +EXECUTE JAR WITH ( +'uri'='rs:/test_flink.py', +'main-class'='org.apache.flink.client.python.PythonDriver', +'args'='' +); +``` +:::warning 注意 +1. 以上示例中, main-class 的值为 `org.apache.flink.client.python.PythonDriver`, 该值为 Python 的必填值和固定值 +::: diff --git a/docs/versioned_docs/version-1.0/extend/expand_statements/flinkcdc_pipeline.md b/docs/versioned_docs/version-1.0/extend/expand_statements/flinkcdc_pipeline.md new file mode 100644 index 0000000000..4e2b2fbc1d --- /dev/null +++ b/docs/versioned_docs/version-1.0/extend/expand_statements/flinkcdc_pipeline.md @@ -0,0 +1,57 @@ +--- +sidebar_position: 7 +position: 7 +id: flinkcdc_pipeline +title: EXECUTE PIPELINE +--- + +:::info 背景 + +该功能是为了在 Dinky 中直接提交 FlinkCDC 3.0 的 Pipeline 任务,并支持所有运行模式及 Dinky 的相关特性。 +可以理解为把 FlinkCDC Pipeline 任务转换为 Operations,并可延用 Dinky 的能力。 + +::: + +:::warning 注意事项 + +1. 需要添加 Flink CDC 3.0 Pipeline 相关依赖才可使用。 +2. 内容使用了 yaml 语句,强烈要求注意缩进。 +3. 如果使用 `Checkpoint` 或 `Savepoint` ,请在右边作业,选择 `Savepoint策略`,其次检查点 跳过 请使用 execution.savepoint.ignore-unclaimed-state: true 参数控制 + +::: + +## 语法结构 + +```sql +EXECUTE PIPELINE WITHYAML ( + +) +``` + +## Demo: + +```sql +EXECUTE PIPELINE WITHYAML ( +source: + type: mysql + hostname: localhost + port: 3306 + username: root + password: 123456 + tables: app_db.\.* + server-id: 5400-5404 + server-time-zone: UTC + +sink: + type: doris + fenodes: 127.0.0.1:8030 + username: root + password: "" + table.create.properties.light_schema_change: true + table.create.properties.replication_num: 1 + +pipeline: + name: Sync MySQL Database to Doris + parallelism: 2 +) +``` diff --git a/docs/versioned_docs/version-1.0/extend/expand_statements/print_table.md b/docs/versioned_docs/version-1.0/extend/expand_statements/print_table.md new file mode 100644 index 0000000000..2192071e0e --- /dev/null +++ b/docs/versioned_docs/version-1.0/extend/expand_statements/print_table.md @@ -0,0 +1,45 @@ +--- +sidebar_position: 5 +position: 5 +id: print_table +title: PRINT TABLE +--- + +:::info 背景 +在 Dinky 中, 我们可以通过 `PRINT TABLENAME`语句来查看表数据实时内容。 + +此功能可以实现在 Dinky->`表数据`标签页动态查看运行时各表数据实时内容, 以便于调试SQL语句或者查看中间表过程数据。 +::: + +## 语法结构 +PRINT TABLE 实现埋点功能, 语法结构如下: +```sql +PRINT tableName +``` + +### Demo + +```sql +CREATE TABLE Orders ( + order_number BIGINT, + price DECIMAL(32,2), + buyer STRING, + seller STRING, + order_time TIMESTAMP(3), + WATERMARK FOR order_time AS order_time - INTERVAL '5' SECOND +) WITH ( + 'connector' = 'kafka', + 'topic' = 'Orders', + 'properties.bootstrap.servers' = 'localhost:9092', + 'properties.group.id' = 'testGroup', + 'scan.startup.mode' = 'latest-offset', + 'format' = 'csv' +); + +print Orders; +``` +:::warning 注意 + +PRINT 的表可以是 source/view, 但不可以是 sink 表。 + +::: diff --git a/docs/versioned_docs/version-1.0/extend/expand_statements/variable_statement.md b/docs/versioned_docs/version-1.0/extend/expand_statements/variable_statement.md new file mode 100644 index 0000000000..94d5f13a46 --- /dev/null +++ b/docs/versioned_docs/version-1.0/extend/expand_statements/variable_statement.md @@ -0,0 +1,78 @@ +--- +sidebar_position: 1 +position: 1 +id: variable_statement +title: 全局变量 +--- + +:::info 背景 + +在 Dinky 中,我们可以通过全局变量的方式,将一些常用的配置信息,如:表名、表路径等,抽取出来,方便在 SQL 中复用。 + +此种方式,可以减少 SQL 的冗余,提高 SQL 的可读性。同时,也可以方便的进行统一的配置管理。 + +另: 全局变量支持多种方式, 具体详见 [全局变量](../../user_guide/register_center/global_var) 章节。 +::: + +## 定义变量 + +### 语法结构 + +```sql +key1 := value1; +``` + +### 示例 + +```sql +var1:=student; +select * from ${var1}; +``` + +## 查看变量 + +```sql +-- 查看所有变量 +SHOW FRAGMENTS; +-- 查看单个变量 +SHOW FRAGMENT var1; +``` + + + +## Flink 连接配置变量 + +### 语法结构 + +```sql +CREATE TABLE table_name ( + [columns1 type1,........] + PRIMARY KEY (pk) NOT ENFORCED +) WITH( + [key1 = value1,........,] + ${dorisdwd} +); +``` + + + +### 示例 + +```sql +CREATE TABLE DWD_INFO ( + `SID` STRING, + `MEMO` STRING, + PRIMARY KEY (SID) NOT ENFORCED +) WITH( + 'table.identifier' = 'dwd.DWD_INFO', + ${dorisdwd} +); +``` + +Flink 连接配置如何添加变量,详见用户手册注册中心的[创建数据源](../administrator_guide/register_center/datasource_manage#创建数据源) + +:::warning 注意事项 + +如果使用如上变量,需要在数据开发的执行配置中`开启`全局变量。 + +::: \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0/extend/function_expansion/_category_.json b/docs/versioned_docs/version-1.0/extend/function_expansion/_category_.json new file mode 100644 index 0000000000..b0f85c36c2 --- /dev/null +++ b/docs/versioned_docs/version-1.0/extend/function_expansion/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "function_extension", + "position": 2 +} diff --git a/docs/versioned_docs/version-1.0/extend/function_expansion/global_var_ext.md b/docs/versioned_docs/version-1.0/extend/function_expansion/global_var_ext.md new file mode 100644 index 0000000000..286914ad41 --- /dev/null +++ b/docs/versioned_docs/version-1.0/extend/function_expansion/global_var_ext.md @@ -0,0 +1,43 @@ +--- +sidebar_position: 9 +id: global_var_ext +title: 表达式变量扩展 +--- + +:::tip + +本扩展文档适用于 v1.0.1 以上版本,可以直接在已部署服务中直接扩展,无需重新编译部署 +::: + +## 介绍 + +> 本扩展用于扩展表达式中的变量,以满足更多场景需求 + + +## 扩展方法 + +1. 启动 Dinky 服务,如已启动则无需重启 +2. 登录 Dinky +3. 点击 `配置中心` -> `全局配置` -> `Dinky 环境配置` -> `表达式变量列表` +4. 点击右侧`修改按钮` +5. 在输入框内输入您需要扩展的类的全限定名,多个类之间用逗号分隔 +6. 点击 `保存` + +举例: + +> 假设需要扩展 [`Hash 算法`](https://doc.hutool.cn/pages/HashUtil/) 相关的表达式变量 + +只需要在 上述步骤中的 `5` 中追加类的全限定名即可,注意逗号分隔 +```text + +cn.hutool.core.util.HashUtil + +``` +如上示例,将会扩展表达式变量中的 `Hash 算法`,你就可以在表达式中使用 `Hash 算法` 相关的表达式了 + +:::tip 说明 +1. 请确保您的扩展类在 `dinky 中已被加载(类加载机制)` +2. 请确保您的扩展类中的方法为 `public static` 修饰 +3. 请确保您的扩展列表一定按照逗号分隔 + +::: \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0/faq.md b/docs/versioned_docs/version-1.0/faq.md new file mode 100644 index 0000000000..340dcc40fe --- /dev/null +++ b/docs/versioned_docs/version-1.0/faq.md @@ -0,0 +1,240 @@ +--- +sidebar_position: 997 +id: faq +title: FAQ +--- + +## 部署 FAQ + +**Q1:无法识别 hdfs 访问地址别名,提交任务报错:** +```shell +Caused by: java.io.IOException: Cannot instantiate file system for URI: hdfs://nameservice/flink/lib +... +Caused by: java.lang.IllegalArgumentException: java.net.UnknownHostException: nameservice +... +``` + +提供 3 种方式解决这个问题: +- 升级 Dinky 至 0.6.2 及后续版本。详见:[https://github.com/DataLinkDC/dinky/issues/310](https://github.com/DataLinkDC/dinky/issues/310) + +- 修改 `/etc/profile`,添加 HADOOP_HOME 环境变量 +```shell +HADOOP_HOME=/opt/hadoop +``` + +- 编辑启动脚本 `auto.sh`,增加以下代码: +``` shell +export HADOOP_HOME=/opt/hadoop +``` + + +**Q2:planner 找不到或冲突,报错:** +```shell +java.lang.NoClassDefFoundError: org/apache/flink/table/planner/... +``` +或 +```shell +org.apache.flink.table.api.TableException: Could not instantiate the executor. Make sure a planner module is on the classpath +``` + +1. flink-table-planner 和 flink-table-planner-loader 无法同时存在于 classpath,同时加载时会报错 + +2. 将 `/flink/opt` 目录下的 flink-table-planner.jar 拷贝至 `/dinky/plugins/flink` + +3. 删除 `/dinky/plugins/flink` 目录下 flink-table-planner-loader.jar + + +**Q3:servlet 或 gson 找不到或冲突,报错:** +```shell +java.lang.NoSuchMethodError:javax.servlet.... +``` +或 +```shell +java.lang.NoSuchMethodError:com.google.gson.... +``` + +1. 添加 flink-shade-hadoop-uber-3 包时,删除该包内部的 javax.servlet、com.google.gson 等冲突内容 + +2. 添加其他依赖时,同样排除 servlet、gson 等依赖项 + + +**Q4:添加 cdc、kafka 等 connector 依赖,报错找不到类:** +```shell +java.lang.ClassNotFoundException: org.apache.kafka.connect.... +``` + +1. 检查 `/flink/lib` 目录和 `/dinky/plugins` 目录下有相应 jar 包 + +2. 检查是否有 flink-sql-connector-kafka 和 flink-connector-kafka 这种胖瘦包放在一起,一般只放胖包不放瘦包 + +3. 检查其他客户端依赖,如 kafka-client 包 + + +**Q5:连接 Hive 异常,报错:** +```shell +Caused by: java.lang.ClassNotFoundException: org.apache.http.client.HttpClient +``` + +在 `/dinky/plugins` 下添加 httpclient-4.5.3.jar、httpcore-4.4.6.jar 依赖 + + +**Q6:与 CDH 集成并使用 HiveCatalog,报错:** +```shell +Cause by: java.lang.IllegalArgumentException: Unrecognized Hadoop major version number: 3.1.1.7.2.8.0-224 + at org.apache.hadoop.hive.shims.ShimLoader.getMajorVersion(Shimloader.java:177) ~[flink-sql-connector-hive-2.2.0...] +``` +1. 要从新编译对应 Flink 版本的源码,下载 Flink 对应版本源码,并切换到对应 hive 版本 flink-sql-connector 目录下 + +2. 修改 pom,添加如下信息 +```xml + + + + cloudera + https://repository.cloudera.com/artifactory/cloudera-repos/ + Cloudera Repositories + + true + + + false + + + + + + + org.apache.hive + hive-exec + 2.1.1-cdh6.3.2 + + + log4j + log4j + + + org.slf4j + slf4j-log4j12 + + + org.pentaho + pentaho-aggdesigner-algorithm + + + +``` + +3. 编译成功后,将对应的 jar 包拿出来即可,分别放到 `flink/lib` 和 `dinky/plugins` 下,重启 Flink 和 Dinky + + +## 开发 FAQ + +**Q1:提交作业后报错 ClassCastException 类加载问题:** +```shell +java.lang.ClassCastException: class org.dinky.model.Table cannot be cast to class org.dinky.model. + Table (org.dinky.model.Table is in unnamed module of loader 'app'; org.dinky.model. + Table is in unnamed module of loader org.apache.flink.util.ChildFirstClassLoader @66565121) +``` +或 +```shell +Caused by: java.lang.ClassCastException: cannot assign instance of org.apache.kafka.clients.consumer.OffsetResetStrategy to field + org.apache.flink.connector.kafka.source.enumerator.initializer.ReaderHandledOffsetsInitializer.offsetResetStrategy of type + org.apache.flink.kafka.shaded.org.apache.kafka.clients.consumer.OffsetResetStrategy in instance of + org.apache.flink.connector.kafka.source.enumerator.initializer.ReaderHandledOffsetsInitializer +``` +或 +```shell +Caused by: java.lang.ArrayStoreException + at java.lang.System.arraycopy(Native Method) ~[?:1.8.0_202] +``` + +1. 如果是普通作业或 stanlone 模式,在作业开发页面右下角自定义配置内加入此参数 classloader.resolve-order: parent-first + +2. 如果是 application 作业在集群配置中,加入自定义参数 classloader.resolve-order: parent-first 即可 + + +**Q2:提交 cdc 作业后,类型转换报错:** +```shell +java.lang.classCastException: java.lang.Integer cannot be cast to java.lang.Booleanat + org.apache.flink.table.data.GenericRowData.getBoolean(GenericRowData.java:134)at + org.apache.doris.flink.deserialization,converter.DorisRowConverter ,lambda$createExternalConverter$81fa9aea33 (DorisRowConverter.java:239) +at org.apache.doris.flink.deserialization.converter.DorisRowConverter. +``` +或 +```shell +org.apache.flink.streaming.runtime.tasks.ExceptionInChainedOperatorException: Could not forward element to next operator +... +Caused by: org.apache.flink.streaming.runtime.tasks.ExceptionInChainedOperatorException: Could not forward element to next operator +... +Caused by: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Boolean + +``` + +1. 在 mysql 中 tinyint 会被 cdc 识别为 boolean 类型,造成转换错误 + +2. 添加以下参数 +```shell +'jdbc.properties.tinyInt1isBit' = 'false', +'jdbc.properties.transformedBitIsBoolean' = 'false', +``` + +**Q3:修改 sql 后无法从 checkpoint 启动,报错:** +```shell +Cannot map checkpoint/savepoint state for operator xxx to the new program, because the operator is not available in the new program. + If you want to allow to skip this, you can set the --allowNonRestoredState option on the CLI. +``` + +添加参数 execution.savepoint.ignore-unclaimed-state:true,跳过无法还原的算子 + + +## 本地调试FAQ + + +Q1: 为什么不支持除了 Java8 和 Java11 以外的其他版本呢? + +> A1: 因为 Flink 目前仅支持 Java8 和 Java11。 + +--- + +Q2: 为什么 Maven Profile 切换了不生效呢?? 提交任务时还是报各种依赖问题,Profile 像是不生效呢????? + +> A2-1: 因为你没刷新 Maven Profile,导致不生效 + +> A2-2: 因为虽然你刷新了 Maven Profile, 没重启 Dinky 服务(不要问为什么需要重启,这是一个开发人员的基本认知),导致依赖没包含在当前已启动的服务中. + +> A2-3: Profile 切的不对,注意灰色的 Profile 选项.请仔细仔细仔细仔细的看看. + +> A2-4: 查看你的 IDEA 的版本,不要太旧,尽量保持在 2022.x 以上(别问为什么,上边已经说了) + +> A2-5: Profile 切换加载,基于依赖的 ``标签属性声明 ,如果不懂,自行百度/谷歌/CSDN/StackOverFlow/ChatGPT + +--- + +Q3: 我在 IDEA 中启动 Dinky 后, 前端页面访问不了, 报错找不到页面?????? + +> A3-1: 可以在执行 Install 阶段勾选 `web` Profile,不然 dinky-admin/src/main/resources/ 下没有静态资源文件目录 `static`. + +> A3-2: 可以单独启动前端,参考 [本地调试-启动前端](developer_guide/local_debug#启动前端) 部分 + +--- + +Q4: 为什么在 IDEA 中启动 Dinky 后,Profile 也加载了,我用到了一个 connector 仍然报错找不到类????? + +> A4-1: Dinky 只加载了 Dinky 在开发中过程中用到的相关 Flink 依赖以及 Flink 的基本环境依赖.如报此类错误,请检查你的 pom.xml 文件,是否包含了 connector 所依赖的 jar 包 + +> A4-2: 如上述问题未解决,请检查你的 `dinky-flink` 模块下的与你Flink 版本一致的 `pom.xml` 文件,是否包含了 connector 所依赖的 jar 包 + +## SQL开发FAQ +Q1:ADD JAR语法如何支持s3路径? +由于dinky代码检查阶段无相应flink-conf.yaml配置,导致无法获取正确ak,sk,所以在sql层面做了语法增强,支持在sql内进行s3配置,如下: +```sql +SET 's3.access-key'='xxx'; +SET 's3.secret-key'='xxx'; +SET 's3.endpoint'='xxx'; + +ADD JAR 's3://xxxx/udf.jar'; + +create temporary function ip2int as 'com.sopei.udf.Ip2Int'; + +select ip2int('192.168.1.1')as ip; +``` diff --git a/docs/versioned_docs/version-1.0/get_started/_category_.json b/docs/versioned_docs/version-1.0/get_started/_category_.json new file mode 100644 index 0000000000..7e9c3474af --- /dev/null +++ b/docs/versioned_docs/version-1.0/get_started/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "get_started", + "position": 1 +} diff --git a/docs/versioned_docs/version-1.0/get_started/overview.md b/docs/versioned_docs/version-1.0/get_started/overview.md new file mode 100644 index 0000000000..fc1e636ea2 --- /dev/null +++ b/docs/versioned_docs/version-1.0/get_started/overview.md @@ -0,0 +1,35 @@ +--- + +sidebar_position: 1 +id: overview +title: Dinky介绍 +--------- + +## 概述 + +实时即未来,Dinky 为 Apache Flink 而生,让 Flink SQL 纵享丝滑。 + +Dinky 是一个开箱即用、易扩展,以 Apache Flink 为基础,连接 OLAP 和数据湖等众多框架的一站式实时计算平台,致力于流批一体和湖仓一体的探索与实践。 +致力于简化Flink任务开发,提升Flink任务运维能力,降低Flink入门成本,提供一站式的Flink任务开发、运维、监控、报警、调度、数据管理等功能。 + +最后,Dinky 的发展皆归功于 Apache Flink 等其他优秀的开源项目的指导与成果。 + + +## 特性 + +- 沉浸式 FlinkSQL 数据开发:自动提示补全、语法高亮、语句美化、在线调试、语法校验、执行计划、Catalog支持、血缘分析等 +- Flink SQL语法增强,如 CDC任务,jar任务,实时打印表数据,实时数据预览,全局变量增强,语句合并、整库同步等 +- 适配 FlinkSQL 多种执行模式:Local、Standalone、Yarn/Kubernetes Session、Yarn Per-Job、Yarn/Kubernetes Application +- 增强 Flink 生态拓展:Connector、FlinkCDC、Table Store 等 +- 支持 FlinkCDC 整库实时入仓入湖、多库输出、自动建表、模式演变 +- 支持 Flink Java / Scala / Python UDF 开发与自动提交 +- 支持 SQL 作业开发:ClickHouse、Doris、Hive、Mysql、Oracle、Phoenix、PostgreSql、Presto、SqlServer、StarRocks 等 +- 支持实时在线调试预览 Table、 ChangeLog、统计图和 UDF +- 支持 Flink Catalog、Dinky内置Catalog增强,数据源元数据在线查询及管理 +- 支持自动托管的 SavePoint/CheckPoint 恢复及触发机制:最近一次、最早一次、指定一次等 +- 支持实时任务运维:作业信息、集群信息、作业快照、异常信息、历史版本、报警记录等 +- 支持作为多版本 FlinkSQL Server 以及 OpenApi 的能力 +- 支持实时作业报警及报警组:钉钉、微信企业号、飞书、邮箱等 +- 支持多种资源管理:集群实例、集群配置、数据源、报警组、报警实例、文档、系统配置等 +- 支持企业级管理功能:多租户、用户、角色、命名空间等 +- 更多隐藏功能等待小伙伴们探索 diff --git a/docs/versioned_docs/version-1.0/get_started/quick_experience.md b/docs/versioned_docs/version-1.0/get_started/quick_experience.md new file mode 100644 index 0000000000..9bc401cd93 --- /dev/null +++ b/docs/versioned_docs/version-1.0/get_started/quick_experience.md @@ -0,0 +1,130 @@ +--- +sidebar_position: 1 +id: quick_experience +title: 快速开始 +--- + +## 体验环境 + +:::danger 注意 +1. 体验环境仅供学习和体验,不保证稳定性和可用性。如你在访问时提示 `503 Service Unavailable`,请耐心等待, 体验环境会增加访问并发限制等策略。请理解!! +2. 体验环境每天会定时重置,除了一些默认数据外其他所有数据和配置会被清空。 +3. 体验环境服务不可用时间段为工作日每天的 23:00 - 次日的 09:00。周六日全时段服务不可用,如遇其他时间段服务不可用,请联系社区人员,我们会尽快处理。 +4. 体验环境不支持所有的功能,如需要体验完整功能,请自行搭建环境。 + 5请不要在体验环境中进行大规模并发测试,以免影响其他用户体验。 + ::: + +**访问地址:** [http://demo.dinky.org.cn:32451/#/](http://demo.dinky.org.cn:32451/#/) + +```shell +# 普通账户 +# 普通账户仅用于测试,不具备完整的权限。无法进行认证中心相关操作。 +用户名:demo +密码:dinky123456 +# 授权账户 +# 授权账户只有认证中心相关权限,无法进行其他操作。 +用户名:auth +密码:dinky123456 +``` + +## Docker 快速开始 + +:::danger 注意 + +Dinky v1.0.0 的 Docker 镜像正在开发中,敬请期待。以下步骤目前由于镜像未发布,无法使用。请耐心等待。如您对 Docker 镜像有兴趣,欢迎加入我们的开发群,一起参与开发。 + +::: + +如果您是第一次接触 Dinky,我们推荐您使用 Docker 快速体验 Dinky 的功能。 + +### 独立启动Dinky服务 + +Dinky 在 dockerhub 中的公共镜像地址为 `dinky/dinky`。如果你本地已经安装了 docker,执行以下命令可以一键安装: + +```sh +docker run -p 8888:8888 \ + --name dinky dinky/dinky:1.0.3-flink1.17 +``` + +:::tip 注意 +默认使用h2作为数据库,开箱即用,您不需要额外附加数据库。仅限于快速体验, +生产环境请使用MySQL或Postgres,更多参数配置请参考Docker部署章节获取详细内容, +::: + +Docker启动成功后,在浏览器里输入地址http://ip:8081,看到以下界面,说明Dinky启动成功。 +![login](http://pic.dinky.org.cn/dinky/docs/zh-CN//fast-guide-login.png) +> 初始账户: +> 用户名 dinky +> 密码 dinky123!@# + + +## 创建你的第一个Flink任务 +Dinky支持多种任务开发,本章节会指导你如何使用Local模式快速创建一个FlinkSQL任务。 +### 创建作业 + +登录Dinky后,进入数据开发页面,点击**目录**,右键新建作业,选择**FlinkSQL**作业类型,填写作业名称,点击**确定**。 + +右侧作业配置页面,执行模式选择**Local**模式,并行度选择**1**。 + +输入以下Flink语句: + +```sql +CREATE TABLE Orders ( + order_number BIGINT, + price DECIMAL(32,2), + buyer ROW, + order_time TIMESTAMP(3) +) WITH ( + 'connector' = 'datagen', + 'rows-per-second' = '1', + 'number-of-rows' = '50' +); +select order_number,price,first_name,last_name,order_time from Orders +``` + +![](http://pic.dinky.org.cn/dinky/docs/zh-CN//fast-guide-preview.png) + +### 预览查询结果 + +点击右上角 `预览按钮`,会启动local集群并执行任务,下方控制台会实时显示运行日志,提交成功后会切换到`结果选项卡`,点击 `获取最新数据` ,即可查看 Select 语句的执行结果。 + +![](http://pic.dinky.org.cn/dinky/docs/zh-CN//fast-guide-preview-result.png) +:::tip 说明 +预览功能只支持select语句查询结果(目前不支持Application与Prejob预览功能),如果您是正常的带有insert的FlinkSql作业,请点击`执行按钮` +::: + +### 任务提交 +预览功能仅适用于debug,方便开发时查看数据,对于线上作业,我们需要使用`执行按钮`提交任务到集群。 + +修改FlinkSql语句 +```sql +--创建源表datagen_source +CREATE TABLE datagen_source( + id BIGINT, + name STRING +) WITH ( + 'connector' = 'datagen' +); +--创建结果表blackhole_sink +CREATE TABLE blackhole_sink( + id BIGINT, + name STRING +) WITH ( + 'connector' = 'blackhole' +); +--将源表数据插入到结果表 +INSERT INTO blackhole_sink +SELECT + id , + name +from datagen_source; +``` +点击提交按钮,即可提交任务到集群 +### 作业运维 +任务提交成功后,我们可以进入运维中心页面。 +![](http://pic.dinky.org.cn/dinky/docs/zh-CN//fast-guide-devops.png) +找到我们的作业,点击**详情按钮**,即可查看作业的运行状态,日志,监控等信息。 +![](http://pic.dinky.org.cn/dinky/docs/zh-CN//fast-guide-job-detail.png) + +## 写在最后 +至此,您已经了解了基础DInky使用流程,但Dinky的能力远不止于此,您可以继续阅读其他文档,了解更多Dinky的功能,尽享Dinky为你带来的丝滑开发体验 \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0/openapi/CancelFlinkJob.md b/docs/versioned_docs/version-1.0/openapi/CancelFlinkJob.md new file mode 100644 index 0000000000..4430edf202 --- /dev/null +++ b/docs/versioned_docs/version-1.0/openapi/CancelFlinkJob.md @@ -0,0 +1,80 @@ +--- +sidebar_position: 2 +position: 2 +id: CancelFlinkJob +title: Cancel Flink Job +--- + +> URL: http://localhost:8888/openapi/cancel?id=1&withSavePoint=false&forceCancel=true +> +> Origin Url: http://localhost:8888/openapi/cancel +> +> Type: GET + +## Request headers + +| Header Name | Header Value | +|-------------|--------------| + +## Parameters + +### Path parameters + +| Parameter | Type | Value | Description | +|-----------|------|-------|-------------| + +### URL parameters + +| Required | Parameter | Type | Value | Description | +|----------|---------------|---------|-------|-------------| +| true | id | Number | 1 | | +| true | withSavePoint | Boolean | false | | +| true | forceCancel | Boolean | true | | + +### Body parameters + +##### JSON + +```json lines showLineNumbers + +``` + +##### JSON document + +```json lines showLineNumbers + +``` + +#### Form URL-Encoded + +| Required | Parameter | Type | Value | Description | +|----------|-----------|------|-------|-------------| + +#### Multipart + +| Required | Parameter | Type | Value | Description | +|----------|-----------|------|-------|-------------| + +## Response + +### Response example + +```json lines showLineNumbers + +``` + +### Response document + +```json lines showLineNumbers +{ + "msg": "Result Message", + "code": "Result Code", + "data": { + "java.lang.Boolean": "No comment,Type =Boolean" + }, + "success": "Result is Success", + "time": "Result Time" +} +``` + + diff --git a/docs/versioned_docs/version-1.0/openapi/ExplainSql.md b/docs/versioned_docs/version-1.0/openapi/ExplainSql.md new file mode 100644 index 0000000000..902f7b9e6e --- /dev/null +++ b/docs/versioned_docs/version-1.0/openapi/ExplainSql.md @@ -0,0 +1,177 @@ +--- +sidebar_position: 3 +position: 3 +id: ExplainSql +title: Explain Sql +--- + +> URL: http://localhost:8888/openapi/explainSql +> +> Origin Url: http://localhost:8888/openapi/explainSql +> +> Type: POST + +### Request headers + +| Header Name | Header Value | +|-------------|--------------| + +### Parameters + +##### Path parameters + +| Parameter | Type | Value | Description | +|-----------|------|-------|-------------| + +##### URL parameters + +| Required | Parameter | Type | Value | Description | +|----------|-----------|------|-------|-------------| + +##### Body parameters + +###### JSON + +```json lines showLineNumbers +{ + "id": 6, + "name": "Name", + "dialect": "dialect_kynq4", + "type": "Local", + "savePointStrategy": 1, + "savePointPath": "/savepoints", + "parallelism": 4, + "fragment": false, + "statementSet": "false", + "batchModel": "true", + "clusterId": 1, + "clusterConfigurationId": 2, + "databaseId": 3, + "alertGroupId": 7001, + "note": "note_og81s", + "step": 1, + "jobInstanceId": 8001, + "status": "RUNNING", + "versionId": 9001, + "enabled": true, + "statement": "SELECT * FROM table", + "clusterName": "clusterName_a2511", + "configJson": { + "udfConfig": { + "templateId": 1, + "selectKeys": [ + {} + ], + "className": "className_xk9o4" + }, + "customConfig": [ + { + "key": "test", + "value": "test" + } + ] + }, + "path": "path_gfm05", + "clusterConfigurationName": "clusterConfigurationName_zwazn", + "databaseName": "databaseName_qlxym", + "envName": "envName_8wwn8", + "alertGroupName": "alertGroupName_l8a8e", + "useResult": "true", + "useChangeLog": "false", + "useAutoCancel": "false", + "session": "session_id", + "jobName": "MyJob", + "maxRowNum": 100, + "envId": 1, + "variables": {} +} +``` + +###### JSON document + +```json lines showLineNumbers +{ + "note": "Note", + "configJson": { + "udfConfig": { + "selectKeys": [ + {} + ], + "className": "Class Name", + "templateId": "Template ID" + }, + "customConfig": [ + { + "value": "value", + "key": "key" + } + ] + }, + "alertGroupId": "Alert Group ID", + "dialect": "Dialect", + "jobInstanceId": "Job Instance ID", + "databaseName": "Database Name", + "session": "Session", + "parallelism": "Parallelism", + "clusterConfigurationId": "Cluster Configuration ID", + "batchModel": "Batch Model", + "clusterId": "ClusterInstance ID", + "type": "Run Mode", + "statementSet": "Use Statement Set", + "enabled": "Enabled", + "path": "Path", + "clusterName": "ClusterInstance Name", + "savePointPath": "Save Point Path", + "statement": "Statement", + "id": "ID", + "databaseId": "Database ID", + "savePointStrategy": "Save Point Strategy", + "jobName": "Job Name", + "alertGroupName": "Alert Group Name", + "useAutoCancel": "Use Auto Cancel", + "variables": {}, + "clusterConfigurationName": "Cluster Configuration Name", + "envId": "Environment ID", + "useResult": "UseResult", + "maxRowNum": "Max Row Number", + "fragment": "Fragment Flag", + "versionId": "Version ID", + "envName": "Environment Name", + "name": "Name", + "useChangeLog": "UseChangeLog", + "step": "Step", + "status": "Job status" +} +``` + +##### Form URL-Encoded + +| Required | Parameter | Type | Value | Description | +|----------|-----------|------|-------|-------------| + +##### Multipart + +| Required | Parameter | Type | Value | Description | +|----------|-----------|------|-------|-------------| + +### Response + +##### Response example + +```json lines showLineNumbers + +``` + +##### Response document + +```json lines showLineNumbers +{ + "msg":"Result Message", + "code":"Result Code", + "data":{}, + "success":"Result is Success", + "time":"Result Time" +} +``` + + diff --git a/docs/versioned_docs/version-1.0/openapi/ExportSql.md b/docs/versioned_docs/version-1.0/openapi/ExportSql.md new file mode 100644 index 0000000000..7fc1c69058 --- /dev/null +++ b/docs/versioned_docs/version-1.0/openapi/ExportSql.md @@ -0,0 +1,78 @@ +--- +sidebar_position: 4 +position: 4 +id: ExportSql +title: Export Sql +--- + +> URL: http://localhost:8888/openapi/exportSql?id=1 +> +> Origin Url: http://localhost:8888/openapi/exportSql +> +> Type: GET + +### Request headers + +| Header Name | Header Value | +|-------------|--------------| + +### Parameters + +##### Path parameters + +| Parameter | Type | Value | Description | +|-----------|------|-------|-------------| + +##### URL parameters + +| Required | Parameter | Type | Value | Description | +|----------|-----------|--------|-------|-------------| +| true | id | Number | 1 | Task Id | + +##### Body parameters + +###### JSON + +```json lines showLineNumbers + +``` + +###### JSON document + +```json lines showLineNumbers + +``` + +##### Form URL-Encoded + +| Required | Parameter | Type | Value | Description | +|----------|-----------|------|-------|-------------| + +##### Multipart + +| Required | Parameter | Type | Value | Description | +|----------|-----------|------|-------|-------------| + +### Response + +##### Response example + +```json lines showLineNumbers + +``` + +##### Response document + +```json lines showLineNumbers +{ + "msg": "Result Message", + "code": "Result Code", + "data": { + "java.lang.String": "No comment,Type =String" + }, + "success": "Result is Success", + "time": "Result Time" +} +``` + + diff --git a/docs/versioned_docs/version-1.0/openapi/GetJobInstance.md b/docs/versioned_docs/version-1.0/openapi/GetJobInstance.md new file mode 100644 index 0000000000..0e9f9d3fb6 --- /dev/null +++ b/docs/versioned_docs/version-1.0/openapi/GetJobInstance.md @@ -0,0 +1,96 @@ +--- +sidebar_position: 5 +position: 5 +id: GetJobInstance +title: Get Job Instance +--- + +> URL: http://localhost:8888/openapi/getJobInstance?id=1 +> +> Origin Url: http://localhost:8888/openapi/getJobInstance +> +> Type: GET + +### Request headers + +| Header Name | Header Value | +|-------------|--------------| + +### Parameters + +##### Path parameters + +| Parameter | Type | Value | Description | +|-----------|------|-------|-------------| + +##### URL parameters + +| Required | Parameter | Type | Value | Description | +|----------|-----------|--------|-------|-----------------| +| true | id | Number | 1 | Job Instance Id | + +##### Body parameters + +###### JSON + +```json lines showLineNumbers + +``` + +###### JSON document + +```json lines showLineNumbers + +``` + +##### Form URL-Encoded + +| Required | Parameter | Type | Value | Description | +|----------|-----------|------|-------|-------------| + +##### Multipart + +| Required | Parameter | Type | Value | Description | +|----------|-----------|------|-------|-------------| + +### Response + +##### Response example + +```json lines showLineNumbers + +``` + +##### Response document + +```json lines showLineNumbers +{ + "msg":"Result Message", + "code":"Result Code", + "data":{ + "finishTime":"Finish Time", + "creator":"Creator", + "jid":"JID", + "count":"Group by count", + "updateTime":"Update Time", + "clusterId":"ClusterInstance ID", + "error":"Error", + "operator":"Operator", + "updater":"updater", + "duration":"Duration", + "createTime":"Create Time", + "historyId":"History ID", + "tenantId":"Tenant ID", + "name":"Name", + "step":"Step", + "id":"ID", + "failedRestartCount":"Failed Restart Count", + "taskId":"Task ID", + "status":"Status" + }, + "success":"Result is Success", + "time":"Result Time" +} +``` + + diff --git a/docs/versioned_docs/version-1.0/openapi/GetJobInstanceByTaskId.md b/docs/versioned_docs/version-1.0/openapi/GetJobInstanceByTaskId.md new file mode 100644 index 0000000000..34a3ded2a6 --- /dev/null +++ b/docs/versioned_docs/version-1.0/openapi/GetJobInstanceByTaskId.md @@ -0,0 +1,96 @@ +--- +sidebar_position: 6 +position: 6 +id: GetJobInstanceByTaskId +title: Get Job Instance By Task Id +--- + +> URL: http://localhost:8888/openapi/getJobInstanceByTaskId?id=1 +> +> Origin Url: http://localhost:8888/openapi/getJobInstanceByTaskId +> +> Type: GET + +### Request headers + +| Header Name | Header Value | +|-------------|--------------| + +### Parameters + +##### Path parameters + +| Parameter | Type | Value | Description | +|-----------|------|-------|-------------| + +##### URL parameters + +| Required | Parameter | Type | Value | Description | +|----------|-----------|--------|-------|-------------| +| true | id | Number | 1 | Task Id | + +##### Body parameters + +###### JSON + +```json lines showLineNumbers + +``` + +###### JSON document + +```json lines showLineNumbers + +``` + +##### Form URL-Encoded + +| Required | Parameter | Type | Value | Description | +|----------|-----------|------|-------|-------------| + +##### Multipart + +| Required | Parameter | Type | Value | Description | +|----------|-----------|------|-------|-------------| + +### Response + +##### Response example + +```json lines showLineNumbers + +``` + +##### Response document + +```json lines showLineNumbers +{ + "msg":"Result Message", + "code":"Result Code", + "data":{ + "finishTime":"Finish Time", + "creator":"Creator", + "jid":"JID", + "count":"Group by count", + "updateTime":"Update Time", + "clusterId":"ClusterInstance ID", + "error":"Error", + "operator":"Operator", + "updater":"updater", + "duration":"Duration", + "createTime":"Create Time", + "historyId":"History ID", + "tenantId":"Tenant ID", + "name":"Name", + "step":"Step", + "id":"ID", + "failedRestartCount":"Failed Restart Count", + "taskId":"Task ID", + "status":"Status" + }, + "success":"Result is Success", + "time":"Result Time" +} +``` + + diff --git a/docs/versioned_docs/version-1.0/openapi/GetJobPlan.md b/docs/versioned_docs/version-1.0/openapi/GetJobPlan.md new file mode 100644 index 0000000000..6f41bfd829 --- /dev/null +++ b/docs/versioned_docs/version-1.0/openapi/GetJobPlan.md @@ -0,0 +1,202 @@ +--- +sidebar_position: 7 +position: 7 +id: GetJobPlan +title: Get Job Plan +--- + +> URL: http://localhost:8888/openapi/getJobPlan +> +> Origin Url: http://localhost:8888/openapi/getJobPlan +> +> Type: POST + +### Request headers + +| Header Name | Header Value | +|-------------|--------------| + +### Parameters + +##### Path parameters + +| Parameter | Type | Value | Description | +|-----------|------|-------|-------------| + +##### URL parameters + +| Required | Parameter | Type | Value | Description | +|----------|-----------|------|-------|-------------| + +##### Body parameters + +###### JSON + +```json lines showLineNumbers + +{ + "id": 6, + "name": "Name", + "dialect": "dialect_ujgla", + "type": "Local", + "savePointStrategy": 1, + "savePointPath": "/savepoints", + "parallelism": 4, + "fragment": false, + "statementSet": "false", + "batchModel": "true", + "clusterId": 1, + "clusterConfigurationId": 2, + "databaseId": 3, + "alertGroupId": 7001, + "note": "note_x9b2i", + "step": 1, + "jobInstanceId": 8001, + "status": "RUNNING", + "versionId": 9001, + "enabled": true, + "statement": "SELECT * FROM table", + "clusterName": "clusterName_spzq9", + "configJson": { + "udfConfig": { + "templateId": 1, + "selectKeys": [ + {} + ], + "className": "className_6pfjd" + }, + "customConfig": [ + { + "key": "test", + "value": "test" + } + ] + }, + "path": "path_4wg3s", + "clusterConfigurationName": "clusterConfigurationName_6oq9w", + "databaseName": "databaseName_dsgrr", + "envName": "envName_v1ukq", + "alertGroupName": "alertGroupName_hln14", + "useResult": "true", + "useChangeLog": "false", + "useAutoCancel": "false", + "session": "session_id", + "jobName": "MyJob", + "maxRowNum": 100, + "envId": 1, + "variables": {} +} +``` + +###### JSON document + +```json lines showLineNumbers +{ + "note": "Note", + "configJson": { + "udfConfig": { + "selectKeys": [ + {} + ], + "className": "Class Name", + "templateId": "Template ID" + }, + "customConfig": [ + { + "value": "value", + "key": "key" + } + ] + }, + "alertGroupId": "Alert Group ID", + "dialect": "Dialect", + "jobInstanceId": "Job Instance ID", + "databaseName": "Database Name", + "session": "Session", + "parallelism": "Parallelism", + "clusterConfigurationId": "Cluster Configuration ID", + "batchModel": "Batch Model", + "clusterId": "ClusterInstance ID", + "type": "Run Mode", + "statementSet": "Use Statement Set", + "enabled": "Enabled", + "path": "Path", + "clusterName": "ClusterInstance Name", + "savePointPath": "Save Point Path", + "statement": "Statement", + "id": "ID", + "databaseId": "Database ID", + "savePointStrategy": "Save Point Strategy", + "jobName": "Job Name", + "alertGroupName": "Alert Group Name", + "useAutoCancel": "Use Auto Cancel", + "variables": {}, + "clusterConfigurationName": "Cluster Configuration Name", + "envId": "Environment ID", + "useResult": "UseResult", + "maxRowNum": "Max Row Number", + "fragment": "Fragment Flag", + "versionId": "Version ID", + "envName": "Environment Name", + "name": "Name", + "useChangeLog": "UseChangeLog", + "step": "Step", + "status": "Job status" +} +``` + +##### Form URL-Encoded + +| Required | Parameter | Type | Value | Description | +|----------|-----------|------|-------|-------------| + +##### Multipart + +| Required | Parameter | Type | Value | Description | +|----------|-----------|------|-------|-------------| + +### Response + +##### Response example + +```json lines showLineNumbers + +``` + +##### Response document + +```json lines showLineNumbers +{ + "msg": "Result Message", + "code": "Result Code", + "data": { + "_children": {}, + "_nodeFactory": { + "_cfgBigDecimalExact": "No comment,Type =Boolean" + } + }, + "success": "Result is Success", + "time": "Result Time" +} +``` + +### Demo + +```json lines showLineNumbers + http://127.0.0.1:8888/openapi/getJobPlan +{ +/* required-start */ +"statement": "CREATE TABLE Orders (\r\n order_number INT,\r\n price DECIMAL(32,2),\r\n order_time TIMESTAMP(3)\r\n) WITH (\r\n 'connector' = 'datagen',\r\n 'rows-per-second' = '1',\r\n 'fields.order_number.kind' = 'sequence',\r\n 'fields.order_number.start' = '1',\r\n 'fields.order_number.end' = '1000'\r\n);\r\nCREATE TABLE pt (\r\nordertotal INT,\r\nnumtotal INT\r\n) WITH (\r\n 'connector' = 'print'\r\n);\r\ninsert into pt select 1 as ordertotal ,sum(order_number)*2 as numtotal from Orders", +/* required-end */ +/* default-start */ +"useStatementSet": false, +"fragment": false, +"parallelism": 1, +/* default-start */ +/* custom-start */ +"configuration": { +"table.exec.resource.default-parallelism": 2 +} +/* custom-end */ +} +``` \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0/openapi/GetStreamGraph.md b/docs/versioned_docs/version-1.0/openapi/GetStreamGraph.md new file mode 100644 index 0000000000..055e95cf63 --- /dev/null +++ b/docs/versioned_docs/version-1.0/openapi/GetStreamGraph.md @@ -0,0 +1,201 @@ +--- +sidebar_position: 8 +position: 8 +id: GetStreamGraph +title: Get Stream Graph +--- + +> URL: http://localhost:8888/openapi/getStreamGraph +> +> Origin Url: http://localhost:8888/openapi/getStreamGraph +> +> Type: POST + +### Request headers + +| Header Name | Header Value | +|-------------|--------------| + +### Parameters + +##### Path parameters + +| Parameter | Type | Value | Description | +|-----------|------|-------|-------------| + +##### URL parameters + +| Required | Parameter | Type | Value | Description | +|----------|-----------|------|-------|-------------| + +##### Body parameters + +###### JSON + +```json lines showLineNumbers +{ + "id": 6, + "name": "Name", + "dialect": "dialect_lsq59", + "type": "Local", + "savePointStrategy": 1, + "savePointPath": "/savepoints", + "parallelism": 4, + "fragment": false, + "statementSet": "false", + "batchModel": "true", + "clusterId": 1, + "clusterConfigurationId": 2, + "databaseId": 3, + "alertGroupId": 7001, + "note": "note_1yqdr", + "step": 1, + "jobInstanceId": 8001, + "status": "RUNNING", + "versionId": 9001, + "enabled": true, + "statement": "SELECT * FROM table", + "clusterName": "clusterName_g02m1", + "configJson": { + "udfConfig": { + "templateId": 1, + "selectKeys": [ + {} + ], + "className": "className_wh0cp" + }, + "customConfig": [ + { + "key": "test", + "value": "test" + } + ] + }, + "path": "path_f1cu8", + "clusterConfigurationName": "clusterConfigurationName_drlr1", + "databaseName": "databaseName_cnt5m", + "envName": "envName_u51ma", + "alertGroupName": "alertGroupName_ezvtk", + "useResult": "true", + "useChangeLog": "false", + "useAutoCancel": "false", + "session": "session_id", + "jobName": "MyJob", + "maxRowNum": 100, + "envId": 1, + "variables": {} +} +``` + +###### JSON document + +```json lines showLineNumbers +{ + "note":"Note", + "configJson":{ + "udfConfig":{ + "selectKeys":[ + {} + ], + "className":"Class Name", + "templateId":"Template ID" + }, + "customConfig":[ + { + "value":"value", + "key":"key" + } + ] + }, + "alertGroupId":"Alert Group ID", + "dialect":"Dialect", + "jobInstanceId":"Job Instance ID", + "databaseName":"Database Name", + "session":"Session", + "parallelism":"Parallelism", + "clusterConfigurationId":"Cluster Configuration ID", + "batchModel":"Batch Model", + "clusterId":"ClusterInstance ID", + "type":"Run Mode", + "statementSet":"Use Statement Set", + "enabled":"Enabled", + "path":"Path", + "clusterName":"ClusterInstance Name", + "savePointPath":"Save Point Path", + "statement":"Statement", + "id":"ID", + "databaseId":"Database ID", + "savePointStrategy":"Save Point Strategy", + "jobName":"Job Name", + "alertGroupName":"Alert Group Name", + "useAutoCancel":"Use Auto Cancel", + "variables":{}, + "clusterConfigurationName":"Cluster Configuration Name", + "envId":"Environment ID", + "useResult":"UseResult", + "maxRowNum":"Max Row Number", + "fragment":"Fragment Flag", + "versionId":"Version ID", + "envName":"Environment Name", + "name":"Name", + "useChangeLog":"UseChangeLog", + "step":"Step", + "status":"Job status" +} +``` + +##### Form URL-Encoded + +| Required | Parameter | Type | Value | Description | +|----------|-----------|------|-------|-------------| + +##### Multipart + +| Required | Parameter | Type | Value | Description | +|----------|-----------|------|-------|-------------| + +### Response + +##### Response example + +```json lines showLineNumbers + +``` + +##### Response document + +```json lines showLineNumbers +{ + "msg":"Result Message", + "code":"Result Code", + "data":{ + "_children":{}, + "_nodeFactory":{ + "_cfgBigDecimalExact":"No comment,Type =Boolean" + } + }, + "success":"Result is Success", + "time":"Result Time" +} +``` + +### Demo + +```json lines showLineNumbers + http://127.0.0.1:8888/openapi/getStreamGraph +{ + /* required-start */ + "statement":"CREATE TABLE Orders (\r\n order_number INT,\r\n price DECIMAL(32,2),\r\n order_time TIMESTAMP(3)\r\n) WITH (\r\n 'connector' = 'datagen',\r\n 'rows-per-second' = '1',\r\n 'fields.order_number.kind' = 'sequence',\r\n 'fields.order_number.start' = '1',\r\n 'fields.order_number.end' = '1000'\r\n);\r\nCREATE TABLE pt (\r\nordertotal INT,\r\nnumtotal INT\r\n) WITH (\r\n 'connector' = 'print'\r\n);\r\ninsert into pt select 1 as ordertotal ,sum(order_number)*2 as numtotal from Orders", + /* required-end */ + /* default-start */ + "useStatementSet":false, + "fragment":false, + "parallelism":1, + /* default-start */ + /* custom-start */ + "configuration":{ + "table.exec.resource.default-parallelism":2 + } + /* custom-end */ +} +``` diff --git a/docs/versioned_docs/version-1.0/openapi/GetTaskLineage.md b/docs/versioned_docs/version-1.0/openapi/GetTaskLineage.md new file mode 100644 index 0000000000..31c87fe5fb --- /dev/null +++ b/docs/versioned_docs/version-1.0/openapi/GetTaskLineage.md @@ -0,0 +1,76 @@ +--- +sidebar_position: 9 +position: 9 +id: GetTaskLineage +title: Get Task Lineage +--- + +> URL: http://localhost:8888/openapi/getTaskLineage?id=1 +> +> Origin Url: http://localhost:8888/openapi/getTaskLineage +> +> Type: GET + +### Request headers + +| Header Name | Header Value | +|-------------|--------------| + +### Parameters + +##### Path parameters + +| Parameter | Type | Value | Description | +|-----------|------|-------|-------------| + +##### URL parameters + +| Required | Parameter | Type | Value | Description | +|----------|-----------|--------|-------|-------------| +| true | id | Number | 1 | Task Id | + +##### Body parameters + +###### JSON + +```json lines showLineNumbers + +``` + +###### JSON document + +```json lines showLineNumbers + +``` + +##### Form URL-Encoded + +| Required | Parameter | Type | Value | Description | +|----------|-----------|------|-------|-------------| + +##### Multipart + +| Required | Parameter | Type | Value | Description | +|----------|-----------|------|-------|-------------| + +### Response + +##### Response example + +```json lines showLineNumbers + +``` + +##### Response document + +```json lines showLineNumbers +{ + "msg":"Result Message", + "code":"Result Code", + "data":{}, + "success":"Result is Success", + "time":"Result Time" +} +``` + + diff --git a/docs/versioned_docs/version-1.0/openapi/RestartTask.md b/docs/versioned_docs/version-1.0/openapi/RestartTask.md new file mode 100644 index 0000000000..77f07cb91d --- /dev/null +++ b/docs/versioned_docs/version-1.0/openapi/RestartTask.md @@ -0,0 +1,190 @@ +--- +sidebar_position: 10 +position: 10 +id: RestartTask +title: Restart Task +--- + +> URL: http://localhost:8888/openapi/restartTask?id=1&savePointPath=savePointPath_z5b86 +> +> Origin Url: http://localhost:8888/openapi/restartTask +> +> Type: GET + +### Request headers + +| Header Name | Header Value | +|-------------|--------------| + +### Parameters + +##### Path parameters + +| Parameter | Type | Value | Description | +|-----------|------|-------|-------------| + +##### URL parameters + +| Required | Parameter | Type | Value | Description | +|----------|---------------|--------|---------------------|-------------| +| true | id | Number | 1 | | +| true | savePointPath | String | savePointPath_z5b86 | | + +##### Body parameters + +###### JSON + +```json lines showLineNumbers + +``` + +###### JSON document + +```json lines showLineNumbers + +``` + +##### Form URL-Encoded + +| Required | Parameter | Type | Value | Description | +|----------|-----------|------|-------|-------------| + +##### Multipart + +| Required | Parameter | Type | Value | Description | +|----------|-----------|------|-------|-------------| + +### Response + +##### Response example + +```json lines showLineNumbers + +``` + +##### Response document + +```json lines showLineNumbers +{ + "msg": "Result Message", + "code": "Result Code", + "data": { + "jobConfig": { + "checkpoint": "Check Point", + "jobName": "Name of the job", + "configJson": {}, + "useAutoCancel": "Flag indicating whether to use auto-cancel", + "variables": {}, + "address": "Job manager address", + "parallelism": "Parallelism level", + "clusterConfigurationId": "Cluster configuration ID", + "batchModel": "Flag indicating whether to use batch model", + "clusterId": "Cluster ID", + "type": "Flink run mode", + "statementSet": "Flag indicating whether to use statement set", + "pyFiles": [ + "List of Python files" + ], + "useResult": "Flag indicating whether to use the result", + "jarFiles": [ + "List of JAR files" + ], + "maxRowNum": "Maximum number of rows", + "fragment": "Flag indicating whether to use SQL fragment", + "savePointPath": "Save Point Path", + "useChangeLog": "Flag indicating whether to use change log", + "step": "Task JobLifeCycle", + "savePointStrategy": "Save point strategy", + "useRemote": "Flag indicating whether to use remote execution", + "taskId": "Task ID", + "gatewayConfig": { + "appConfig": { + "userJarParas": [ + "User JAR file parameters" + ], + "userJarMainAppClass": "Main application class in the JAR file", + "userJarPath": "Path to user JAR file" + }, + "kubernetesConfig": { + "dockerConfig": {}, + "tmPodTemplate": "TaskManager pod template for Flink jobs", + "configuration": {}, + "jmPodTemplate": "JobManager pod template for Flink jobs", + "podTemplate": "Pod template for Flink jobs", + "kubeConfig": "KubeConfig" + }, + "jarPaths": [ + "Paths to the JAR files" + ], + "clusterConfig": { + "hadoopConfigPath": "Path to YARN configuration file", + "flinkConfigPath": "Path to Flink configuration file", + "flinkLibPath": "Path to Flink library directory", + "appId": "YARN application ID", + "hadoopConfigMap": {}, + "hadoopConfigList": [ + { + "name": "Custom Config Name", + "value": "Custom Config Value" + } + ] + }, + "type": "Type of gateway (e.g., YARN, Kubernetes)", + "taskId": "ID of the task associated with the job", + "flinkConfig": { + "jobName": "Name of the Flink job", + "jobId": "ID of the Flink job", + "flinkConfigList": [ + { + "name": "Custom Config Name", + "value": "Custom Config Value" + } + ], + "configuration": {}, + "savePoint": "Path to savepoint", + "action": "Action to perform (e.g., START, STOP)", + "flinkVersion": "Flink version", + "savePointType": "Type of savepoint (e.g., TRIGGER, CANCEL)" + } + } + }, + "jobInstanceId": "Unique identifier for the job instance", + "jobManagerAddress": "Address of the job manager", + "error": "Error message in case of job failure", + "result": {}, + "jobId": "Unique identifier for the job", + "success": "Flag indicating whether the job was successful", + "statement": "SQL statement executed by the job", + "startTime": "Start time of job execution", + "id": "Unique identifier for the job result", + "endTime": "End time of job execution", + "results": [ + { + "total": "No comment,Type =Number", + "columns": [ + "columns_c7yv2" + ], + "success": "No comment,Type =Boolean", + "limit": "No comment,Type =Number", + "rowData": [ + { + "loadFactor": 1.0, + "threshold": 1, + "accessOrder": true + } + ], + "startTime": "No comment,Type =String", + "page": "No comment,Type =Number", + "endTime": "No comment,Type =String", + "time": "No comment,Type =Number", + "error": "No comment,Type =String" + } + ], + "status": "Status of the job" + }, + "success": "Result is Success", + "time": "Result Time" +} +``` + + diff --git a/docs/versioned_docs/version-1.0/openapi/SavepointTrigger.md b/docs/versioned_docs/version-1.0/openapi/SavepointTrigger.md new file mode 100644 index 0000000000..3898612eee --- /dev/null +++ b/docs/versioned_docs/version-1.0/openapi/SavepointTrigger.md @@ -0,0 +1,113 @@ +--- +sidebar_position: 11 +position: 11 +id: SavepointTrigger +title: Savepoint Trigger +--- + +> URL: http://localhost:8888/openapi/savepoint +> +> Origin Url: http://localhost:8888/openapi/savepoint +> +> Type: POST + +### Request headers + +| Header Name | Header Value | +|-------------|--------------| + +### Parameters + +##### Path parameters + +| Parameter | Type | Value | Description | +|-----------|------|-------|-------------| + +##### URL parameters + +| Required | Parameter | Type | Value | Description | +|----------|-----------|------|-------|-------------| + +##### Body parameters + +###### JSON + +```json lines showLineNumbers + +``` + +###### JSON document + +```json lines showLineNumbers + +``` + +##### Form URL-Encoded + +| Required | Parameter | Type | Value | Description | +|----------|---------------|--------|---------------------|-------------| +| true | taskId | Number | 1 | | +| true | savePointType | String | savePointType_28p0g | | + +##### Multipart + +| Required | Parameter | Type | Value | Description | +|----------|-----------|------|-------|-------------| + +### Response + +##### Response example + +```json lines showLineNumbers + +``` + +##### Response document + +```json lines showLineNumbers +{ + "msg":"Result Message", + "code":"Result Code", + "data":{ + "exceptionMsg":"No comment,Type =String", + "appId":"Application ID", + "startTime":"No comment,Type =String", + "jobInfos":[ + { + "jobId":"Job ID", + "savePoint":"Save Point", + "status":"Job Status" + } + ], + "endTime":"No comment,Type =String", + "type":"No comment,Type =String", + "isSuccess":"No comment,Type =Boolean" + }, + "success":"Result is Success", + "time":"Result Time" +} +``` + +### Demo + +```json lines showLineNumbers + http://127.0.0.1:8888/openapi/savepoint +{ +/* required-start */ +"jobId": "195352b0a4518e16699983a13205f059", +"savePointType": "trigger", // trigger | stop | cancel +/* required-end */ +/* custom-start */ +"savePoint": "195352b0a4518e16699983a13205f059", +"address": "127.0.0.1:8081", +"gatewayConfig": { +"clusterConfig": { +"appId": "application_1637739262398_0032", +"flinkConfigPath": "/opt/src/flink-1.13.3_conf/conf", +"flinkLibPath": "hdfs:///flink13/lib/flinklib", +"yarnConfigPath": "/usr/local/hadoop/hadoop-2.7.7/etc/hadoop" +} +} +/* custom-start */ +} +``` \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0/openapi/SubmitTaskById.md b/docs/versioned_docs/version-1.0/openapi/SubmitTaskById.md new file mode 100644 index 0000000000..16ff9bad0c --- /dev/null +++ b/docs/versioned_docs/version-1.0/openapi/SubmitTaskById.md @@ -0,0 +1,194 @@ +--- +sidebar_position: 13 +position: 13 +id: SubmitTaskId +title: Submit Task By ID +--- + +> URL: http://localhost:8888/openapi/submitTask?id=1 +> +> Origin Url: http://localhost:8888/openapi/submitTask +> +> Type: GET + +### Request headers + +| Header Name | Header Value | +|-------------|--------------| + +### Parameters + +##### Path parameters + +| Parameter | Type | Value | Description | +|-----------|------|-------|-------------| + +##### URL parameters + +| Required | Parameter | Type | Value | Description | +|----------|-----------|--------|-------|-------------| +| true | id | Number | 1 | | + +##### Body parameters + +###### JSON + +```json lines showLineNumbers + +``` + +###### JSON document + +```json lines showLineNumbers + +``` + +##### Form URL-Encoded + +| Required | Parameter | Type | Value | Description | +|----------|-----------|------|-------|-------------| + +##### Multipart + +| Required | Parameter | Type | Value | Description | +|----------|-----------|------|-------|-------------| + +### Response + +##### Response example + +```json lines showLineNumbers + +``` + +##### Response document + +```json lines showLineNumbers + +{ + "msg":"Result Message", + "code":"Result Code", + "data":{ + "jobConfig":{ + "checkpoint":"Check Point", + "jobName":"Name of the job", + "configJson":{}, + "useAutoCancel":"Flag indicating whether to use auto-cancel", + "variables":{}, + "address":"Job manager address", + "parallelism":"Parallelism level", + "clusterConfigurationId":"Cluster configuration ID", + "batchModel":"Flag indicating whether to use batch model", + "clusterId":"Cluster ID", + "type":"Flink run mode", + "statementSet":"Flag indicating whether to use statement set", + "pyFiles":[ + "List of Python files" + ], + "useResult":"Flag indicating whether to use the result", + "jarFiles":[ + "List of JAR files" + ], + "maxRowNum":"Maximum number of rows", + "fragment":"Flag indicating whether to use SQL fragment", + "savePointPath":"Save Point Path", + "useChangeLog":"Flag indicating whether to use change log", + "step":"Task JobLifeCycle", + "savePointStrategy":"Save point strategy", + "useRemote":"Flag indicating whether to use remote execution", + "taskId":"Task ID", + "gatewayConfig":{ + "appConfig":{ + "userJarParas":[ + "User JAR file parameters" + ], + "userJarMainAppClass":"Main application class in the JAR file", + "userJarPath":"Path to user JAR file" + }, + "kubernetesConfig":{ + "dockerConfig":{}, + "tmPodTemplate":"TaskManager pod template for Flink jobs", + "configuration":{}, + "jmPodTemplate":"JobManager pod template for Flink jobs", + "podTemplate":"Pod template for Flink jobs", + "kubeConfig":"KubeConfig" + }, + "jarPaths":[ + "Paths to the JAR files" + ], + "clusterConfig":{ + "hadoopConfigPath":"Path to YARN configuration file", + "flinkConfigPath":"Path to Flink configuration file", + "flinkLibPath":"Path to Flink library directory", + "appId":"YARN application ID", + "hadoopConfigMap":{}, + "hadoopConfigList":[ + { + "name":"Custom Config Name", + "value":"Custom Config Value" + } + ] + }, + "type":"Type of gateway (e.g., YARN, Kubernetes)", + "taskId":"ID of the task associated with the job", + "flinkConfig":{ + "jobName":"Name of the Flink job", + "jobId":"ID of the Flink job", + "flinkConfigList":[ + { + "name":"Custom Config Name", + "value":"Custom Config Value" + } + ], + "configuration":{}, + "savePoint":"Path to savepoint", + "action":"Action to perform (e.g., START, STOP)", + "flinkVersion":"Flink version", + "savePointType":"Type of savepoint (e.g., TRIGGER, CANCEL)" + } + } + }, + "jobInstanceId":"Unique identifier for the job instance", + "jobManagerAddress":"Address of the job manager", + "error":"Error message in case of job failure", + "result":{}, + "jobId":"Unique identifier for the job", + "success":"Flag indicating whether the job was successful", + "statement":"SQL statement executed by the job", + "startTime":"Start time of job execution", + "id":"Unique identifier for the job result", + "endTime":"End time of job execution", + "results":[ + { + "total":"No comment,Type =Number", + "columns":[ + "columns_8rb9m" + ], + "success":"No comment,Type =Boolean", + "limit":"No comment,Type =Number", + "rowData":[ + { + "loadFactor":1.0, + "threshold":1, + "accessOrder":true + } + ], + "startTime":"No comment,Type =String", + "page":"No comment,Type =Number", + "endTime":"No comment,Type =String", + "time":"No comment,Type =Number", + "error":"No comment,Type =String" + } + ], + "status":"Status of the job" + }, + "success":"Result is Success", + "time":"Result Time" +} +``` + +### Demo + +``` +http://127.0.0.1:8888/openapi/submitTask?id=1 +``` \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0/openapi/SubmitTaskJob.md b/docs/versioned_docs/version-1.0/openapi/SubmitTaskJob.md new file mode 100644 index 0000000000..84228e5ef3 --- /dev/null +++ b/docs/versioned_docs/version-1.0/openapi/SubmitTaskJob.md @@ -0,0 +1,196 @@ +--- +sidebar_position: 12 +position: 12 +id: SubmitTaskJob +title: Submit TaskJob +--- + +> URL: http://localhost:8888/openapi/submitTask +> +> Origin Url: http://localhost:8888/openapi/submitTask +> +> Type: POST + +### Request headers + +| Header Name | Header Value | +|-------------|--------------| + +### Parameters + +##### Path parameters + +| Parameter | Type | Value | Description | +|-----------|------|-------|-------------| + +##### URL parameters + +| Required | Parameter | Type | Value | Description | +|----------|-----------|------|-------|-------------| + +##### Body parameters + +###### JSON + +```json lines showLineNumbers +{ + "id": 6, + "savePointPath": "/savepoints", + "variables": {} +} +``` + +###### JSON document + +```json lines showLineNumbers +{ + "variables":{}, + "savePointPath":"Save Point Path", + "id":"ID" +} +``` + +##### Form URL-Encoded + +| Required | Parameter | Type | Value | Description | +|----------|-----------|------|-------|-------------| + +##### Multipart + +| Required | Parameter | Type | Value | Description | +|----------|-----------|------|-------|-------------| + +### Response + +##### Response example + +```json lines showLineNumbers + +``` + +##### Response document + +```json lines showLineNumbers +{ + "msg":"Result Message", + "code":"Result Code", + "data":{ + "jobConfig":{ + "checkpoint":"Check Point", + "jobName":"Name of the job", + "configJson":{}, + "useAutoCancel":"Flag indicating whether to use auto-cancel", + "variables":{}, + "address":"Job manager address", + "parallelism":"Parallelism level", + "clusterConfigurationId":"Cluster configuration ID", + "batchModel":"Flag indicating whether to use batch model", + "clusterId":"Cluster ID", + "type":"Flink run mode", + "statementSet":"Flag indicating whether to use statement set", + "pyFiles":[ + "List of Python files" + ], + "useResult":"Flag indicating whether to use the result", + "jarFiles":[ + "List of JAR files" + ], + "maxRowNum":"Maximum number of rows", + "fragment":"Flag indicating whether to use SQL fragment", + "savePointPath":"Save Point Path", + "useChangeLog":"Flag indicating whether to use change log", + "step":"Task JobLifeCycle", + "savePointStrategy":"Save point strategy", + "useRemote":"Flag indicating whether to use remote execution", + "taskId":"Task ID", + "gatewayConfig":{ + "appConfig":{ + "userJarParas":[ + "User JAR file parameters" + ], + "userJarMainAppClass":"Main application class in the JAR file", + "userJarPath":"Path to user JAR file" + }, + "kubernetesConfig":{ + "dockerConfig":{}, + "tmPodTemplate":"TaskManager pod template for Flink jobs", + "configuration":{}, + "jmPodTemplate":"JobManager pod template for Flink jobs", + "podTemplate":"Pod template for Flink jobs", + "kubeConfig":"KubeConfig" + }, + "jarPaths":[ + "Paths to the JAR files" + ], + "clusterConfig":{ + "hadoopConfigPath":"Path to YARN configuration file", + "flinkConfigPath":"Path to Flink configuration file", + "flinkLibPath":"Path to Flink library directory", + "appId":"YARN application ID", + "hadoopConfigMap":{}, + "hadoopConfigList":[ + { + "name":"Custom Config Name", + "value":"Custom Config Value" + } + ] + }, + "type":"Type of gateway (e.g., YARN, Kubernetes)", + "taskId":"ID of the task associated with the job", + "flinkConfig":{ + "jobName":"Name of the Flink job", + "jobId":"ID of the Flink job", + "flinkConfigList":[ + { + "name":"Custom Config Name", + "value":"Custom Config Value" + } + ], + "configuration":{}, + "savePoint":"Path to savepoint", + "action":"Action to perform (e.g., START, STOP)", + "flinkVersion":"Flink version", + "savePointType":"Type of savepoint (e.g., TRIGGER, CANCEL)" + } + } + }, + "jobInstanceId":"Unique identifier for the job instance", + "jobManagerAddress":"Address of the job manager", + "error":"Error message in case of job failure", + "result":{}, + "jobId":"Unique identifier for the job", + "success":"Flag indicating whether the job was successful", + "statement":"SQL statement executed by the job", + "startTime":"Start time of job execution", + "id":"Unique identifier for the job result", + "endTime":"End time of job execution", + "results":[ + { + "total":"No comment,Type =Number", + "columns":[ + "columns_50yua" + ], + "success":"No comment,Type =Boolean", + "limit":"No comment,Type =Number", + "rowData":[ + { + "loadFactor":1.0, + "threshold":1, + "accessOrder":true + } + ], + "startTime":"No comment,Type =String", + "page":"No comment,Type =Number", + "endTime":"No comment,Type =String", + "time":"No comment,Type =Number", + "error":"No comment,Type =String" + } + ], + "status":"Status of the job" + }, + "success":"Result is Success", + "time":"Result Time" +} +``` + + diff --git a/docs/versioned_docs/version-1.0/openapi/_category_.json b/docs/versioned_docs/version-1.0/openapi/_category_.json new file mode 100644 index 0000000000..b2044d19a8 --- /dev/null +++ b/docs/versioned_docs/version-1.0/openapi/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "openapi", + "position": 996 +} diff --git a/docs/versioned_docs/version-1.0/openapi/openapi_overview.md b/docs/versioned_docs/version-1.0/openapi/openapi_overview.md new file mode 100644 index 0000000000..f03ffec20f --- /dev/null +++ b/docs/versioned_docs/version-1.0/openapi/openapi_overview.md @@ -0,0 +1,379 @@ +--- +sidebar_position: 1 +position: 1 +id: openapi_overview +title: Open API 总览 +--- + + +:::info 介绍 +Dinky 平台提供 OpenAPI 能力,通过调用 Dinky 的 OpenAPI 可以使用 Dinky 的功能,实现应用和 Dinky 的集成和交互。 + +Dinky 的 OpenAPI 提供多种 API 功能。通过调用 API,可以快速进行操作和系统集成对接等工作,提高数据开发效率,满足企业定制化需求。您还可以通过开放平台,轻松获取 +OpenAPI 的使用情况。 +::: +当前支持的 OpenAPI 包括如下: + +| 序号 | 执行模式 | 类型名称 | 作用 | +|:--:|:--------------:|:------------------:|:--------------------------:| +| 1 | explainSql | cancel | 调用取消 FlinkSQL 作业 | +| 2 | explainSql | statement | 调用 statement 语句 | +| 3 | executeJar | yarn-application | 调用执行 Yarn-Application jar包 | +| 4 | executeSql | kubernetes-session | 调用执行作业在 K8ssession 上运行 | +| 5 | executeSql | local | 调用执行作业在 Local 上运行 | +| 6 | executeSql | yarn-per-job | 调用执行作业在 Yarn-per-job 上运行 | +| 7 | executeSql | standalone | 调用执行作业在 Standalone 上运行 | +| 8 | executeSql | yarn-session | 调用执行作业在 Yarn-session 上运行 | +| 9 | getJobData | | | +| 10 | getJobPlan | statement | 调用获取执行计划 | +| 11 | getStreamGraph | statement | 调用获取 Flink DAG 图 | +| 12 | savepoint | | 调用手动保存 Checkpoints | +| 13 | savepointTask | | 调用并触发 Savepoint | +| 14 | submitTask | | 作业调度 | + + +## 示例 + +**explainSql** + +explainSql 包括 FlinkSQL 作业取消和 statement 语句执行 + +FlinkSQL 作业 cancel: + +**explainSql** + +explainSql 包括 cancel + +``` +http://127.0.0.1:8888/openapi/explainSql +{ + /* required-start */ + "jobId":"195352b0a4518e16699983a13205f059", + /* required-end */ + /* custom-start */ + "address":"127.0.0.1:8081", + "gatewayConfig":{ + "clusterConfig":{ + "appId":"application_1637739262398_0032", + "flinkConfigPath":"/opt/src/flink-1.13.3_conf/conf", + "flinkLibPath":"hdfs:///flink13/lib/flinklib", + "yarnConfigPath":"/usr/local/hadoop/hadoop-2.7.7/etc/hadoop" + } + } + /* custom-start */ +} +``` + +statement 语句执行: + +``` + http://127.0.0.1:8888/openapi/explainSql +{ + /* required-start */ + "statement":"CREATE TABLE Orders (\r\n order_number INT,\r\n price DECIMAL(32,2),\r\n order_time TIMESTAMP(3)\r\n) WITH (\r\n 'connector' = 'datagen',\r\n 'rows-per-second' = '1',\r\n 'fields.order_number.kind' = 'sequence',\r\n 'fields.order_number.start' = '1',\r\n 'fields.order_number.end' = '1000'\r\n);\r\nCREATE TABLE pt (\r\nordertotal INT,\r\nnumtotal INT\r\n) WITH (\r\n 'connector' = 'print'\r\n);\r\ninsert into pt select 1 as ordertotal ,sum(order_number)*2 as numtotal from Orders", + /* required-end */ + /* default-start */ + "useStatementSet":false, + "fragment":false, + "parallelism":1, + /* default-start */ + /* custom-start */ + "configuration":{ + "table.exec.resource.default-parallelism":2 + } + /* custom-end */ +} +``` + +**executeJar** + +Yarn-application jar 包调用并提交 + +``` + http://127.0.0.1:8888/openapi/executeJar +{ + /* required-start */ + "type":"yarn-application", + "gatewayConfig":{ + "clusterConfig":{ + "flinkConfigPath":"/opt/src/flink-1.13.3_conf/conf", + "flinkLibPath":"hdfs:///flink13/lib/flinklib", + "yarnConfigPath":"/usr/local/hadoop/hadoop-2.7.7/etc/hadoop" + }, + "appConfig":{ + "userJarPath":"hdfs:///flink12/jar/currencyAppJar.jar", + "userJarParas":["--id","2774,2775,2776"," --type","dwd"], + "userJarMainAppClass":"com.app.MainApp" + }, + "flinkConfig": { + "configuration":{ + "parallelism.default": 1 + } + } + }, + /* required-end */ + /* custom-start */ + "jobName":"openapitest", + "savePointPath":"hdfs://ns/flink/savepoints/savepoint-5f4b8c-4326844a6843" + /* custom-end */ +} +``` + +**executeSql** + +executeSql 提交执行作业包括 Local,Kubernetes-session,Yarn-per-job,Standalone,Yarn-session + +Local: + +``` + http://127.0.0.1:8888/openapi/executeSql +{ + /* required-start */ + "type":"local", + "statement":"CREATE TABLE Orders (\r\n order_number INT,\r\n price DECIMAL(32,2),\r\n order_time TIMESTAMP(3)\r\n) WITH (\r\n 'connector' = 'datagen',\r\n 'rows-per-second' = '1',\r\n 'fields.order_number.kind' = 'sequence',\r\n 'fields.order_number.start' = '1',\r\n 'fields.order_number.end' = '1000'\r\n);\r\nCREATE TABLE pt (\r\nordertotal INT,\r\nnumtotal INT\r\n) WITH (\r\n 'connector' = 'print'\r\n);\r\ninsert into pt select 1 as ordertotal ,sum(order_number)*2 as numtotal from Orders", + /* required-end */ + /* default-start */ + "useResult":false, + "useChangeLog":false, + "useAutoCancel":false, + "useStatementSet":false, + "fragment":false, + "maxRowNum":100, + "checkPoint":0, + "parallelism":1, + /* default-start */ + /* custom-start */ + "jobName":"openapitest", + "savePointPath":"hdfs://ns/flink/savepoints/savepoint-5f4b8c-4326844a6843", + "configuration":{ + "table.exec.resource.default-parallelism":2 + } + /* custom-end */ +} +``` + +Kubernetes-session: + +``` + http://127.0.0.1:8888/openapi/executeSql +{ + /* required-start */ + "type":"kubernetes-session", + "address":"127.0.0.1:8081", + "statement":"CREATE TABLE Orders (\r\n order_number INT,\r\n price DECIMAL(32,2),\r\n order_time TIMESTAMP(3)\r\n) WITH (\r\n 'connector' = 'datagen',\r\n 'rows-per-second' = '1',\r\n 'fields.order_number.kind' = 'sequence',\r\n 'fields.order_number.start' = '1',\r\n 'fields.order_number.end' = '1000'\r\n);\r\nCREATE TABLE pt (\r\nordertotal INT,\r\nnumtotal INT\r\n) WITH (\r\n 'connector' = 'print'\r\n);\r\ninsert into pt select 1 as ordertotal ,sum(order_number)*2 as numtotal from Orders", + /* required-end */ + /* default-start */ + "useResult":false, + "useStatementSet":false, + "useChangeLog":false, + "useAutoCancel":false, + "fragment":false, + "maxRowNum":100, + "checkPoint":0, + "parallelism":1, + /* default-start */ + /* custom-start */ + "jobName":"openapitest", + "savePointPath":"hdfs://ns/flink/savepoints/savepoint-5f4b8c-4326844a6843", + "configuration":{ + "table.exec.resource.default-parallelism":2 + } + /* custom-end */ +} +``` + +Yarn-per-job: + +``` +http://127.0.0.1:8888/openapi/executeSql +{ + /* required-start */ + "type":"yarn-per-job", + "statement":"CREATE TABLE Orders (\r\n order_number INT,\r\n price DECIMAL(32,2),\r\n order_time TIMESTAMP(3)\r\n) WITH (\r\n 'connector' = 'datagen',\r\n 'rows-per-second' = '1',\r\n 'fields.order_number.kind' = 'sequence',\r\n 'fields.order_number.start' = '1',\r\n 'fields.order_number.end' = '1000'\r\n);\r\nCREATE TABLE pt (\r\nordertotal INT,\r\nnumtotal INT\r\n) WITH (\r\n 'connector' = 'print'\r\n);\r\ninsert into pt select 1 as ordertotal ,sum(order_number)*2 as numtotal from Orders", + "gatewayConfig":{ + "clusterConfig":{ + "flinkConfigPath":"/opt/src/flink-1.13.3_conf/conf", + "flinkLibPath":"hdfs:///flink13/lib/flinklib", + "yarnConfigPath":"/usr/local/hadoop/hadoop-2.7.7/etc/hadoop" + }, + "flinkConfig": { + "configuration":{ + "parallelism.default": 1 + } + } + }, + /* required-end */ + /* default-start */ + "useResult":false, + "useStatementSet":false, + "fragment":false, + "maxRowNum":100, + "checkPoint":0, + "parallelism":1, + /* default-start */ + /* custom-start */ + "jobName":"openapitest", + "savePointPath":"hdfs://ns/flink/savepoints/savepoint-5f4b8c-4326844a6843", + "configuration":{ + "table.exec.resource.default-parallelism":2 + } + /* custom-end */ +} +``` + +Yarn-session: + +``` + http://127.0.0.1:8888/openapi/executeSql +{ + /* required-start */ + "type":"yarn-session", + "address":"127.0.0.1:8081", + "statement":"CREATE TABLE Orders (\r\n order_number INT,\r\n price DECIMAL(32,2),\r\n order_time TIMESTAMP(3)\r\n) WITH (\r\n 'connector' = 'datagen',\r\n 'rows-per-second' = '1',\r\n 'fields.order_number.kind' = 'sequence',\r\n 'fields.order_number.start' = '1',\r\n 'fields.order_number.end' = '1000'\r\n);\r\nCREATE TABLE pt (\r\nordertotal INT,\r\nnumtotal INT\r\n) WITH (\r\n 'connector' = 'print'\r\n);\r\ninsert into pt select 1 as ordertotal ,sum(order_number)*2 as numtotal from Orders", + /* required-end */ + /* default-start */ + "useResult":false, + "useStatementSet":false, + "useChangeLog":false, + "useAutoCancel":false, + "fragment":false, + "maxRowNum":100, + "checkPoint":0, + "parallelism":1, + /* default-start */ + /* custom-start */ + "jobName":"openapitest", + "savePointPath":"hdfs://ns/flink/savepoints/savepoint-5f4b8c-4326844a6843", + "configuration":{ + "table.exec.resource.default-parallelism":2 + } + /* custom-end */ +} +``` + +Standalone: + +``` + http://127.0.0.1:8888/openapi/executeSql +{ + /* required-start */ + "type":"standalone", + "address":"127.0.0.1:8081", + "statement":"CREATE TABLE Orders (\r\n order_number INT,\r\n price DECIMAL(32,2),\r\n order_time TIMESTAMP(3)\r\n) WITH (\r\n 'connector' = 'datagen',\r\n 'rows-per-second' = '1',\r\n 'fields.order_number.kind' = 'sequence',\r\n 'fields.order_number.start' = '1',\r\n 'fields.order_number.end' = '1000'\r\n);\r\nCREATE TABLE pt (\r\nordertotal INT,\r\nnumtotal INT\r\n) WITH (\r\n 'connector' = 'print'\r\n);\r\ninsert into pt select 1 as ordertotal ,sum(order_number)*2 as numtotal from Orders", + /* required-end */ + /* default-start */ + "useResult":false, + "useStatementSet":false, + "useChangeLog":false, + "useAutoCancel":false, + "fragment":false, + "maxRowNum":100, + "checkPoint":0, + "parallelism":1, + /* default-start */ + /* custom-start */ + "jobName":"openapitest", + "savePointPath":"hdfs://ns/flink/savepoints/savepoint-5f4b8c-4326844a6843", + "configuration":{ + "table.exec.resource.default-parallelism":2 + } + /* custom-end */ +} +``` + +**getJobData** + +``` + http://127.0.0.1:8888/openapi/getJobData?jobId=195352b0a4518e16699983a13205f059 +``` + +**getJobPlan** + +``` + http://127.0.0.1:8888/openapi/getJobPlan +{ + /* required-start */ + "statement":"CREATE TABLE Orders (\r\n order_number INT,\r\n price DECIMAL(32,2),\r\n order_time TIMESTAMP(3)\r\n) WITH (\r\n 'connector' = 'datagen',\r\n 'rows-per-second' = '1',\r\n 'fields.order_number.kind' = 'sequence',\r\n 'fields.order_number.start' = '1',\r\n 'fields.order_number.end' = '1000'\r\n);\r\nCREATE TABLE pt (\r\nordertotal INT,\r\nnumtotal INT\r\n) WITH (\r\n 'connector' = 'print'\r\n);\r\ninsert into pt select 1 as ordertotal ,sum(order_number)*2 as numtotal from Orders", + /* required-end */ + /* default-start */ + "useStatementSet":false, + "fragment":false, + "parallelism":1, + /* default-start */ + /* custom-start */ + "configuration":{ + "table.exec.resource.default-parallelism":2 + } + /* custom-end */ +} +``` + +**getStreamGraph** + +``` + http://127.0.0.1:8888/openapi/getStreamGraph +{ + /* required-start */ + "statement":"CREATE TABLE Orders (\r\n order_number INT,\r\n price DECIMAL(32,2),\r\n order_time TIMESTAMP(3)\r\n) WITH (\r\n 'connector' = 'datagen',\r\n 'rows-per-second' = '1',\r\n 'fields.order_number.kind' = 'sequence',\r\n 'fields.order_number.start' = '1',\r\n 'fields.order_number.end' = '1000'\r\n);\r\nCREATE TABLE pt (\r\nordertotal INT,\r\nnumtotal INT\r\n) WITH (\r\n 'connector' = 'print'\r\n);\r\ninsert into pt select 1 as ordertotal ,sum(order_number)*2 as numtotal from Orders", + /* required-end */ + /* default-start */ + "useStatementSet":false, + "fragment":false, + "parallelism":1, + /* default-start */ + /* custom-start */ + "configuration":{ + "table.exec.resource.default-parallelism":2 + } + /* custom-end */ +} +``` + +**savepoint** + +``` + http://127.0.0.1:8888/openapi/savepoint +{ + /* required-start */ + "jobId":"195352b0a4518e16699983a13205f059", + "savePointType":"trigger", // trigger | stop | cancel + /* required-end */ + /* custom-start */ + "savePoint":"195352b0a4518e16699983a13205f059", + "address":"127.0.0.1:8081", + "gatewayConfig":{ + "clusterConfig":{ + "appId":"application_1637739262398_0032", + "flinkConfigPath":"/opt/src/flink-1.13.3_conf/conf", + "flinkLibPath":"hdfs:///flink13/lib/flinklib", + "yarnConfigPath":"/usr/local/hadoop/hadoop-2.7.7/etc/hadoop" + } + } + /* custom-start */ +} +``` + +**savepointTask** + +``` +http://127.0.0.1:8888/openapi/savepointTask +{ + /* required-start */ + "taskId":"1", + /* required-end */ + /* custom-start */ + "type":"trigger" // trigger | stop | cancel | canceljob + /* custom-start */ +} +``` + +**submitTask** + +``` +http://127.0.0.1:8888/openapi/submitTask?id=1 +``` + +:::tip 说明 +OpenAPI 包括元数据、数据开发、数据集成、运维中心、数据质量、数据服务等。其中数据开发已经开发完成,其他根据版本发布会逐步实现。如果您在数据开发过程中需要使用 +Dinky OpenAPI,使用方式请参见示例。 +::: \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0/practical_guide/Integration_practice/_category_.json b/docs/versioned_docs/version-1.0/practical_guide/Integration_practice/_category_.json new file mode 100644 index 0000000000..06bc2fa7a5 --- /dev/null +++ b/docs/versioned_docs/version-1.0/practical_guide/Integration_practice/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "Integration_practice", + "position": 4 +} diff --git a/docs/versioned_docs/version-1.0/practical_guide/Integration_practice/dinky_integration_ds.md b/docs/versioned_docs/version-1.0/practical_guide/Integration_practice/dinky_integration_ds.md new file mode 100644 index 0000000000..6488fdac13 --- /dev/null +++ b/docs/versioned_docs/version-1.0/practical_guide/Integration_practice/dinky_integration_ds.md @@ -0,0 +1,156 @@ +--- +sidebar_position: 1 +id: dinky_integration_ds +title: Dinky 集成 DolphinScheduler +--- + +:::info 说明 +本文档介绍 DolphinScheduler 集成, 以及如何使用 DolphinScheduler 进行任务调度 + +注意: 本文档基于 Dinky 1.0.0+ 版本编写, 请确保 Dinky 版本 >= 1.0.0 +::: + +## 前置要求 + +- DolphinScheduler 3.2.1+ +- Dinky 1.0.0+ +- Docker 19.03+ + + +## DolphinScheduler 环境准备 + +### 启动 DolphinScheduler +```bash +export DOLPHINSCHEDULER_VERSION=3.2.1 + +docker run --name dolphinscheduler-standalone-server -p 12345:12345 -p 25333:25333 -d apache/dolphinscheduler-standalone-server:"${DOLPHINSCHEDULER_VERSION}" +``` + +页面访问: http://ip:12345/dolphinscheduler/ui/login 默认用户名/密码: admin/dolphinscheduler123 + +### 创建租户并使用户加入该租户 + +1. 进入 `安全中心` -> `租户管理` -> `创建租户` +2. 进入 `安全中心` -> `用户管理` -> `创建用户`/修改用户 -> `选择租户` -> 保存 + +### 创建 Token + +进入 `安全中心` -> `令牌管理` -> `创建令牌` 请注意设置过期时间,并复制生成的 Token + +## Dinky 环境准备 + +### 启动 Dinky + +> 假设部署在: /opt/dinky-1.0.0 目录下 + +```bash + +cd /opt/dinky-1.0.0 + +./auto.sh start 1.16 +``` +页面访问: http://ip:8888 默认用户名/密码: admin/admin + +### 配置 DolphinScheduler + +进入 `配置中心` -> `全局配置` -> 选择 `DolphinScheduler 配置` tag + +1. 配置 `DolphinScheduler 地址` 为: http://ip:12345/dolphinscheduler , 注意 ip 为 DolphinScheduler 服务所在机器的 ip, 根据实际情况修改 +2. 配置 `DolphinScheduler Token` 为: 上一步创建的 Token +3. 配置 `DolphinScheduler 项目名` 为: `Dinky` (注意: 此为默认值, 可自行修改) +4. 最后修改 `是否启用 DolphinScheduler` 为 `是` (注意: 默认为不启用) + +## Dinky 使用示例 + +### Dinky 侧步骤 +1. 进入 `数据开发` -> `项目` -> 右键目录 ->`创建任务` +2. 任务类型可选择 `FlinkSQL` 或 `FlinkJar` ,填写名称,并点击确定 +3. 打开该任务,编辑器内输入以下 DEMO SQL + +```sql +# checkpoint 配置 自行根据实际情况修改, 以下为示例 +set execution.checkpointing.checkpoints-after-tasks-finish.enabled=true; +SET pipeline.operator-chaining=false; +set state.backend.type=rocksdb; +set execution.checkpointing.interval=8000; +set state.checkpoints.num-retained=10; +set cluster.evenly-spread-out-slots=true; + +DROP TABLE IF EXISTS source_table3; +CREATE TABLE IF NOT EXISTS + source_table3 ( + `order_id` BIGINT, + `product` BIGINT, + `amount` BIGINT, + `order_time` as CAST(CURRENT_TIMESTAMP AS TIMESTAMP(3)), + WATERMARK FOR order_time AS order_time - INTERVAL '2' SECOND + ) +WITH + ( + 'connector' = 'datagen', + 'rows-per-second' = '1', + 'fields.order_id.min' = '1', + 'fields.order_id.max' = '2', + 'fields.amount.min' = '1', + 'fields.amount.max' = '10', + 'fields.product.min' = '1', + 'fields.product.max' = '2' + ); + +DROP TABLE IF EXISTS sink_table5; + +CREATE TABLE IF NOT EXISTS + sink_table5 ( + `product` BIGINT, + `amount` BIGINT, + `order_time` TIMESTAMP(3), + `one_minute_sum` BIGINT + ) +WITH + ('connector' = 'print'); + +INSERT INTO + sink_table5 +SELECT + product, + amount, + order_time, + SUM(amount) OVER ( + PARTITION BY + product + ORDER BY + order_time + RANGE BETWEEN INTERVAL '1' MINUTE PRECEDING + AND CURRENT ROW + ) as one_minute_sum +FROM + source_table3; + +``` + +4. 配置右侧 `任务配置` ,请根据实际情况填写,如对参数不了解, 请鼠标悬浮至表单的每项 label 右侧的 `?` 查看帮助信息 + +![dinky_job_desc](http://pic.dinky.org.cn/dinky/docs/zh-CN/practical_guide/Integration_practice/dinky_integration_ds/dinky_job_desc.png) + +5. 在 Dinky 1.0.0 及以后,必须要发布任务才能 推送至 DolphinScheduler, 点击 `发布` 按钮, 等待任务发布成功后,页面会自动刷新,从而出现 `推送按钮`。 +6. 点击 `推送` 按钮, 配置推送参数, 在 Dinky 1.0.0 及以后, 支持了配置前置依赖, 请根据实际情况填写 +:::warning 注意 +选择前置任务后,任务将会在前置任务执行成功后才会执行,请自行合理选择,避免任务循环依赖,本平台不做依赖检查 +::: +![push_ds](http://pic.dinky.org.cn/dinky/docs/zh-CN/practical_guide/Integration_practice/dinky_integration_ds/push_ds.png) + +7. 配置完成之后, 点击 `完成` 按钮, 等待推送成功 + +### DolphinScheduler 侧步骤 + +1. 进入 `项目管理` -> 点击`Dinky`项目(此为在`配置中心`中配置的项目名) -> `工作流定义` ,点击工作流列表中备注为`系统添加` 的工作流 +2. 即可看到刚才在 Dinky 侧创建的任务`datagen` 已经被推送至 DolphinScheduler,且可以看到其依赖关系已经被正确设置 +如图: (忽略其他任务,只关注 `datagen` 任务即可) +![push_ds_workflow_page](http://pic.dinky.org.cn/dinky/docs/zh-CN/practical_guide/Integration_practice/dinky_integration_ds/push_ds_workflow_page.png) + +3. 返回到 `工作流定义` 页面, 将该工作流上线, 可点击`运行`按钮, 运行该工作流, 也可配置定时调度配置, 定时调度配置请参考 DolphinScheduler 官方文档 +4. 剩余操作请参考 DolphinScheduler 官方文档, 本文档不再赘述 + +## 总结 + +通过以上步骤, 我们可以看到, Dinky 与 DolphinScheduler 集成的效果,全面基于页面化配置,页面化操作, 无需编写任何代码,即可完成任务的调度, 降低了用户的学习成本,提高了用户的开发效率, 也降低了用户的维护成本, 使得用户可以更加专注于业务开发, 而不是繁琐的调度维护工作. diff --git a/docs/versioned_docs/version-1.0/practical_guide/Integration_practice/dinky_integration_flink.md b/docs/versioned_docs/version-1.0/practical_guide/Integration_practice/dinky_integration_flink.md new file mode 100644 index 0000000000..1b845fd5bb --- /dev/null +++ b/docs/versioned_docs/version-1.0/practical_guide/Integration_practice/dinky_integration_flink.md @@ -0,0 +1,276 @@ +--- +sidebar_position: 2 +id: dinky_integration_flink +title: Dinky 与 Flink 集成 +--- + +:::info 说明 +本文档介绍 Dinky 与 Flink 集成的使用方法, + +如果您是 Dinky 的新用户, 请先阅读 本文档, 以便更好的搭建 Dinky 环境 + +如果您已经熟悉 Dinky 并已经部署了 Dinky, 请跳过本文档的前置要求部分, 直接阅读 Dinky 与 Flink 集成部分 + +注意: 本文档基于 Dinky 1.0.0+ 版本编写, 请确保 Dinky 版本 >= 1.0.0 + +::: + +## 前置要求 + +- JDK 1.8/11 +- Dinky 1.0.0+ +- MySQL 5.7+ +- Flink 1.14+(Dinky v1.0.0 支持 Flink 1.14+ 及以上版本) + +## Flink 环境准备 + +> 本案例以 Flink 1.18.0 模式采用 Standalone 模式为例, 请根据实际情况自行选择部署模式,各个模式的部署方案自行参考 Flink 官方文档/百度/谷歌/必应... + +### 下载 Flink +```bash + +wget https://archive.apache.org/dist/flink/flink-1.18.0/flink-1.18.0-bin-scala_2.12.tgz + +``` + +### 解压 Flink + +```bash +tar -zxvf flink-1.18.0-bin-scala_2.12.tgz + +mv flink-1.18.0 flink + +``` + +### 配置环境变量 + +```bash + + +vim ~/.bashrc + +# 末尾加入以下内容 +export FLINK_HOME=/opt/flink +export PATH=$PATH:$FLINK_HOME/bin + +# 使环境变量生效 +source ~/.bashrc + +``` + +### 启动 Flink +```bash + +cd flink + +./bin/start-cluster.sh + +``` + +### 验证 + +页面访问: http://ip:8081 + +## Dinky 环境准备 + +### 下载 Dinky + +```bash + +wget https://github.com/DataLinkDC/dinky/releases/download/v1.0.0-rc2/dinky-release-1.0.0-rc2.tar.gz + + +``` + +### 解压 Dinky + +```bash + +tar -zxvf dinky-release-1.0.0-rc2.tar.gz + +mv dinky-release-1.0.0-rc2 dinky + +``` + +### 配置数据库 + +> 本案例以 MySQL 为例, 支持 MySQL 5.7+, PostgreSQL , 或者直接使用内置 H2 数据库,请根据实际情况自行选择数据库,各个数据库的部署方案自行参考官方文档/百度/谷歌/必应... + +> 如果选择使用 H2 数据库, 请跳过本节 ,MySQL 安装步骤在这里不再赘述, 请自行百度/谷歌/必应... + +> 安装完成之后 创建 dinky 数据库, 并设置账户密码,也可使用默认账户密码, 创建完成数据库之后需要执行初始化 sql 脚本, 脚本路径为 dinky/sql/dinky-mysql.sql + +修改 conf/application-mysql.yml 文件, 修改数据库连接信息 + +```yaml +spring: + datasource: + url: jdbc:mysql://${MYSQL_ADDR:127.0.0.1:3306}/${MYSQL_DATABASE:dinky}?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true + username: ${MYSQL_USERNAME:dinky} + password: ${MYSQL_PASSWORD:dinky} + driver-class-name: com.mysql.cj.jdbc.Driver +``` + +修改 conf/application.yml 文件, 修改数据库连接使用方式 + +```yaml + +spring: + # Dinky application name + application: + name: Dinky + profiles: + # The h2 database is used by default. If you need to use other databases, please set the configuration active to: mysql, currently supports [mysql, pgsql, h2] + # If you use mysql database, please configure mysql database connection information in application-mysql.yml + # If you use pgsql database, please configure pgsql database connection information in application-pgsql.yml + # If you use the h2 database, please configure the h2 database connection information in application-h2.yml, + # note: the h2 database is only for experience use, and the related data that has been created cannot be migrated, please use it with caution + active: mysql #[h2,mysql,pgsql] 修改此处,默认为 h2, 修改为 mysql + include: jmx +``` + +## Dinky 与 Flink 集成 + +:::warning 注意 + +修改完数据库连接配置不要着急启动,接下来 Dinky 与 Flink 集成 + +::: + +1. 将 Flink 的 lib 目录下的 所有 jar 包复制到 Dinky 的 extends 目录下 +```shell +cp -r /opt/flink/lib/* /opt/dinky/extends/ +``` +2. 添加/修改一些额外的依赖 +```shell +cd /opt/dinky/extends/ +# 添加 common-cli 依赖, 否则会出现异常 +wget https://repo1.maven.org/maven2/commons-cli/commons-cli/1.6.0/commons-cli-1.6.0.jar + +# 为什么要下载这个 jar 包, 因为内部有些冲突的已经被删除掉了, +# 注意: 如果无需 hadoop 环境, 可以不下载这个 jar 包, 但是如果需要 hadoop 环境, 必须下载这个 jar 包 +# 下载 Dinky 群公告 内的 flink-shaded-hadoop-3-uber-3.1.1.7.2.1.0-327-9.0.jar + +# 将 flink-table-planner-loader 包换成 flink-table-planner 包 +# 先删除 flink-table-planner-loader 包 +rm -rf /opt/dinky/extends/flink-table-planner-loader-1.18.0.jar +rm -rf /opt/flink/lib/flink-table-planner-loader-1.18.0.jar +# 将 flink-table-planner 包复制到 extends 目录下和 flink lib 目录下 +cp /opt/flink/opt/flink-table-planner_2.12-1.18.0.jar /opt/flink/lib/ +cp /opt/flink/opt/flink-table-planner_2.12-1.18.0.jar /opt/dinky/extends/ + +``` +:::warning 注意 +以上依赖修改完成之后, 需要重启 Flink +::: + + + +## 启动 Dinky + +:::warning 注意 +当你阅读到这里的时候, 请确保你已经完成了上述的所有步骤, Flink 已经启动, 并可以正常访问. 请先不要添加其他连接器依赖 + +下述的命令中 1.18 代表 Flink 版本, 请根据实际情况修改 支持 1.14 , 1.15, 1.16 , 1.17 , 1.18, + +通过指定版本使 Dinky 加载对应版本的 Flink 依赖, 以便 Dinky 能够正常与 Flink 集成。 +::: + +```bash + +cd dinky +# 1.18 代表 Flink 版本, 请根据实际情况修改 支持 1.14 , 1.15, 1.16 , 1.17 , 1.18, +./auto.sh start 1.18 + +``` + +### 验证 + +页面访问: http://ip:8888 正常访问至登录页面, 证明 Dinky 已经启动成功, 请使用默认账户密码登录, 默认账户密码为 admin/admin + + +## Datagen 任务 Demo + +### 创建 Datagen 任务 + +1. 进入 `数据开发` -> 项目 -> 新建根目录 名称自行定义 +2. 右键 `新建作业` -> 类型选择`FlinkSQL` -> 输入名称 -> 输入描述(可选) 点击完成 +3. 在编辑器中输入如下代码 + +```sql +# checkpoint 配置 自行根据实际情况修改, 以下为示例 +set execution.checkpointing.checkpoints-after-tasks-finish.enabled=true; +SET pipeline.operator-chaining=false; +set state.backend.type=rocksdb; +set execution.checkpointing.interval=8000; +set state.checkpoints.num-retained=10; +set cluster.evenly-spread-out-slots=true; + +DROP TABLE IF EXISTS source_table3; +CREATE TABLE IF NOT EXISTS + source_table3 ( + `order_id` BIGINT, + `product` BIGINT, + `amount` BIGINT, + `order_time` as CAST(CURRENT_TIMESTAMP AS TIMESTAMP(3)), + WATERMARK FOR order_time AS order_time - INTERVAL '2' SECOND + ) +WITH + ( + 'connector' = 'datagen', + 'rows-per-second' = '1', + 'fields.order_id.min' = '1', + 'fields.order_id.max' = '2', + 'fields.amount.min' = '1', + 'fields.amount.max' = '10', + 'fields.product.min' = '1', + 'fields.product.max' = '2' + ); + +DROP TABLE IF EXISTS sink_table5; + +CREATE TABLE IF NOT EXISTS + sink_table5 ( + `product` BIGINT, + `amount` BIGINT, + `order_time` TIMESTAMP(3), + `one_minute_sum` BIGINT + ) +WITH + ('connector' = 'print'); + +INSERT INTO + sink_table5 +SELECT + product, + amount, + order_time, + SUM(amount) OVER ( + PARTITION BY + product + ORDER BY + order_time + RANGE BETWEEN INTERVAL '1' MINUTE PRECEDING + AND CURRENT ROW + ) as one_minute_sum +FROM + source_table3; + +``` +4. 配置右侧 `任务配置` ,请根据实际情况填写,如对参数不了解, 请鼠标悬浮至表单的每项 label 右侧的 `?` 查看帮助信息 +5. 点击保存按钮/ctrl+s 保存任务 +6. 可自行点击 DAG/检查 等按钮查看任务的 DAG 图和检查该作业的语法是否正确 +7. 以上完成之后,点击运行按钮, 等待任务运行完成, 可以在 `运维中心` 中查看任务的运行状态/直接点击运行按钮左侧的`运维`按钮,即可跳转至运维中心该任务的详情页面查看运行状态,如下图: +![job_detail_info](http://pic.dinky.org.cn/dinky/docs/zh-CN/user_guide/devops_center/job_detail_info.png) + +## 其他连接器集成 + +> 以下连接器集成方式与上述 Datagen 任务集成方式一致, 请自行参考 + +[MYSQLCDC 同步到 Doris](../scenario_practice/mysqlcdc2doris) + +[MYSQLCDC 同步到 StarRocks](../scenario_practice/mysqlcdc2starrocks) + +[MYSQLCDC 同步到 Hudi](../scenario_practice/mysqlcdc2hudi) + +[MYSQLCDC 同步到 Paimon](../scenario_practice/mysqlcdc2paimon) diff --git a/docs/versioned_docs/version-1.0/practical_guide/_category_.json b/docs/versioned_docs/version-1.0/practical_guide/_category_.json new file mode 100644 index 0000000000..d0d469a2a9 --- /dev/null +++ b/docs/versioned_docs/version-1.0/practical_guide/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "practical_guide", + "position": 9 +} diff --git a/docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/_category_.json b/docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/_category_.json new file mode 100644 index 0000000000..9e87ca204b --- /dev/null +++ b/docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "cdcsource_practice", + "position": 1 +} diff --git a/docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_faq.md b/docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_faq.md new file mode 100644 index 0000000000..b454e067d7 --- /dev/null +++ b/docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_faq.md @@ -0,0 +1,55 @@ +--- +sidebar_position: 999 +position: 999 +id: cdcsource_faq +title: 整库同步 FAQ +--- + + +## 常见问题 + +### 如何确认整库同步任务提交成功 + +查看 FlinkWeb 的 JobGraph 是否包含 Sink,如不包含则说明在构建 Sink 时出错,到 `配置中心-系统信息-Logs` 查看后台日志,寻找报错原因。 + +### 多并行度乱序如何解决 + +设置并行度为1;或者设置目标数据源的相关配置来实现最终一致性,如 Doris Sequence 列。 + +### 源库DDL变动怎么办 + +Savepoint Stop/Cancel 作业,然后从最近的 Savepoint/Checkpoint 恢复作业。如果变动过大导致任务无法从保存点正常恢复,在 +CDCSOURCE 前添加 `set 'execution.savepoint.ignore-unclaimed-state' = 'true';`。 + +### 是否支持完整的模式演变 + +不支持,目前模式演变取决于 Sink 的数据源连接器能力,如 Doris 连接器支持字段级模式演变。 + +### No operators defined in streaming topology. Cannot execute. + +jdbc 连接超时导致无法获取正确的元数据信息,可以重启 Dinky 或者升级到 0.7.2及以上版本。 + +### NoClassDefFoundError + +排查依赖冲突或者缺少依赖,注意胖包的使用。 + +### 语法检查和血缘分析未正确显示 + +当前不支持,只支持作业提交。 + +### 源码位置 + +- 1.0.0 之前的版本在 dlink-client 模块下的 cdc 里; +- 1.0.0 之后的版本在 dlink-cdc 模块中 + +### 其他 cdc 和其他 sink 的支持 + +FlinkCDC 支持的能力都可以直接在 Dinky 上使用,可自行扩展支持;所有的 Flink SQL Connector 都可以在 CDCSOURCE +中直接使用,无需代码扩展,只需要在参数前追加 `sink.` 即可;其他特殊的 DataStream Connector 可自行扩展。 + +:::tip 说明 + +- 若有错误和疏漏请及时提出,如果有其他实践请补充,将同步更新至官网文档,多谢支持。 +- 本文档仅供参考,具体以实际使用为准。如你在使用过程中整理了一些实践经验,欢迎在文档中补充。请参考 [如何参与文档贡献](../../developer_guide/contribution/document)。 + +::: \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2ck.md b/docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2ck.md new file mode 100644 index 0000000000..64f90d5dcc --- /dev/null +++ b/docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2ck.md @@ -0,0 +1,50 @@ +--- +sidebar_position: 10 +position: 10 +id: cdcsource_mysqlcdc2ck +title: MySQLCDC 整库到 ClickHouse +--- + + +## 前置准备 + +- 请确保已经在 Flink/lib 和 dinky/extends 目录下放置了 ClickHouse 的 Flink connector jar。如果提交模式为 Application/Per-Job,请确保 ClickHouse connector jar 已经放置在 HDFS 中 +- 请确保已经在 Flink/lib 和 dinky/extends 目录下放置了 MySQL CDC 的 Flink connector jar。 如果提交模式为 Application/Per-Job,请确保 MySQL CDC connector jar 已经放置在 HDFS 中 +- 如在 两方启动后才进行放置上述 jar 包,请重启 Flink 和 Dinky 服务,或者使用 Dinky 中提供的 [ADD CUSTOMJAR](../../extend/expand_statements/add_jar_statement) 功能进行加载。 + + +## 示例 + +注意事项: +- 该示例是将 mysql 整库同步到 ClickHouse 表,且写入名为 ods 的库,目标表名前缀取 `test__` 并转小写。 +- 该示例参数中的 `#{tableName}` 为占位符,实际执行时会替换为实际表名,如 `ods_products`、`ods_orders` 等。 +- 该示例 sink 中的各个参数均可根据实际情况进行调整,请按照 ClickHouse 连接器文档进行配置。并请遵守整库同步的规范. +- 该示例中的 ClickHouse connector 非 Flink 官方提供,请自行下载并放置在 Flink/lib 和 dinky/extends 目录下。 + +### 整库同步到 ClickHouse + +```sql showLineNumbers +EXECUTE CDCSOURCE cdc_clickhouse WITH ( + 'connector' = 'mysql-cdc', + 'hostname' = '127.0.0.1', + 'port' = '3306', + 'username' = 'root', + 'password' = '123456', + 'checkpoint' = '3000', + 'scan.startup.mode' = 'initial', + 'parallelism' = '1', + 'table-name' = 'bigdata\.products,bigdata\.orders', + 'sink.connector' = 'clickhouse', + 'sink.url' = 'clickhouse://127.0.0.1:8123', + 'sink.username' = 'default', + 'sink.password' = '123456', + 'sink.sink.db' = 'test', + 'sink.table.prefix' = 'test_', + 'sink.table.lower' = 'true', + 'sink.database-name' = 'test', + 'sink.table-name' = '#{tableName}', + 'sink.sink.batch-size' = '500', + 'sink.sink.flush-interval' = '1000', + 'sink.sink.max-retries' = '3' +) +``` \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2dinkycatalog.md b/docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2dinkycatalog.md new file mode 100644 index 0000000000..9ee4a720f2 --- /dev/null +++ b/docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2dinkycatalog.md @@ -0,0 +1,31 @@ +--- +sidebar_position: 12 +position: 12 +id: cdcsource_mysqlcdc2dinkycatalog +title: MySQLCDC 整库到 DinkyCatalog +--- + + + +### 整库同步到 Dinky Catalog + +```sql showLineNumbers +EXECUTE CDCSOURCE demo WITH ( + 'connector' = 'mysql-cdc', + 'hostname' = '127.0.0.1', + 'port' = '3306', + 'username' = 'root', + 'password' = '123456', + 'checkpoint' = '10000', + 'scan.startup.mode' = 'initial', + 'parallelism' = '1', + 'table-name' = 'test\..*', + 'sink.connector' = 'sql-catalog', + 'sink.catalog.name' = 'dlinkmysql', + 'sink.catalog.type' = 'dlink_mysql', + 'sink.catalog.username' = 'dlink', + 'sink.catalog.password' = 'dlink', + 'sink.catalog.url' = 'jdbc:mysql://127.0.0.1:3306/dlink?useUnicode=true&characterEncoding=utf8&serverTimezone=UTC', + 'sink.sink.db' = 'default_database' +); +``` diff --git a/docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2doris.md b/docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2doris.md new file mode 100644 index 0000000000..03c9a2fb68 --- /dev/null +++ b/docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2doris.md @@ -0,0 +1,82 @@ +--- +sidebar_position: 3 +position: 3 +id: cdcsource_mysqlcdc2doris +title: MySQLCDC 整库到 Doris +--- + +## 前置准备 + +- 请确保已经在 Flink/lib 和 dinky/extends 目录下放置了 Doris 的 Flink connector jar。如果提交模式为 Application/Per-Job,请确保 Doris connector jar 已经放置在 HDFS 中 +- 请确保已经在 Flink/lib 和 dinky/extends 目录下放置了 MySQL CDC 的 Flink connector jar。 如果提交模式为 Application/Per-Job,请确保 MySQL CDC connector jar 已经放置在 HDFS 中 +- 如在两方启动后才进行放置上述 jar 包,请重启 Flink 和 Dinky 服务,或者使用 Dinky 中提供的 [ADD CUSTOMJAR](../../extend/expand_statements/add_jar_statement) 功能进行加载。 + + +## 示例 + +注意事项: +- 该示例是将 mysql 整库同步到 Doris 表,且写入名为 ods 的库,目标表名前缀取 `test__` 并转小写。 +- 该示例参数中的 `#{tableName}` 为占位符,实际执行时会替换为实际表名,如 `ods_products`、`ods_orders` 等。 +- 该示例参数中的 `#{schemaName}` 为占位符,实际执行时会替换为实际库名,如 `test` 等。 +- 该示例 sink 中的各个参数均可根据实际情况进行调整,请按照 Doris 连接器官方文档进行配置。并请遵守整库同步的规范. + + + +### 普通同步 + +Doris 的 Flink 连接器参数随版本变化较大,以下为 Doris 1.2.0 版本的参数配置。 + +每次提交作业都需要手动修改 `'sink.sink.label-prefix' = '#{schemaName}_#{tableName}_1'` 的值,比如改变尾部的数值。 + +```sql showLineNumbers +EXECUTE CDCSOURCE demo_doris WITH ( + 'connector' = 'mysql-cdc', + 'hostname' = '127.0.0.1', + 'port' = '3306', + 'username' = 'root', + 'password' = '123456', + 'checkpoint' = '10000', + 'scan.startup.mode' = 'initial', + 'parallelism' = '1', + 'table-name' = 'test\.student,test\.score', + 'sink.connector' = 'doris', + 'sink.fenodes' = '127.0.0.1:8030', + 'sink.username' = 'root', + 'sink.password' = '123456', + 'sink.doris.batch.size' = '1000', + 'sink.sink.max-retries' = '1', + 'sink.sink.batch.interval' = '60000', + 'sink.sink.db' = 'test', + 'sink.sink.properties.format' ='json', + 'sink.sink.properties.read_json_by_line' ='true', + 'sink.table.identifier' = '#{schemaName}.#{tableName}', + 'sink.sink.label-prefix' = '#{schemaName}_#{tableName}_1' +); +``` + +### 字段模式演变 + +自动同步列新增和删除列,库表名需要与源库相同。 + +```sql +EXECUTE CDCSOURCE demo_doris_schema_evolution WITH ( + 'connector' = 'mysql-cdc', + 'hostname' = '127.0.0.1', + 'port' = '3306', + 'username' = 'root', + 'password' = '123456', + 'checkpoint' = '10000', + 'scan.startup.mode' = 'initial', + 'parallelism' = '1', + 'table-name' = 'test\.student,test\.score', + 'sink.connector' = 'datastream-doris-schema-evolution', + 'sink.fenodes' = '127.0.0.1:8030', + 'sink.username' = 'root', + 'sink.password' = '123456', + 'sink.doris.batch.size' = '1000', + 'sink.sink.max-retries' = '1', + 'sink.sink.batch.interval' = '60000', + 'sink.sink.db' = 'test', + 'sink.table.identifier' = '#{schemaName}.#{tableName}' +); +``` diff --git a/docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2hivecatalog.md b/docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2hivecatalog.md new file mode 100644 index 0000000000..dcb56982ad --- /dev/null +++ b/docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2hivecatalog.md @@ -0,0 +1,31 @@ +--- +sidebar_position: 11 +position: 11 +id: cdcsource_mysqlcdc2hivecatalog +title: MySQLCDC 整库到 HiveCatalog +--- + + + + + +### 整库同步到 HiveCatalog + +```sql showLineNumbers +EXECUTE CDCSOURCE demo WITH ( + 'connector' = 'mysql-cdc', + 'hostname' = '127.0.0.1', + 'port' = '3306', + 'username' = 'root', + 'password' = '123456', + 'checkpoint' = '10000', + 'scan.startup.mode' = 'initial', + 'parallelism' = '1', + 'table-name' = 'test\..*', + 'sink.connector' = 'sql-catalog', + 'sink.catalog.name' = 'hive', + 'sink.catalog.type' = 'hive', + 'sink.sink.db' = 'hdb', + 'sink.catalog.hive-conf-dir' = '/usr/local/dlink/hive-conf' +); +``` \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2hudi.md b/docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2hudi.md new file mode 100644 index 0000000000..7fdda5f856 --- /dev/null +++ b/docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2hudi.md @@ -0,0 +1,71 @@ +--- +sidebar_position: 4 +position: 4 +id: cdcsource_mysqlcdc2hudi +title: MySQLCDC 整库到 Hudi +--- + +## 前置准备 + +- 请确保已经在 Flink/lib 和 dinky/extends 目录下放置了 Hudi 的 Flink connector jar。如果提交模式为 Application/Per-Job,请确保 Hudi connector jar 已经放置在 HDFS 中 +- 请确保已经在 Flink/lib 和 dinky/extends 目录下放置了 MySQL CDC 的 Flink connector jar。 如果提交模式为 Application/Per-Job,请确保 MySQL CDC connector jar 已经放置在 HDFS 中 +- 如在两方启动后才进行放置上述 jar 包,请重启 Flink 和 Dinky 服务,或者使用 Dinky 中提供的 [ADD CUSTOMJAR](../../extend/expand_statements/add_jar_statement) 功能进行加载。 + + +## 示例 + +注意事项: +- 该示例是将 mysql 整库同步到 Hudi 表 +- 该示例参数中的 `#{tableName}` 为占位符,实际执行时会替换为实际表名,如 `ods_products`、`ods_orders` 等。 +- 该示例参数中的 `#{schemaName}` 为占位符,实际执行时会替换为实际库名,如 `test` 等。 +- 该示例参数中的 `#{pkList}` 为占位符,实际执行时会替换为实际表的主键字段,如 `cid.sid` 等。 +- 该示例 sink 中的各个参数均可根据实际情况进行调整,请按照 Hudi 连接器官方文档进行配置。并请遵守整库同步的规范. + + +> 该示例为 mysql 整库同步到 Hudi 并异步到 Hive,且写入与源相同名的库,在目标表名前缀为 schema 值。其中 `#{pkList}` +,表示把每个表的主键字段用`.`号拼接起来,如表主键为 `cid` 和 `sid` 则表示为 `cid.sid` ,专门用于 hudi 指定recordkey.field +参数。 + +```sql showLineNumbers +EXECUTE CDCSOURCE demo_hudi WITH ( + 'connector' = 'mysql-cdc', + 'hostname' = '127.0.0.1', + 'port' = '3306', + 'username' = 'root', + 'password' = '123456', + 'checkpoint' = '10000', + 'scan.startup.mode' = 'initial', + 'parallelism' = '1', + 'database-name'='bigdata', + 'table-name'='bigdata\.products,bigdata\.orders', + 'sink.connector'='hudi', + 'sink.path'='hdfs://nameservice1/data/hudi/#{tableName}', + 'sink.hoodie.datasource.write.recordkey.field'='#{pkList}', + 'sink.hoodie.parquet.max.file.size'='268435456', + 'sink.write.tasks'='1', + 'sink.write.bucket_assign.tasks'='2', + 'sink.write.precombine'='true', + 'sink.compaction.async.enabled'='true', + 'sink.write.task.max.size'='1024', + 'sink.write.rate.limit'='3000', + 'sink.write.operation'='upsert', + 'sink.table.type'='COPY_ON_WRITE', + 'sink.compaction.tasks'='1', + 'sink.compaction.delta_seconds'='20', + 'sink.compaction.async.enabled'='true', + 'sink.read.streaming.skip_compaction'='true', + 'sink.compaction.delta_commits'='20', + 'sink.compaction.trigger.strategy'='num_or_time', + 'sink.compaction.max_memory'='500', + 'sink.changelog.enabled'='true', + 'sink.read.streaming.enabled'='true', + 'sink.read.streaming.check.interval'='3', + 'sink.hive_sync.skip_ro_suffix' = 'true', + 'sink.hive_sync.enable'='true', + 'sink.hive_sync.mode'='hms', + 'sink.hive_sync.metastore.uris'='thrift://bigdata1:9083', + 'sink.hive_sync.db'='qhc_hudi_ods', + 'sink.hive_sync.table'='#{tableName}', + 'sink.table.prefix.schema'='true' +) +``` \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2kafka.md b/docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2kafka.md new file mode 100644 index 0000000000..700219dcd8 --- /dev/null +++ b/docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2kafka.md @@ -0,0 +1,88 @@ +--- +sidebar_position: 8 +position: 8 +id: cdcsource_mysqlcdc2kafka +title: MySQLCDC 整库到 Kafka +--- + + +## 前置准备 + +- 请确保已经在 Flink/lib 和 dinky/extends 目录下放置了 Kafka 的 Flink connector jar。如果提交模式为 Application/Per-Job,请确保 Kafka connector jar 已经放置在 HDFS 中 +- 请确保已经在 Flink/lib 和 dinky/extends 目录下放置了 MySQL CDC 的 Flink connector jar。 如果提交模式为 Application/Per-Job,请确保 MySQL CDC connector jar 已经放置在 HDFS 中 +- 如在两方启动后才进行放置上述 jar 包,请重启 Flink 和 Dinky 服务,或者使用 Dinky 中提供的 [ADD CUSTOMJAR](../../extend/expand_statements/add_jar_statement) 功能进行加载。 + + +## 示例 + +注意事项: +- 该示例是将 mysql 整库同步到 Kafka topic +- 下述示例参数中的 `#{tableName}` 为占位符,实际执行时会替换为实际表名,如 `ods_products`、`ods_orders` 等,用于指定 Kafka topic 名称。 +- 该示例 sink 中的各个参数均可根据实际情况进行调整,请按照 Kafka 连接器官方文档进行配置。并请遵守整库同步的规范. + +### 汇总到一个 topic + +当指定 `sink.topic` 参数时,所有 Change Log 会被写入这一个 topic。 + +```sql showLineNumbers +EXECUTE CDCSOURCE cdc_kafka_one WITH ( + 'connector' = 'mysql-cdc', + 'hostname' = '127.0.0.1', + 'port' = '3306', + 'username' = 'root', + 'password' = '123456', + 'checkpoint' = '3000', + 'scan.startup.mode' = 'initial', + 'parallelism' = '1', + 'table-name' = 'bigdata\.products,bigdata\.orders', + 'sink.connector'='datastream-kafka', + 'sink.topic'='cdctest', + 'sink.brokers'='bigdata2:9092,bigdata3:9092,bigdata4:9092' +) +``` + +### 同步到对应 topic + +当不指定 `sink.topic` 参数时,所有 Change Log 会被写入对应库表名的 topic。 + +```sql showLineNumbers +EXECUTE CDCSOURCE cdc_kafka_mul WITH ( + 'connector' = 'mysql-cdc', + 'hostname' = '127.0.0.1', + 'port' = '3306', + 'username' = 'root', + 'password' = '123456', + 'checkpoint' = '3000', + 'scan.startup.mode' = 'initial', + 'parallelism' = '1', + 'table-name' = 'bigdata\.products,bigdata\.orders', + 'sink.connector'='datastream-kafka', + 'sink.brokers'='bigdata2:9092,bigdata3:9092,bigdata4:9092' +) +``` + +### 使用 FlinkSQL 同步到对应 topic + +```sql showLineNumbers +EXECUTE CDCSOURCE cdc_upsert_kafka WITH ( + 'connector' = 'mysql-cdc', + 'hostname' = '127.0.0.1', + 'port' = '3306', + 'username' = 'root', + 'password' = '123456', + 'checkpoint' = '3000', + 'scan.startup.mode' = 'initial', + 'parallelism' = '1', + 'table-name' = 'bigdata\.products,bigdata\.orders', + 'sink.connector' = 'upsert-kafka', + 'sink.topic' = '#{tableName}', + 'sink.properties.bootstrap.servers' = 'bigdata2:9092,bigdata3:9092,bigdata4:9092', + 'sink.key.format' = 'avro', + 'sink.value.format' = 'avro' +) +``` + +如果需要给sink端增加kafka的属性,可以按照如下配置 +``` +'sink.properties.transaction.timeout.ms'='900000' +``` diff --git a/docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2multiplesink.md b/docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2multiplesink.md new file mode 100644 index 0000000000..85c3b6b7cc --- /dev/null +++ b/docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2multiplesink.md @@ -0,0 +1,54 @@ +--- +sidebar_position: 13 +position: 13 +id: cdcsource_mysqlcdc2multiplesink +title: MySQLCDC 整库到 多 Sink +--- + + +## 前置准备 + +- 请确保已经在 Flink/lib 和 dinky/extends 目录下放置了 Kafka 的 Flink connector jar。如果提交模式为 Application/Per-Job,请确保 Kafka connector jar 已经放置在 HDFS 中 +- 请确保已经在 Flink/lib 和 dinky/extends 目录下放置了 Doris 的 Flink connector jar。如果提交模式为 Application/Per-Job,请确保 Doris connector jar 已经放置在 HDFS 中 +- 请确保已经在 Flink/lib 和 dinky/extends 目录下放置了 MySQL CDC 的 Flink connector jar。 如果提交模式为 Application/Per-Job,请确保 MySQL CDC connector jar 已经放置在 HDFS 中 +- 如在两方启动后才进行放置上述 jar 包,请重启 Flink 和 Dinky 服务,或者使用 Dinky 中提供的 [ADD CUSTOMJAR](../../extend/expand_statements/add_jar_statement) 功能进行加载。 + + +## 示例 + +注意事项: +- 该示例是将 mysql 整库同步到 Doris 表 和 Kafka topic +- 下述示例参数中的 `#{tableName}` 为占位符,实际执行时会替换为实际表名,如 `ods_products`、`ods_orders` 等,用于指定 Kafka topic 名称/目标表名。 +- 下述示例参数中的 `#{schemaName}` 为占位符,实际执行时会替换为实际库名,如 `test` 等。 +- 该示例 sink 中的各个参数均可根据实际情况进行调整,请按照 Kafka 连接器官方文档进行配置。并请遵守整库同步的规范. + + +```sql showLineNumbers +EXECUTE CDCSOURCE jobname WITH ( + 'connector' = 'mysql-cdc', + 'hostname' = '127.0.0.1', + 'port' = '3306', + 'username' = 'root', + 'password' = '123456', + 'checkpoint' = '3000', + 'scan.startup.mode' = 'initial', + 'parallelism' = '1', + 'table-name' = 'test\.student,test\.score', + 'sink[0].connector' = 'doris', + 'sink[0].fenodes' = '127.0.0.1:8030', + 'sink[0].username' = 'root', + 'sink[0].password' = 'dw123456', + 'sink[0].sink.batch.size' = '1', + 'sink[0].sink.max-retries' = '1', + 'sink[0].sink.batch.interval' = '60000', + 'sink[0].sink.db' = 'test', + 'sink[0].table.prefix' = 'ODS_', + 'sink[0].table.upper' = 'true', + 'sink[0].table.identifier' = '#{schemaName}.#{tableName}', + 'sink[0].sink.label-prefix' = '#{schemaName}_#{tableName}_1', + 'sink[0].sink.enable-delete' = 'true', + 'sink[1].connector'='datastream-kafka', + 'sink[1].topic'='cdc', + 'sink[1].brokers'='127.0.0.1:9092' +) +``` \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2mysql.md b/docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2mysql.md new file mode 100644 index 0000000000..5c46de3a78 --- /dev/null +++ b/docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2mysql.md @@ -0,0 +1,80 @@ +--- +sidebar_position: 6 +position: 6 +id: cdcsource_mysqlcdc2mysql +title: MySQLCDC 整库到 MySQL +--- + +## 前置准备 + +- 请确保已经在 Flink/lib 和 dinky/extends 目录下放置了 Jdbc 的 Flink connector jar。如果提交模式为 Application/Per-Job,请确保 Jdbc connector jar 已经放置在 HDFS 中 +- 请确保已经在 Flink/lib 和 dinky/extends 目录下放置了 MySQL CDC 的 Flink connector jar。 如果提交模式为 Application/Per-Job,请确保 MySQL CDC connector jar 已经放置在 HDFS 中 +- 如在两方启动后才进行放置上述 jar 包,请重启 Flink 和 Dinky 服务,或者使用 Dinky 中提供的 [ADD CUSTOMJAR](../../extend/expand_statements/add_jar_statement) 功能进行加载。 + + +## 示例 + +注意事项: +- 该示例是将 mysql 整库同步到 mysql 表,且写入名为 ods 的库,目标表名前缀取 `test__` 并转小写。 +- 该示例参数中的 `#{tableName}` 为占位符,实际执行时会替换为实际表名,如 `ods_products`、`ods_orders` 等。 +- 该示例 sink 中的各个参数均可根据实际情况进行调整,请按照 mysql 连接器官方文档进行配置。并请遵守整库同步的规范. + +> 该示例为将 mysql 整库同步到另一个 mysql 数据库,写入 test 库,表名前缀 `test_`,表名全小写,开启自动建表。 + +```sql showLineNumbers +EXECUTE CDCSOURCE cdc_mysql WITH ( + 'connector' = 'mysql-cdc', + 'hostname' = '127.0.0.1', + 'port' = '3306', + 'username' = 'root', + 'password' = '123456', + 'checkpoint' = '3000', + 'scan.startup.mode' = 'initial', + 'parallelism' = '1', + 'table-name' = 'bigdata\.products,bigdata\.orders', + 'sink.connector' = 'jdbc', + 'sink.url' = 'jdbc:mysql://127.0.0.1:3306/test?characterEncoding=utf-8&useSSL=false', + 'sink.username' = 'root', + 'sink.password' = '123456', + 'sink.sink.db' = 'test', + 'sink.table.prefix' = 'test_', + 'sink.table.lower' = 'true', + 'sink.table-name' = '#{tableName}', + 'sink.driver' = 'com.mysql.jdbc.Driver', + 'sink.sink.buffer-flush.interval' = '2s', + 'sink.sink.buffer-flush.max-rows' = '100', + 'sink.sink.max-retries' = '5', + 'sink.auto.create' = 'true' +) +``` + +### 整库同步到 Mysql with debezium.skipped.operations + + +```sql showLineNumbers +EXECUTE CDCSOURCE cdc_mysql WITH ( + 'connector' = 'mysql-cdc', + 'hostname' = '127.0.0.1', + 'port' = '3306', + 'username' = 'root', + 'password' = '123456', + 'checkpoint' = '3000', + 'scan.startup.mode' = 'initial', + 'parallelism' = '1', + 'table-name' = 'bigdata\.products,bigdata\.orders', + 'debezium.skipped.operations'='d', + 'sink.connector' = 'jdbc', + 'sink.url' = 'jdbc:mysql://127.0.0.1:3306/test?characterEncoding=utf-8&useSSL=false', + 'sink.username' = 'root', + 'sink.password' = '123456', + 'sink.sink.db' = 'test', + 'sink.table.prefix' = 'test_', + 'sink.table.lower' = 'true', + 'sink.table-name' = '#{tableName}', + 'sink.driver' = 'com.mysql.jdbc.Driver', + 'sink.sink.buffer-flush.interval' = '2s', + 'sink.sink.buffer-flush.max-rows' = '100', + 'sink.sink.max-retries' = '5', + 'sink.auto.create' = 'true' +) +``` \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2oracle.md b/docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2oracle.md new file mode 100644 index 0000000000..50ac1c09c1 --- /dev/null +++ b/docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2oracle.md @@ -0,0 +1,45 @@ +--- +sidebar_position: 7 +position: 7 +id: cdcsource_mysqlcdc2oracle +title: MySQLCDC 整库到 Oracle +--- + + + +## 前置准备 + +- 请确保已经在 Flink/lib 和 dinky/extends 目录下放置了 Jdbc 的 Flink connector jar。如果提交模式为 Application/Per-Job,请确保 Jdbc connector jar 已经放置在 HDFS 中 +- 请确保已经在 Flink/lib 和 dinky/extends 目录下放置了 Oracle CDC 的 Flink connector jar。 如果提交模式为 Application/Per-Job,请确保 Oracle CDC connector jar 已经放置在 HDFS 中 +- 如在两方启动后才进行放置上述 jar 包,请重启 Flink 和 Dinky 服务,或者使用 Dinky 中提供的 [ADD CUSTOMJAR](../../extend/expand_statements/add_jar_statement) 功能进行加载。 + + +## 示例 + +注意事项: +- 该示例是将 mysql 整库同步到 Oracle 表 +- 该示例参数中的 `#{tableName}` 为占位符,实际执行时会替换为实际表名,如 `ods_products`、`ods_orders` 等。 +- 该示例 sink 中的各个参数均可根据实际情况进行调整,请按照 Oracle 连接器官方文档进行配置。并请遵守整库同步的规范. + + +该示例将 Oracle 数据库 TEST 下所有表同步到该数据库的 TEST2下。 + +```sql showLineNumbers +EXECUTE CDCSOURCE cdc_oracle WITH ( + 'connector' = 'oracle-cdc', + 'hostname' = '127.0.0.1', + 'port' = '1521', + 'username'='root', + 'password'='123456', + 'database-name'='ORCL', + 'checkpoint' = '3000', + 'scan.startup.mode' = 'initial', + 'parallelism' = '1', + 'table-name' = 'TEST\..*', + 'connector' = 'jdbc', + 'url' = 'jdbc:oracle:thin:@127.0.0.1:1521:orcl', + 'username' = 'root', + 'password' = '123456', + 'table-name' = 'TEST2.#{tableName}' +) +``` diff --git a/docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2paimon.md b/docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2paimon.md new file mode 100644 index 0000000000..e681ebd881 --- /dev/null +++ b/docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2paimon.md @@ -0,0 +1,63 @@ +--- +sidebar_position: 12 +position: 12 +id: cdcsource_mysqlcdc2paimon +title: MySQLCDC 整库到 Paimon +--- + +## 前置准备 + +- 请确保已经在 Flink/lib 和 dinky/extends 目录下放置了 Paimon 的 Flink connector jar。如果提交模式为 Application/Per-Job,请确保 Paimon connector jar 已经放置在 HDFS 中 +- 请确保已经在 Flink/lib 和 dinky/extends 目录下放置了 MySQL CDC 的 Flink connector jar。 如果提交模式为 Application/Per-Job,请确保 MySQL CDC connector jar 已经放置在 HDFS 中 +- 如在两方启动后才进行放置上述 jar 包,请重启 Flink 和 Dinky 服务,或者使用 Dinky 中提供的 [ADD CUSTOMJAR](../../extend/expand_statements/add_jar_statement) 功能进行加载。 + + +## 示例 + +注意事项: +- 该示例是将 mysql 整库同步到 Paimon 表 +- 该示例 sink 中的各个参数均可根据实际情况进行调整,请按照 Paimon 连接器官方文档进行配置。并请遵守整库同步的规范. + + +```sql showLineNumbers +EXECUTE CDCSOURCE demo WITH ( + 'connector' = 'mysql-cdc', + 'hostname' = '127.0.0.1', + 'port' = '3306', + 'username' = 'root', + 'password' = '123456', + 'checkpoint' = '10000', + 'scan.startup.mode' = 'initial', + 'parallelism' = '1', + 'table-name' = 'test\..*', + 'sink.connector' = 'sql-catalog', + 'sink.catalog.name' = 'fts', + 'sink.catalog.type' = 'table-store', + 'sink.catalog.warehouse'='file:/tmp/table_store' +); +``` + +或者 + +> 此方式可自动建表, 自动建表由 Paimon 完成, dinky 不介入 + +```sql showLineNumbers + +EXECUTE CDCSOURCE dinky_paimon_test +WITH + ( + 'connector' = 'mysql-cdc', + 'hostname' = '', + 'port' = '', + 'username' = '', + 'password' = '', + 'checkpoint' = '10000', + 'parallelism' = '1', + 'scan.startup.mode' = 'initial', + 'database-name' = 'dinky', + 'sink.connector' = 'paimon', + 'sink.path' = 'hdfs:/tmp/paimon/#{schemaName}.db/#{tableName}', + 'sink.auto-create' = 'true', + ); + +``` \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2pg.md b/docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2pg.md new file mode 100644 index 0000000000..0a3513040f --- /dev/null +++ b/docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2pg.md @@ -0,0 +1,47 @@ +--- +sidebar_position: 9 +position: 9 +id: cdcsource_mysqlcdc2pg +title: MySQLCDC 整库到 PostgreSQL +--- + + +## 前置准备 + +- 请确保已经在 Flink/lib 和 dinky/extends 目录下放置了 Jdbc 的 PostgreSQL connector jar。如果提交模式为 Application/Per-Job,请确保 PostgreSQL connector jar 已经放置在 HDFS 中 +- 请确保已经在 Flink/lib 和 dinky/extends 目录下放置了 MySQL CDC 的 Flink connector jar。 如果提交模式为 Application/Per-Job,请确保 MySQL CDC connector jar 已经放置在 HDFS 中 +- 如在两方启动后才进行放置上述 jar 包,请重启 Flink 和 Dinky 服务,或者使用 Dinky 中提供的 [ADD CUSTOMJAR](../../extend/expand_statements/add_jar_statement) 功能进行加载。 + + +## 示例 + +注意事项: +- 该示例是将 mysql 整库同步到 PostgreSQL 表,且写入名为 ods 的库,目标表名前缀取 `test__` 并转小写。 +- 该示例参数中的 `#{tableName}` 为占位符,实际执行时会替换为实际表名,如 `ods_products`、`ods_orders` 等。 +- 该示例 sink 中的各个参数均可根据实际情况进行调整,请按照 PostgreSQL 连接器官方文档进行配置。并请遵守整库同步的规范. + +```sql showLineNumbers +EXECUTE CDCSOURCE cdc_postgresql WITH ( + 'connector' = 'mysql-cdc', + 'hostname' = '127.0.0.1', + 'port' = '3306', + 'username' = 'root', + 'password' = '123456', + 'checkpoint' = '3000', + 'scan.startup.mode' = 'initial', + 'parallelism' = '1', + 'table-name' = 'bigdata\.products,bigdata\.orders', + 'sink.connector' = 'jdbc', + 'sink.url' = 'jdbc:postgresql://127.0.0.1:5432/test', + 'sink.username' = 'test', + 'sink.password' = '123456', + 'sink.sink.db' = 'test', + 'sink.table.prefix' = 'test_', + 'sink.table.lower' = 'true', + 'sink.table-name' = '#{tableName}', + 'sink.driver' = 'org.postgresql.Driver', + 'sink.sink.buffer-flush.interval' = '2s', + 'sink.sink.buffer-flush.max-rows' = '100', + 'sink.sink.max-retries' = '5' +) +``` \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2print.md b/docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2print.md new file mode 100644 index 0000000000..0ce69c211e --- /dev/null +++ b/docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2print.md @@ -0,0 +1,32 @@ +--- +sidebar_position: 2 +id: cdcsource_mysqlcdc2print +position: 2 +title: MySQLCDC 整库到 Print +--- + +## 前置准备 +- 请确保已经在 Flink/lib 和 dinky/extends 目录下放置了 MySQL CDC 的 Flink connector jar。 如果提交模式为 Application/Per-Job,请确保 MySQL CDC connector jar 已经放置在 HDFS 中 +- 如在两方启动后才进行放置上述 jar 包,请重启 Flink 和 Dinky 服务,或者使用 Dinky 中提供的 [ADD CUSTOMJAR](../../extend/expand_statements/add_jar_statement) 功能进行加载。 + + +## 示例 + +注意事项: +- 该示例是将 mysql 整库同步到 Print,输出到控制台。 +- 该示例是常用于快速简单调试, 请勿用于生产环境。 + +```sql showLineNumbers +EXECUTE CDCSOURCE demo_print WITH ( + 'connector' = 'mysql-cdc', + 'hostname' = '127.0.0.1', + 'port' = '3306', + 'username' = 'root', + 'password' = '123456', + 'checkpoint' = '10000', + 'scan.startup.mode' = 'initial', + 'parallelism' = '1', + 'table-name' = 'test\.student,test\.score', + 'sink.connector' = 'print' +); +``` \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2starrocks.md b/docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2starrocks.md new file mode 100644 index 0000000000..86ad116f1f --- /dev/null +++ b/docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_mysqlcdc2starrocks.md @@ -0,0 +1,51 @@ +--- +sidebar_position: 5 +position: 5 +id: cdcsource_mysqlcdc2starrocks +title: MySQLCDC 整库到 StarRocks +--- + + +## 前置准备 + +- 请确保已经在 Flink/lib 和 dinky/extends 目录下放置了 StarRocks 的 Flink connector jar。如果提交模式为 Application/Per-Job,请确保 StarRocks connector jar 已经放置在 HDFS 中 +- 请确保已经在 Flink/lib 和 dinky/extends 目录下放置了 MySQL CDC 的 Flink connector jar。 如果提交模式为 Application/Per-Job,请确保 MySQL CDC connector jar 已经放置在 HDFS 中 +- 如在 两方启动后才进行放置上述 jar 包,请重启 Flink 和 Dinky 服务,或者使用 Dinky 中提供的 [ADD CUSTOMJAR](../../extend/expand_statements/add_jar_statement) 功能进行加载。 + + +## 示例 + +注意事项: +- 该示例是将 mysql 整库同步到 StarRocks 表,且写入名为 ods 的库,目标表名前缀取 `ods_` 并转小写。 +- 该示例参数中的 `#{tableName}` 为占位符,实际执行时会替换为实际表名,如 `ods_products`、`ods_orders` 等。 +- 该示例 sink 中的各个参数均可根据实际情况进行调整,请按照 StarRocks 官方文档进行配置。并请遵守整库同步的规范. + + +```sql showLineNumbers +EXECUTE CDCSOURCE jobname WITH ( + 'connector' = 'mysql-cdc', + 'hostname' = '127.0.0.1', + 'port' = '3306', + 'username' = 'root', + 'password' = '123456', + 'checkpoint' = '3000', + 'scan.startup.mode' = 'initial', + 'parallelism' = '1', + 'table-name' = 'bigdata\.products,bigdata\.orders', + 'sink.connector' = 'starrocks', + 'sink.jdbc-url' = 'jdbc:mysql://127.0.0.1:19035', + 'sink.load-url' = '127.0.0.1:18035', + 'sink.username' = 'root', + 'sink.password' = '123456', + 'sink.sink.db' = 'ods', + 'sink.table.prefix' = 'ods_', + 'sink.table.lower' = 'true', + 'sink.database-name' = 'ods', + 'sink.table-name' = '#{tableName}', + 'sink.sink.properties.format' = 'json', + 'sink.sink.properties.strip_outer_array' = 'true', + 'sink.sink.max-retries' = '10', + 'sink.sink.buffer-flush.interval-ms' = '15000', + 'sink.sink.parallelism' = '1' +) +``` diff --git a/docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_overview.md b/docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_overview.md new file mode 100644 index 0000000000..7713ff06b0 --- /dev/null +++ b/docs/versioned_docs/version-1.0/practical_guide/cdcsource_practice/cdcsource_overview.md @@ -0,0 +1,151 @@ +--- +sidebar_position: 1 +position: 1 +id: cdcsource_overview +title: 整库同步概述 +--- + +## 设计背景 + +目前通过 FlinkCDC 进行会存在诸多问题,如需要定义大量的 DDL 和编写大量的 INSERT INTO,更为严重的是会占用大量的数据库连接,对 +Mysql 和网络造成压力。 + +Dinky 定义了 CDCSOURCE 整库同步的语法,该语法和 CDAS 作用相似,可以直接自动构建一个整库入仓入湖的实时任务,并且对 source +进行了合并,不会产生额外的 Mysql 及网络压力,支持对任意 sink 的同步,如 kafka、doris、hudi、jdbc 等等 + +## 原理 + +### source 合并 + +![source_merge](http://pic.dinky.org.cn/dinky/docs/zh-CN/data_integration_guide/cdcsource_statementssource_merge.png) + +面对建立的数据库连接过多,Binlog 重复读取会造成源库的巨大压力,上文分享采用了 source 合并的优化,尝试合并同一作业中的 +source,如果都是读的同一数据源,则会被合并成一个 source 节点。 + +Dinky 采用的是只构建一个 source,然后根据 schema、database、table 进行分流处理,分别 sink 到对应的表。 + +### 元数据映射 + +Dinky 是通过自身的数据源中心的元数据功能捕获源库的元数据信息,并同步构建 sink 阶段 datastream 或 tableAPI 所使用的 +FlinkDDL。 + +![cdcsource_overview_datasource_schema_info](http://pic.dinky.org.cn/dinky/docs/zh-CN/practical_guide/cdcsource_practice/cdcsource_overview/cdcsource_overview_datasource_schema_info.png) + +### 多种 sink 方式 + +Dinky 提供了各式各样的 sink 方式,通过修改语句参数可以实现不同的 sink 方式。Dinky 支持通过 DataStream 来扩展新的 +sink,也可以使用 FlinkSQL 无需修改代码直接扩展新的 sink。 + +![cdcsource_overview_sink_demo](http://pic.dinky.org.cn/dinky/docs/zh-CN/practical_guide/cdcsource_practice/cdcsource_overview/cdcsource_overview_sink_demo.png) + +### 注意事项 + +一个 FlinkSQL 任务只能写一个 CDCSOURCE,CDCSOURCE 前可写 set、add customjar 和 ddl 语句。 + +配置项中的英文逗号前不能加空格,需要紧随右单引号。 + +## 环境准备 + +### 作业配置 + +:::warning + +1. 禁用语句集 +2. 禁用批模式 +3. 自 Dinky v1.0.0 开始可以支持 全局变量, 区分整库同步内部变量 #{schemaName} 和 #{tableName} ,全局变量则使用 + ${varName} , 请注意区分 + +::: + +### 整库同步内置变量 + +> ****注意:**** 下述变量均为内置变量,不可修改,只能使用,只适用于整库同步 + +| 变量名 | 说明 | 值示例 | 使用示例 | +|------------|-----------------------|---------|---------------| +| schemaName | 当前表的 schema 名称,即数据库名称 | test | #{schemaName} | +| tableName | 当前表的表名 | student | #{tableName} | +| pkList | 当前表的主键列表 | id,name | #{pkList} | + +### Flink 版本区分 + +- 在 Dinky v1.0.0 之前 dinky-client-1.14 内的整库同步能力最多且主要维护,如果要使用其他 flink 版本的整库同步,如果 SQLSink + 不满足需求,需要DataStreamSink 支持,请手动仿照 dlink-client-1.14 扩展相应代码实现,很简单。 +- Dinky v1.0.0 之后,整库同步整个模块进行单独维护,不再重依赖于 dinky-client 版本,实现更加灵活. 扩展更加简单方便 + +### 其他 FlinkCDC 支持 + +- Dinky v1.0.0 之后,如需扩展其他 FlinkCDC 支持,可以在 `dinky-cdc` 模块的下属子模块中进行扩展 + +### 依赖上传 + +由于 CDCSOURCE 是 Dinky 封装的新功能,Apache Flink 源码不包含,非 Application 模式提交需要在远程 Flink 集群所使用的依赖里添加一下依赖: + +``` +# 将下面 Dinky根目录下 整库同步依赖包放置 $FLINK_HOME/lib下 +lib/dinky-client-base-${version}.jar +lib/dinky-common-${version}.jar +extends/flink${flink-version}/dinky/dinky-client-${version}.jar +``` + +### Application 模式提交 + +> 目前已经支持 `application` ,需提前准备好相关jar包,或者和 `add customjar`语法并用。以 `mysqlcdc-2.3.0`为例,需要以下 jar + +* flink-shaded-guava-18.0-13.0.jar + +* HikariCP-4.0.3.jar + +* druid-1.2.8.jar + +* jackson-datatype-jsr310-2.13.4.jar + +* flink-sql-connector-mysql-cdc-2.3.0.jar + +```sql + +add customjar 'flink-shaded-guava-18.0-13.0.jar' +add customjar 'HikariCP-4.0.3.jar' +add customjar 'druid-1.2.8.jar' +add customjar 'jackson-datatype-jsr310-2.13.4.jar' +add customjar 'flink-sql-connector-mysql-cdc-2.3.0.jar' + +``` + +## 配置参数 + +| 配置项 | 是否必须 | 默认值 | 说明 | +|--------------------------------|------|---------------|------------------------------------------------------------------------------------------------------------------------------------| +| connector | 是 | 无 | 指定要使用的连接器 | +| hostname | 是 | 无 | 数据库服务器的 IP 地址或主机名 | +| port | 是 | 无 | 数据库服务器的端口号 | +| username | 是 | 无 | 连接到数据库服务器时要使用的数据库的用户名 | +| password | 是 | 无 | 连接到数据库服务器时要使用的数据库的密码 | +| scan.startup.mode | 否 | latest-offset | 消费者的可选启动模式,有效枚举为“initial”和“latest-offset” | +| database-name | 否 | 无 | 此参数非必填 | +| table-name | 是 | 无 | 只支持正则,示例:"test\\.student,test\\.score",所有表示例:"test\\..*" | +| split.enable | 否 | false | 是否开启分库分表模式同步 | +| split.match_number_regex | 否 | 无 | 分库分表匹配正则,如果你是table_1,table_2这种切分策略,可以使用 `_[0-9]+` 进行同步,目前也只支持这种策略,单库多表,多库多表,多表单库都可以支持,最终写入的表则是去掉_,如 source: db_1,tb_2, sink: db,tb | +| split.max_match_value | 否 | 无 | 分库分表的最大匹配的最大上限值,比如table_1 ...table_300,往后的table_301并不属于切分策略,则可设置为 `301` | +| source.* | 否 | 无 | 指定个性化的 CDC 配置,如 source.server-time-zone 即为 server-time-zone 配置参数。 | +| debezium.* | 否 | 无 | 支持debezium参数,示例:`'debezium.skipped.operations'='d'` 即过滤源数据库删除操作日志。 | +| jdbc.properties.* | 否 | 无 | 连接jdbc的url参数,示例:'jdbc.properties.useSSL' = 'false' 连接url效果: jdbc:mysql://ip:3306/db?useSSL=false 数据库连接参数 | +| checkpoint | 否 | 无 | 单位 ms | +| parallelism | 否 | 无 | 任务并行度 | +| sink.connector | 是 | 无 | 指定 sink 的类型,如 datastream-kafka、datastream-doris、datastream-hudi、kafka、doris、hudi、jdbc 等等,以 datastream- 开头的为 DataStream 的实现方式 | +| sink.sink.db | 否 | 无 | 目标数据源的库名,不指定时默认使用源数据源的库名 | +| sink.table.prefix | 否 | 无 | 目标表的表名前缀,如 ODS_ 即为所有的表名前拼接 ODS_ | +| sink.table.suffix | 否 | 无 | 目标表的表名后缀 | +| sink.table.upper | 否 | false | 目标表的表名全大写 | +| sink.table.lower | 否 | false | 目标表的表名全小写 | +| sink.auto.create | 否 | false | 目标数据源自动建表,目前只支持 Mysql,其他可自行扩展 | +| sink.timezone | 否 | UTC | 指定目标数据源的时区,在数据类型转换时自动生效 | +| sink.column.replace.line-break | 否 | false | 指定是否去除换行符,即在数据转换中进行 REGEXP_REPLACE(column, '\\n', '') | +| sink.* | 否 | 无 | 目标数据源的配置信息,同 FlinkSQL,使用 ${schemaName} 和 ${tableName} 可注入经过处理的源表名 | +| sink[N].* | 否 | 无 | N代表为多数据源写入, 默认从0开始到N, 其他配置参数信息参考sink.*的配置. | + +### 支持debezium参数 + +CDCSOURCE 支持 debezium.* 参数。该示例为将 mysql 整库同步到另一个 mysql 数据库,添加`'debezium.skipped.operations'='d'` +参数,使得采集日志过滤掉源数据库删除操作,让目标库保留全量数据。如需使用该参数,在配置项中添加即可。 + diff --git a/docs/versioned_docs/version-1.0/practical_guide/run_mode_practice/_category_.json b/docs/versioned_docs/version-1.0/practical_guide/run_mode_practice/_category_.json new file mode 100644 index 0000000000..a031bcf81d --- /dev/null +++ b/docs/versioned_docs/version-1.0/practical_guide/run_mode_practice/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "run_mode_practice", + "position": 2 +} diff --git a/docs/versioned_docs/version-1.0/practical_guide/run_mode_practice/application_model_submit.md b/docs/versioned_docs/version-1.0/practical_guide/run_mode_practice/application_model_submit.md new file mode 100644 index 0000000000..ade28d82ea --- /dev/null +++ b/docs/versioned_docs/version-1.0/practical_guide/run_mode_practice/application_model_submit.md @@ -0,0 +1,53 @@ +--- +sidebar_position: 5 +position: 5 +id: application_model_submit +title: Application 模式提交 +--- + +## 做好集群配置 +具体配置教程参考集群配置: +[http://www.dinky.org.cn/docs/next/user_guide/register_center/cluster_manage#%E9%9B%86%E7%BE%A4%E9%85%8D%E7%BD%AE%E5%88%97%E8%A1%A8](http://www.dinky.org.cn/docs/next/user_guide/register_center/cluster_manage#%E9%9B%86%E7%BE%A4%E9%85%8D%E7%BD%AE%E5%88%97%E8%A1%A8) +## 创建FlinkSql作业 +### 在数据开发中创建FlinkSql作业 +![create_flinkSql_job](http://pic.dinky.org.cn/dinky/docs/zh-CN/practical_guide/run_mode_practice/application_model_submit/create_flinkSql_job.png) +## 编写FlinkSql +```sql +DROP table if exists datagen; +CREATE TABLE datagen ( + a INT, + b varchar +) WITH ( + 'connector' = 'datagen', + 'rows-per-second' = '1', + 'number-of-rows' = '50' +); +DROP table if exists print_table; +CREATE TABLE print_table ( + a INT, + b varchar +) WITH ( + 'connector'='print' +); + + +insert into print_table select a,b from datagen ; +``` +## 切换执行模式并运行FlinkSql作业 +![toggle_execution_mode_and_run_job](http://pic.dinky.org.cn/dinky/docs/zh-CN/practical_guide/run_mode_practice/application_model_submit/toggle_execution_mode_and_run_job.png) +## 观察控制台输出 +![observe_console_output_1](http://pic.dinky.org.cn/dinky/docs/zh-CN/practical_guide/run_mode_practice/application_model_submit/observe_console_output_1.png) +![observe_console_output_2](http://pic.dinky.org.cn/dinky/docs/zh-CN/practical_guide/run_mode_practice/application_model_submit/observe_console_output_2.png) +## 跳转运维中心查看任务运行状况 +![view_task_runs_1](http://pic.dinky.org.cn/dinky/docs/zh-CN/practical_guide/run_mode_practice/application_model_submit/view_task_runs_1.png) +![view_task_runs_2](http://pic.dinky.org.cn/dinky/docs/zh-CN/practical_guide/run_mode_practice/application_model_submit/view_task_runs_2.png) + + + + + + + + + + diff --git a/docs/versioned_docs/version-1.0/practical_guide/run_mode_practice/dinky_k8s_quick_start.mdx b/docs/versioned_docs/version-1.0/practical_guide/run_mode_practice/dinky_k8s_quick_start.mdx new file mode 100644 index 0000000000..f4e08b931f --- /dev/null +++ b/docs/versioned_docs/version-1.0/practical_guide/run_mode_practice/dinky_k8s_quick_start.mdx @@ -0,0 +1,199 @@ +--- +sidebar_position: 1 +id: dinky_k8s_quick_start +title: K8s集成 +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +Dinky支持以下几种 Flink on k8s 运行模式: + +- Native-Kubernetes Application +- Native-Kubernetes Session +- Kubernetes Operator Application(基于官方operator实现) + +> Dinky 不强制要求部署在 Kubernetes 集群中或Kubernetes 节点,但务必保障Dinky与 Kubernetes 集群的网络互通,以便于 Dinky 与 Kubernetes 集群进行交互, +如果使用ClusterIP模式提交还需要确保Kubernetes内部网络与dinky互通 + + +## k8s环境准备 +**部分内容可参考 Flink 对应集成 k8s 文档链接** + + + + [https://nightlies.apache.org/flink/flink-docs-release-1.14/zh/docs/deployment/resource-providers/native_kubernetes/](https://nightlies.apache.org/flink/flink-docs-release-1.16/zh/docs/deployment/resource-providers/native_kubernetes/) + + + [https://nightlies.apache.org/flink/flink-docs-release-1.15/zh/docs/deployment/resource-providers/native_kubernetes/](https://nightlies.apache.org/flink/flink-docs-release-1.16/zh/docs/deployment/resource-providers/native_kubernetes/) + + + [https://nightlies.apache.org/flink/flink-docs-release-1.16/zh/docs/deployment/resource-providers/native_kubernetes/](https://nightlies.apache.org/flink/flink-docs-release-1.16/zh/docs/deployment/resource-providers/native_kubernetes/) + + + [https://nightlies.apache.org/flink/flink-docs-release-1.17/zh/docs/deployment/resource-providers/native_kubernetes/](https://nightlies.apache.org/flink/flink-docs-release-1.16/zh/docs/deployment/resource-providers/native_kubernetes/) + + + [https://nightlies.apache.org/flink/flink-docs-release-1.18/zh/docs/deployment/resource-providers/native_kubernetes/](https://nightlies.apache.org/flink/flink-docs-release-1.16/zh/docs/deployment/resource-providers/native_kubernetes/) + + + + +如果你的k8s集群已经创建好了命名空间与权限配置,那么可以跳过这一步 +```shell +# 创建命名空间 +kubectl create namespace dinky +# 为命名空间创建权限 +kubectl create clusterrolebinding flink-role-binding-default --clusterrole=edit --serviceaccount=dinky:default +``` + +:::tip +上述操作为创建一个命名空间 dinky 并为default用户赋予所有权限,请根据自身需求自行更改,参考官方文档 [https://nightlies.apache.org/flink/flink-docs-stable/docs/deployment/resource-providers/native_kubernetes/#rbac](https://nightlies.apache.org/flink/flink-docs-stable/docs/deployment/resource-providers/native_kubernetes/#rbac) +::: + +--- +## 镜像制作 +本教程以下内容均使用Flink 1.15版本为例,如果使用其他版本,请根据文档自行更改版本号即可 +### 手动制作镜像 +#### 基础镜像Dockerfile模板 +**首先,你需要在当前extends目录下准备以下几个jar包** +- commons-cli-1.3.1.jar +- dinky-app-1.15-1.0.0-SNAPSHOT-jar-with-dependencies.jar +- flink-table-planner_2.12-1.15.4.jar + +> 上述仅为基础必须的依赖,如果你的flink任务有其他依赖需求,请自行补充添加 + +**编写Dockerfile** +```shell +ARG FLINK_VERSION=1.15.4 # flink 版本号 + +FROM flink:${FLINK_VERSION}-scala_2.12 # flink官方镜像tag + +ADD extends /opt/flink/lib # 把当前extends目录下的jar添加进依赖目录 + +RUN rm -rf ${FLINK_HOME}/lib/flink-table-planner-loader-*.jar # 删除loader包,替换为不带loader的 +``` + +**构建镜像并推送到私有镜像仓库** +```shell +# 构建Dinky app镜像 +docker build -t dinky-flink:1.0.0-1.15.4 . --no-cache +# 这一步为推送到私有镜像仓库过程,请根据需要自行修改参数 +docker tag dinky-flink:1.0.0-1.15.4 192.168.0.10:5000/dinky-flink-1.0.0-1.15.4 +docker push 192.168.0.10:5000/dinky-flink-1.0.0-1.15.4 +``` + +#### 其他镜像Dockerfile模板 +##### Python支持 + +```shell +ARG FLINK_VERSION=1.15.4 + +FROM flink:${FLINK_VERSION}-scala_2.12 + +ARG FLINK_VERSION +ENV PYTHON_HOME /opt/miniconda3 + +USER root +RUN wget "https://s3.jcloud.sjtu.edu.cn/899a892efef34b1b944a19981040f55b-oss01/anaconda/miniconda/Miniconda3-py38_4.9.2-Linux-x86_64.sh" -O "miniconda.sh" && chmod +x miniconda.sh +RUN ./miniconda.sh -b -p $PYTHON_HOME && chown -R flink $PYTHON_HOME && ls $PYTHON_HOME + +USER flink +RUN rm -rf ${FLINK_HOME}/lib/flink-table-planner-loader-*.jar +ADD extends /opt/flink/lib # 把当前extends目录下的jar添加进依赖目录 +ENV PATH $PYTHON_HOME/bin:$PATH +RUN pip install "apache-flink==${FLINK_VERSION}" -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com +``` + +#### Hadoop支持 +请提前下载好hadoop安装包`hadoop-3.3.4.tar.gz`到当前目录,版本可自定义更改 +```shell +ARG FLINK_VERSION=1.15.4 + +FROM flink:${FLINK_VERSION}-scala_2.12 + +ARG FLINK_VERSION + +ENV HADOOP_VERSION 3.3.4 +ENV HADOOP_HOME=/opt/hadoop +ADD hadoop-${HADOOP_VERSION}.tar.gz /opt +RUN ln -s /opt/hadoop-${HADOOP_VERSION} ${HADOOP_HOME} +ENV HADOOP_CLASSPATH=${HADOOP_HOME}/etc/hadoop:${HADOOP_HOME}/share/hadoop/common/lib/*:${HADOOP_HOME}/share/hadoop/common/*:${HADOOP_HOME}/share/hadoop/hdfs:${HADOOP_HOME}/share/hadoop/hdfs/lib/*:${HADOOP_HOME}/share/hadoop/hdfs/*:${HADOOP_HOME}/share/hadoop/yarn/lib/*:${HADOOP_HOME}/share/hadoop/yarn/*:${HADOOP_HOME}/share/hadoop/mapreduce/lib/*:${HADOOP_HOME}/share/hadoop/mapreduce/*:${HADOOP_HOME}/contrib/capacity-scheduler/*.jar +ENV HADOOP_CONF_DIR=${HADOOP_HOME}/conf +ENV PATH=${PATH}:${HADOOP_CLASSPATH}:${HADOOP_CONF_DIR}:${HADOOP_HOME}/bin + +USER flink +RUN rm -rf ${FLINK_HOME}/lib/flink-table-planner-loader-1.15.4.jar +ENV PATH $PYTHON_HOME/bin:$PATH +ADD extends /opt/flink/lib # 把当前extends目录下的jar添加进依赖目录 +``` + +### 通过页面构建镜像 +> 正在快马加鞭赶来中,请耐心等待 + +## 配置Kubernetes集群信息 +在**注册中心页面**,点击 **集群==>集群配置==>新建** 进入新建集群页面 +![IMG](http://pic.dinky.org.cn/dinky/docs/test/k8s-new-config.png)类型选择`Kubernetes Native`或者`Kubernetes Operator` 目前阶段仍推荐Kubernetes Native方式,operator还在beta中 + +#### 填写集群信息 + +##### Kubernetes 配置 + +| 参数 | 说明 | 是否必填 | 默认值 | 示例值 | +|--------------------|------------------------------------------|:----:|:---:|:------------------------:| +| 暴露端口类型 | 支持NodePort与ClusterIP | 是 | 无 | NodePort | +| Kubernetes 命名空间 | 集群所在的 Kubernetes 命名空间 | 是 | 无 | dinky | +| K8s 提交账号 | 集群提交任务的账号 | 是 | 无 | default | +| Flink 镜像地址 | 上一步打包的镜像地址 | 是 | 无 | dinky-flink-1.0.0-1.15.4 | +| JobManager CPU 配置 | JobManager 资源配置 | 否 | 无 | 1 | +| TaskManager CPU 配置 | TaskManager 资源配置 | 否 | 无 | 1 | +| Flink 配置文件路径 | 仅指定到文件夹,dinky会自行读取文件夹下的配置文件并作为flink的默认配置 | 否 | 无 | /opt/flink/conf | + +> 如果您有其他的配置项需要添加,请点击添加配置项按钮,添加完毕后,点击保存即可 + +##### Kubernetes 连接与pod配置 +| 参数 | 说明 | 是否必填 | 默认值 | 示例值 | +|----------------------|-----------------------------------------------|:----:|:---:|:---:| +| K8s KubeConfig | 集群的KubeConfig内容,如果不填写,则默认使用`~/.kube/config`文件 | 否 | 无 | 无 | +| Default Pod Template | 默认的Pod模板 | 否 | 无 | 无 | +| JM Pod Template | JobManager的Pod模板 | 否 | 无 | 无 | +| TM Pod Template | TaskManager的Pod模板 | 否 | 无 | 无 | + +##### 提交 FlinkSQL 配置项 (Application 模式必填)-公共配置 + +| 参数 | 说明 | 是否必填 | 默认值 | 示例值 | +|----------|------------------------------------------------------------|:----:|:---:|:-----------------------------------------------------------------:| +| Jar 文件路径 | 指定镜像内dinky-app的 Jar 文件路径,如果该集群配置用于提交 Application 模式任务时 则必填 | 否 | 无 | local:///opt/flink/dinky-app-1.16-1.0.0-jar-with-dependencies.jar | +> 由于flink限制,k8s模式只能加载镜像内的jar包,也就是地址必须为local://开头,如果想要自定义jar提交,请查阅jar提交部分 + + +#### Flink 预设配置(高优先级)-公共配置 + +| 参数 | 说明 | 是否必填 | 默认值 | 示例值 | +|-----------------|--------------------|:----:|:---:|:------------------------:| +| JobManager 内存 | JobManager 内存大小! | 否 | 无 | 1g | +| TaskManager 内存 | TaskManager 内存大小! | 否 | 无 | 1g | +| TaskManager 堆内存 | TaskManager 堆内存大小! | 否 | 无 | 1g | +| 插槽数 | 插槽数量 | 否 | 无 | 2 | +| 保存点路径 | 对应SavePoint目录 | 否 | 无 | hdfs:///flink/savepoint | +| 检查点路径 | 对应CheckPoint目录 | 否 | 无 | hdfs:///flink/checkpoint | + +## 启动session集群(可选) + +除了您自己手动部署session集群外,dinky还提供了快捷方式部署Kubernetes session集群,在上面Kubernetes集群配置完成后,点击启动按钮即可向指定Kubernetes集群提交session集群 + +![IMG](http://pic.dinky.org.cn/dinky/docs/test/k8s-config-list.png) + +至此,所有准备工作均已完成完成,接下来就可以通过` kubernetes session`模式或`kubernetes application`模式进行任务提交啦。 + + +## 提交 kubernetes application 任务 + +进入数据开发页面,新建一个flink sql任务,选择集群类型为`kubernetes application`,集群选择为我们刚刚配置的集群,点击提交即可 + +![IMG](http://pic.dinky.org.cn/dinky/docs/test/k8s-task-demo.png) + +## 提交 kubernetes session 任务 + +进入数据开发页面,新建一个flink sql任务,选择集群类型为`kubernetes session`,集群选择为我们刚刚配置的集群,点击提交即可 +图片同上 \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0/practical_guide/run_mode_practice/k8s_native_model_submit.md b/docs/versioned_docs/version-1.0/practical_guide/run_mode_practice/k8s_native_model_submit.md new file mode 100644 index 0000000000..6e1fe5f1db --- /dev/null +++ b/docs/versioned_docs/version-1.0/practical_guide/run_mode_practice/k8s_native_model_submit.md @@ -0,0 +1,8 @@ +--- +sidebar_position: 7 +position: 7 +id: k8s_native_model_submit +title: K8s Native 模式提交 +--- + +快马加鞭赶来中, 如您对该集成场景已有实践, 欢迎分享您的经验, 欢迎贡献您的文档, 请参考[贡献指南](../../developer_guide/contribution/how_contribute)。 \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0/practical_guide/run_mode_practice/k8s_operater_model_submit.md b/docs/versioned_docs/version-1.0/practical_guide/run_mode_practice/k8s_operater_model_submit.md new file mode 100644 index 0000000000..89b99b3eee --- /dev/null +++ b/docs/versioned_docs/version-1.0/practical_guide/run_mode_practice/k8s_operater_model_submit.md @@ -0,0 +1,8 @@ +--- +sidebar_position: 8 +position: 8 +id: k8s_operater_model_submit +title: K8s Operator 模式提交 +--- + +快马加鞭赶来中, 如您对该集成场景已有实践, 欢迎分享您的经验, 欢迎贡献您的文档, 请参考[贡献指南](../../developer_guide/contribution/how_contribute)。 \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0/practical_guide/run_mode_practice/k8s_session_model_submit.md b/docs/versioned_docs/version-1.0/practical_guide/run_mode_practice/k8s_session_model_submit.md new file mode 100644 index 0000000000..36b21f6fb9 --- /dev/null +++ b/docs/versioned_docs/version-1.0/practical_guide/run_mode_practice/k8s_session_model_submit.md @@ -0,0 +1,8 @@ +--- +sidebar_position: 6 +position: 6 +id: k8s_session_model_submit +title: K8s Session 模式提交 +--- + +快马加鞭赶来中, 如您对该集成场景已有实践, 欢迎分享您的经验, 欢迎贡献您的文档, 请参考[贡献指南](../../developer_guide/contribution/how_contribute)。 \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0/practical_guide/run_mode_practice/local_model_submit.md b/docs/versioned_docs/version-1.0/practical_guide/run_mode_practice/local_model_submit.md new file mode 100644 index 0000000000..6a8a94793c --- /dev/null +++ b/docs/versioned_docs/version-1.0/practical_guide/run_mode_practice/local_model_submit.md @@ -0,0 +1,8 @@ +--- +sidebar_position: 1 +position: 1 +id: local_model_submit +title: LOCAL 模式提交 +--- + +快马加鞭赶来中, 如您对该集成场景已有实践, 欢迎分享您的经验, 欢迎贡献您的文档, 请参考[贡献指南](../../developer_guide/contribution/how_contribute)。 \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0/practical_guide/run_mode_practice/projob_model_submit.md b/docs/versioned_docs/version-1.0/practical_guide/run_mode_practice/projob_model_submit.md new file mode 100644 index 0000000000..fd3975a73e --- /dev/null +++ b/docs/versioned_docs/version-1.0/practical_guide/run_mode_practice/projob_model_submit.md @@ -0,0 +1,8 @@ +--- +sidebar_position: 4 +position: 4 +id: projob_model_submit +title: ProJob 模式提交 +--- + +快马加鞭赶来中, 如您对该集成场景已有实践, 欢迎分享您的经验, 欢迎贡献您的文档, 请参考[贡献指南](../../developer_guide/contribution/how_contribute)。 \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0/practical_guide/run_mode_practice/standalone_model_submit.md b/docs/versioned_docs/version-1.0/practical_guide/run_mode_practice/standalone_model_submit.md new file mode 100644 index 0000000000..8a04994104 --- /dev/null +++ b/docs/versioned_docs/version-1.0/practical_guide/run_mode_practice/standalone_model_submit.md @@ -0,0 +1,8 @@ +--- +sidebar_position: 2 +position: 2 +id: standalone_model_submit +title: Standalone 模式提交 +--- + +快马加鞭赶来中, 如您对该集成场景已有实践, 欢迎分享您的经验, 欢迎贡献您的文档, 请参考[贡献指南](../../developer_guide/contribution/how_contribute)。 \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0/practical_guide/run_mode_practice/yarnsession_model_submit.md b/docs/versioned_docs/version-1.0/practical_guide/run_mode_practice/yarnsession_model_submit.md new file mode 100644 index 0000000000..056c16ab9a --- /dev/null +++ b/docs/versioned_docs/version-1.0/practical_guide/run_mode_practice/yarnsession_model_submit.md @@ -0,0 +1,8 @@ +--- +sidebar_position: 3 +position: 3 +id: yarnsession_model_submit +title: YarnSession 模式提交 +--- + +快马加鞭赶来中, 如您对该集成场景已有实践, 欢迎分享您的经验, 欢迎贡献您的文档, 请参考[贡献指南](../../developer_guide/contribution/how_contribute)。 \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0/practical_guide/scenario_practice/_category_.json b/docs/versioned_docs/version-1.0/practical_guide/scenario_practice/_category_.json new file mode 100644 index 0000000000..90b905602e --- /dev/null +++ b/docs/versioned_docs/version-1.0/practical_guide/scenario_practice/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "scenario_practice", + "position": 3 +} diff --git a/docs/versioned_docs/version-1.0/practical_guide/scenario_practice/mysqlcdc2doris.md b/docs/versioned_docs/version-1.0/practical_guide/scenario_practice/mysqlcdc2doris.md new file mode 100644 index 0000000000..77b3ba7de6 --- /dev/null +++ b/docs/versioned_docs/version-1.0/practical_guide/scenario_practice/mysqlcdc2doris.md @@ -0,0 +1,8 @@ +--- +sidebar_position: 1 +id: mysqlcdc2doris +title: MySQLCDC 同步到 Doris +--- + + +快马加鞭赶来中, 如您对该集成场景已有实践, 欢迎分享您的经验, 欢迎贡献您的文档, 请参考[贡献指南](../../developer_guide/contribution/how_contribute)。 \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0/practical_guide/scenario_practice/mysqlcdc2hudi.md b/docs/versioned_docs/version-1.0/practical_guide/scenario_practice/mysqlcdc2hudi.md new file mode 100644 index 0000000000..8329d2e90c --- /dev/null +++ b/docs/versioned_docs/version-1.0/practical_guide/scenario_practice/mysqlcdc2hudi.md @@ -0,0 +1,7 @@ +--- +sidebar_position: 3 +id: mysqlcdc2hudi +title: MySQLCDC 同步到 Hudi +--- + +快马加鞭赶来中, 如您对该集成场景已有实践, 欢迎分享您的经验, 欢迎贡献您的文档, 请参考[贡献指南](../../developer_guide/contribution/how_contribute)。 \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0/practical_guide/scenario_practice/mysqlcdc2paimon.md b/docs/versioned_docs/version-1.0/practical_guide/scenario_practice/mysqlcdc2paimon.md new file mode 100644 index 0000000000..331b160094 --- /dev/null +++ b/docs/versioned_docs/version-1.0/practical_guide/scenario_practice/mysqlcdc2paimon.md @@ -0,0 +1,7 @@ +--- +sidebar_position: 4 +id: mysqlcdc2paimon +title: MySQLCDC 同步到 Paimon +--- + +快马加鞭赶来中, 如您对该集成场景已有实践, 欢迎分享您的经验, 欢迎贡献您的文档, 请参考[贡献指南](../../developer_guide/contribution/how_contribute)。 \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0/practical_guide/scenario_practice/mysqlcdc2starrocks.md b/docs/versioned_docs/version-1.0/practical_guide/scenario_practice/mysqlcdc2starrocks.md new file mode 100644 index 0000000000..4b11b58249 --- /dev/null +++ b/docs/versioned_docs/version-1.0/practical_guide/scenario_practice/mysqlcdc2starrocks.md @@ -0,0 +1,7 @@ +--- +sidebar_position: 2 +id: mysqlcdc2starrocks +title: MySQLCDC 同步到 StarRocks +--- + +快马加鞭赶来中, 如您对该集成场景已有实践, 欢迎分享您的经验, 欢迎贡献您的文档, 请参考[贡献指南](../../developer_guide/contribution/how_contribute)。 \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0/roadmap.md b/docs/versioned_docs/version-1.0/roadmap.md new file mode 100644 index 0000000000..6ae3cb7912 --- /dev/null +++ b/docs/versioned_docs/version-1.0/roadmap.md @@ -0,0 +1,22 @@ +--- +sidebar_position : 995 +id: roadmap +title: 未来计划 +----------- + +- [ ] 连接线展示其转换逻辑关系 +- [ ] 血缘关系图的导出 +- [ ] 血缘关系图的搜索 +- [ ] 全局血缘影响分析 +- [ ] 一些 tips 转提示文案 +- [ ] SQLlite/H2 替换 Paimon +- [ ] 完善文档 +- [ ] 修复一些前端组件关闭问题 +- [ ] 资源中心类型为 HDFS 时支持 Kerberos 认证 +- [ ] Git 项目管理体验提升 +- [ ] 执行历史预览数据支持 +- [ ] 作业导入导出 +- [ ] Flyway 支持以及一些表结构字段信息的变更 +- [ ] 责任人机制 +- [ ] 单点登录 +- [ ] 新增 Kyuubi 数据源 \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0/thanks.md b/docs/versioned_docs/version-1.0/thanks.md new file mode 100644 index 0000000000..84c2625029 --- /dev/null +++ b/docs/versioned_docs/version-1.0/thanks.md @@ -0,0 +1,58 @@ +--- +sidebar_position: 999 +id: thanks +title: 致谢 +--- + + +> 以下排名不分先后 + +### 开源项目 + +[Apache Flink](https://github.com/apache/flink) +- Apache Flink 是一个分布式流处理框架,支持事件驱动的应用程序。它提供了高吞吐量、低延迟的数据处理能力,适用于实时数据分析和处理。 + +[CDC Connectors for Apache Flink®](https://ververica.github.io/flink-cdc-connectors/master/index.html) +- CDC Connectors for Apache Flink® 是一个开源项目,它提供了从数据库到 Apache Flink 的 CDC 连接器。这些连接器允许从数据库中读取更改数据捕获(CDC)数据,并将其发送到 Apache Flink 作业。 + +[Ant Design Pro](https://github.com/ant-design/ant-design-pro) +- Ant Design Pro 是基于 Ant Design 设计体系的 React 实现,是一个企业级的 UI 设计语言和 React 组件库。它提供了一套完整的前端开发解决方案,用于构建现代化的企业级应用。 + +[Docusaurus]( https://github.com/facebook/docusaurus/) +- Docusaurus是一个由 Facebook 开源的静态网站生成器,用于构建易于维护和部署的文档网站。它被广泛用于开源项目和团队的文档撰写。 + +[Mybatis Plus](https://github.com/baomidou/mybatis-plus) +- Mybatis Plus 是 Mybatis 的增强工具,简化了 Mybatis 的开发流程。它提供了更多的特性和便利方法,帮助开发者更高效地进行数据库操作。 + +[Monaco Editor](https://github.com/Microsoft/monaco-editor) +- Monaco Editor是一个基于浏览器的代码编辑器,由 Microsoft 开发。它被广泛用于各种在线开发工具和集成开发环境(IDE)。 + +[SpringBoot](https://spring.io/projects/spring-boot) +- SpringBoot是一种用于创建独立的、基于 Spring 框架的 Java 应用程序的框架。它简化了 Spring 应用的开发过程,提供了一种快速构建应用的方式。 + + +[HuTool](https://hutool.cn/) +- HuTool 是一个 Java 工具包,它提供了一系列工具类,帮助开发者更高效地进行 Java 开发。 + +[SMS4J](https://sms4j.com/doc3/) +- SMS4J 是一个集成各个短信厂商的短信发送平台,它提供了一套统一的短信发送接口,帮助开发者更方便地进行短信发送。Dinky 项目短信告警功能就是基于 SMS4J 实现的。 + +[FlinkSQL数据脱敏和行级权限解决方案](https://github.com/HamaWhiteGG/flink-sql-security) +- FlinkSQL数据脱敏和行级权限解决方案是一个基于 Apache Flink 的数据脱敏和行级权限解决方案,它提供了一套完整的数据脱敏和行级权限解决方案,帮助开发者更方便地进行数据脱敏和行级权限控制。Dinky 中的行级权限功能基于该解决方案实现。 + +[Sa-Token](http://sa-token.dev33.cn/) +- Sa-Token 是一款简单易用、功能强大的Java权限认证框架。它提供了一套简单、灵活、高效的权限认证方案,帮助开发者更方便地进行权限认证。Dinky 项目的登录认证功能/权限控制基于 Sa-Token 实现。 + + +[![JetBrains](http://pic.dinky.org.cn/dinky/docs/zh-CN/thanks/jetbrains.svg)](https://www.jetbrains.com/?from=dinky) +此外,特别感谢 [JetBrains](https://www.jetbrains.com/?from=dinky) 提供的免费开源 License 赞助,JetBrains是一家软件开发工具提供商,提供了许多受欢迎的集成开发环境,如 IntelliJ IDEA。他们支持开源社区,为一些开源项目提供免费的开源许可证,以促进软件开发的进步 + +### 贡献者 + + + + + + + + diff --git a/docs/versioned_docs/version-1.0/user_guide/_category_.json b/docs/versioned_docs/version-1.0/user_guide/_category_.json new file mode 100644 index 0000000000..577cb5d6c1 --- /dev/null +++ b/docs/versioned_docs/version-1.0/user_guide/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "user_guide", + "position": 10 +} diff --git a/docs/versioned_docs/version-1.0/user_guide/auth_center/_category_.json b/docs/versioned_docs/version-1.0/user_guide/auth_center/_category_.json new file mode 100644 index 0000000000..461ab11d78 --- /dev/null +++ b/docs/versioned_docs/version-1.0/user_guide/auth_center/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "auth_center", + "position": 4 +} diff --git a/docs/versioned_docs/version-1.0/user_guide/auth_center/menu.md b/docs/versioned_docs/version-1.0/user_guide/auth_center/menu.md new file mode 100644 index 0000000000..f6faae2a9b --- /dev/null +++ b/docs/versioned_docs/version-1.0/user_guide/auth_center/menu.md @@ -0,0 +1,43 @@ +--- +position: 3 +sidebar_position: 3 +id: menu_add +title: 菜单 +--- + +:::info 简介 +菜单模块提供了菜单的新增、修改、删除等功能,新增的菜单需要二次开发相对应的后台功能. + +此功能菜单在执行系统初始化 sql 时 会自动创建. + +此功能建议由系统管理员操作,不建议将此功能开放给普通用户. +::: + + +### 菜单新增 +选择相应的父级菜单,点击创建根目录,点击右上角的编辑,填写菜单名称、路径、菜单类型等信息,完成菜单的新增。 + +**认证中心 > 菜单 > 创建根目录** + +![menu_add_01](http://pic.dinky.org.cn/dinky/docs/test/menu_add_01.png) + +![menu_add_02](http://pic.dinky.org.cn/dinky/docs/test/menu_add_02.png) + +### 菜单编辑 +点击编辑按钮,进行菜单的编辑修改操作,如修改菜单层级、名称、类型、图标等,还可以进行重置。 + +**认证中心 > 菜单 > 编辑** + +![menu_edit](http://pic.dinky.org.cn/dinky/docs/test/menu_edit.png) + +### 菜单删除 +选择菜单,右键可进行菜单的删除操作。 + +:::warning 注意 +一般情况下,不建议普通用户执行此操作,建议由系统管理员操作. +::: + +**认证中心 > 菜单 > 编辑** + +![menu_delete](http://pic.dinky.org.cn/dinky/docs/test/menu_delete.png) + diff --git a/docs/versioned_docs/version-1.0/user_guide/auth_center/role.md b/docs/versioned_docs/version-1.0/user_guide/auth_center/role.md new file mode 100644 index 0000000000..2ba24c97cc --- /dev/null +++ b/docs/versioned_docs/version-1.0/user_guide/auth_center/role.md @@ -0,0 +1,44 @@ +--- +position: 2 +sidebar_position: 2 +id: role +title: 角色 +--- + +:::info 简介 +角色模块提供了角色的新增、编辑及角色菜单的分配等功能。 + +系统初始化时,默认创建了一个超级管理员角色,角色编码为: `SuperAdmin`, 角色名称为: `SuperAdmin`, 该角色拥有系统所有权限, 无法删除。 + +此功能建议由系统管理员操作,不建议将此功能开放给普通用户. + +注意: 目前分配完成菜单权限后, 需要该角色下的用户重新登录, 才能生效。 +::: + + + +### 新建 +点击新建按钮,输入角色编码、角色名称等相关信息,完成角色的新建。 + +**认证中心 > 角色 > 新建** + +![role_add](http://pic.dinky.org.cn/dinky/docs/test/role_add.png) + +### 编辑 +点击编辑按钮,进行角色信息的修改操作。 + +**认证中心 > 角色 > 编辑** + +![role_edit](http://pic.dinky.org.cn/dinky/docs/test/role_edit.png) + +### 分配菜单 +点击分配菜单按钮,可以对角色的菜单权限进行分配。 + +**认证中心 > 角色 > 分配角色** + +![role_distribute](http://pic.dinky.org.cn/dinky/docs/test/role_distribute.png) + +:::tip 提示 +1. 分配完成后,需要用户重新登录才能生效。 +2. 点击`角色编码`可以查看角色下的用户。 +::: \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0/user_guide/auth_center/row_limits.md b/docs/versioned_docs/version-1.0/user_guide/auth_center/row_limits.md new file mode 100644 index 0000000000..6e163edbcd --- /dev/null +++ b/docs/versioned_docs/version-1.0/user_guide/auth_center/row_limits.md @@ -0,0 +1,29 @@ +--- +position: 4 +sidebar_position: 4 +id: row_limits +title: 行权限 +--- + +:::info 简介 + +行权限场景主要是为了解决角色场景下,不同角色之间的数据隔离问题。通过添加“行权限”规则,可使指定范围的角色和用户仅能查看指定范围的行数据。 +::: + +通过添加“行权限”规则,可使指定范围的角色和用户仅能查看指定范围的行数据。例如用户 A 仅能查看数据集“ '班级'字段=高二 ”的数据。但是只在只在flinksql中生效。 + +![row_limits_add](http://pic.dinky.org.cn/dinky/docs/test/row_limits_add.png) + +如上图所示,表名为flink中的表名,表达式只需要填where后的语句即可。 + + + +## 实现原理 + +本功能基于 [FlinkSQL的行级权限解决方案](https://github.com/HamaWhiteGG/flink-sql-security/blob/dev/docs/row-filter/README.md) 实现,具体原理如下: + +1. 在检查提交时系统会解析传入的 SQL,获取 InputTable 和 OutputTable 两个数据集。 +2. 系统通过对远端权限服务的查询,获取该用户下绑定的 RBAC 权限。 +3. 根据获取到的 RBAC 权限,系统会得到对应的表的权限信息。 +4. 系统将通过重写 SQL,将原本 SQL 查询字段的过滤条件 追加到 WHERE 条件中,从而实现数据的过滤。 +5. 重写后的 SQL 会被提交到 Flink 作业中执行。 diff --git a/docs/versioned_docs/version-1.0/user_guide/auth_center/tenant.md b/docs/versioned_docs/version-1.0/user_guide/auth_center/tenant.md new file mode 100644 index 0000000000..77a4e5cd7d --- /dev/null +++ b/docs/versioned_docs/version-1.0/user_guide/auth_center/tenant.md @@ -0,0 +1,35 @@ +--- +position: 5 +sidebar_position: 5 +id: tenant +title: 租户 +--- + + +:::info 简介 + +租户模块提供了租户的新增、编辑及用户的分配功能。 + +系统初始化时,默认创建了一个超级管理员租户,租户编码为: `DefaultTenant`, 租户名称为: `DefaultTenant`, 该租户拥有系统所有权限, 无法删除。 + +此功能建议由系统管理员操作,不建议将此功能开放给普通用户. +::: + +### 新建 +点击新建按钮,输入租户编码、备注等相关信息,完成租户的新建。 + +**认证中心 > 租户 > 新建** + +![tenant_add](http://pic.dinky.org.cn/dinky/docs/test/tenant_add.png) + +### 分配用户 +点击分配用户按钮,选择需要分配的用户,完成用户的分配。 + +**认证中心 > 租户 > 新建** + +![tenant_allocation](http://pic.dinky.org.cn/dinky/docs/test/tenant_allocation.png) + +:::tip 提示 +1. 分配完成后,需要用户重新登录才能生效。 +2. 点击`租户编码`可以查看租户下的用户。 +:: \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0/user_guide/auth_center/token.md b/docs/versioned_docs/version-1.0/user_guide/auth_center/token.md new file mode 100644 index 0000000000..7d00f9ac8b --- /dev/null +++ b/docs/versioned_docs/version-1.0/user_guide/auth_center/token.md @@ -0,0 +1,30 @@ +--- +position: 6 +sidebar_position: 6 +id: token +title: 令牌 +--- + +:::info 简介 +为了实现 OpenApi 的安全访问,Dinky 提供了令牌管理功能,可以实现对 Dinky OpenApi 的访问控制。并提供细粒度的权限控制,可以对用户、角色、租户进行授权。 +::: + +### 新建 +点击新建按钮,点击生成token,选择用户、角色、租户,选择过期类型,完成令牌的新建。 + +> 注意: 选择时必须依次选择 会触发级联查询操作, 选择用户后, 角色会自动刷新, 选择角色后, 租户会自动刷新。 + +:::tip 提示 +过期策略: +1. 永不过期: 令牌永不过期, 除非手动删除 +2. 指定过期时间: 令牌在指定的时间点过期 +3. 指定过期时间区间: 令牌在指定的时间区间内有效, 区间内的任意时间点都可以访问, 区间外的时间点都无法访问 +::: + + +**认证中心 > 令牌 > 新建** + +![token_add](http://pic.dinky.org.cn/dinky/docs/test/token_add.png) + +如需要对令牌进行修改,可点击编辑按钮进行操作。 + diff --git a/docs/versioned_docs/version-1.0/user_guide/auth_center/user.md b/docs/versioned_docs/version-1.0/user_guide/auth_center/user.md new file mode 100644 index 0000000000..fd1b7a3268 --- /dev/null +++ b/docs/versioned_docs/version-1.0/user_guide/auth_center/user.md @@ -0,0 +1,96 @@ +--- +position: 1 +sidebar_position: 1 +id: user +title: 用户 +--- + +:::info 简介 + +用户模块提供了用户的新增、删除、编辑、角色分配、密码修改及重置等功能。 + +系统初始化 sql 时 会自动创建 admin 用户. + +此功能建议由系统管理员操作,不建议将此功能开放给普通用户. +::: + +:::warning 注意事项 + +**系统初始化默认用户名/密码:** admin/dinky123!@# + +admin 用户在 Dinky 是最高权限用户,无法删除 + +自 Dinky 1.0.0 版本开始,admin 用户的默认密码是 dinky123!@# + +::: + + +### 新建 + +点击新建按钮,输入用户名等相关信息,完成用户的新建。 + +> **注意:** 新建用户的默认密码为: 123456 , 为避免信息泄露,**在生产环境建议用户修改密码**。 + +**认证中心 > 用户 > 新建** + +![user_add](http://pic.dinky.org.cn/dinky/docs/test/user_add.png) + +### 编辑 + +点击编辑按钮,进行用户信息的修改操作。 + +**认证中心 > 用户 > 编辑** + +![user_edit](http://pic.dinky.org.cn/dinky/docs/test/user_edit.png) + +### 分配角色 + +点击分配角色按钮,进行用户的角色分配操作。 + +**认证中心 > 用户 > 分配角色** + +![role_assignment](http://pic.dinky.org.cn/dinky/docs/test/role_assignment.png) + +### 修改密码 + +点击修改密码按钮,进行用户密码的修改操作。 + +- 普通用户创建好后,**默认密码**是 **123456**, +- **admin 用户**密码是 **dinky123!@#** 。为避免信息泄露,**在生产环境建议用户修改密码**。 + +**认证中心 > 用户 > 修改密码** + +![password_modify](http://pic.dinky.org.cn/dinky/docs/test/password_modify.png) + +当密码修改成功后,用户可以选择界面**右上角**的**退出登录**,既可通过新密码登录 Dinky。 + +### 用户删除 + +点击用户删除按钮,进行用户的删除操作。 + +**认证中心 > 用户 > 删除** + +![user_delete](http://pic.dinky.org.cn/dinky/docs/test/user_delete.png) + +### 密码重置 + +点击密码重置按钮,进行密码的重置操作。重置后的密码为随机密码,页面会有弹框消息提示,请注意查看。 + +**认证中心 > 用户 > 重置** + +![password_reset](http://pic.dinky.org.cn/dinky/docs/test/password_reset.png) + +用户管理相关字段含义如下: + +| 字段 | 说明 | +|:-----:|:-------------------------------:| +| 用户名 | 自定义 | +| 昵称 | 自定义 | +| 工号 | 唯一值 | +| 手机号 | 用户使用的手机号 | +| 注册类型 | 有两种类型,本地注册用户为LOCAL, LDAP用户为LDAP | +| 是否删除 | 用户状态是否删除 | +| 超级管理员 | admin默认是,其他自定义用户为否 | +| 是否启用 | 已启用
已禁用 | +| 操作 | 对用户信息做编辑、删除、修改密码操作 | + diff --git a/docs/versioned_docs/version-1.0/user_guide/devops_center/_category_.json b/docs/versioned_docs/version-1.0/user_guide/devops_center/_category_.json new file mode 100644 index 0000000000..63052e4185 --- /dev/null +++ b/docs/versioned_docs/version-1.0/user_guide/devops_center/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "devops_center", + "position": 2 +} diff --git a/docs/versioned_docs/version-1.0/user_guide/devops_center/job_details.md b/docs/versioned_docs/version-1.0/user_guide/devops_center/job_details.md new file mode 100644 index 0000000000..e11457ab1b --- /dev/null +++ b/docs/versioned_docs/version-1.0/user_guide/devops_center/job_details.md @@ -0,0 +1,112 @@ +--- +sidebar_position: 2 +position: 2 +id: job_details +title: 任务详情 +--- + + +:::info 信息 + +在此页面内,可以直观的看到 Flink 任务的详细信息. + +并且可以在点击某一Dag 节点后,查看该节点的详细信息. + +以及支持读取该算子的 CheckPoint 信息(注意: 该功能需要 Flink 任务开启 CheckPoint 功能) +::: + + +## 头部功能区域 + +![header_btns](http://pic.dinky.org.cn/dinky/docs/zh-CN/user_guide/devops_center/header_btns.png) + +> 头部按钮功能区放置了一些常用的操作按钮, 以便于您快速的进行操作.包括: + +- `编辑`: 注意: 此按钮并非修改任务信息的功能,而是在某些情况下任务失联,无法连接任务关联的集群,需要重新映射集群信息,以便于 Dinky 侧能够正确的连接到远端 Flink 集群,以便重新获取任务详细信息. +- `刷新`: 手动刷新当前任务实例的信息 +- `FlinkWebUI`: 跳转到远端 Flink 任务的 WebUI 页面 +- `重新启动`: 重新启动当前任务实例,并生成新的任务实例,并非在当前任务实例上进行重启 +- `智能停止`: 触发此操作后,会在当前任务实例上触发 SavePoint 操作,并在 SavePoint 成功后,停止当前任务实例(注意: 该操作后台会检测当前任务是否配置了 SavePoint 路径,如果没有配置,则不会触发 SavePoint 操作,直接停止任务实例,由 Flink 端调用 SavePoint+Stop 操作) +- `SavePoint 触发`: 触发此操作后,会在当前任务实例上触发 SavePoint 操作 (注意: 此操作不会停止当前任务实例,请确保该任务配置了 SavePoint 路径) +- `SavePoint 暂停`: 暂停当前任务实例的 SavePoint 操作 +- `SavePoint 停止`: 触发此操作后,会在当前任务实例上触发 SavePoint 操作,并在 SavePoint 成功后,停止当前任务实例(注意: 此操作会停止当前任务实例,请确保该任务配置了 SavePoint 路径) +- `普通停止`: 停止当前任务实例,并不会触发 SavePoint 操作 + + +## 作业信息 + +![job_detail_info](http://pic.dinky.org.cn/dinky/docs/zh-CN/user_guide/devops_center/job_detail_info.png) + +如上图所示, 该 Tag 展示了 Flink 任务的基本信息, 包含了 Dinky 侧定义的一些配置, 以及远端 Flink 任务的运行状态, Dag 执行图, 任务的 输入输出记录等信息. + +:::tip 提示 + +- 在配置信息展示区域,可以点击 `Flink实例` 的值,直接跳转至该任务使用的 Flink 实例 + +::: + + +## 作业日志 + +![job_logs](http://pic.dinky.org.cn/dinky/docs/zh-CN/user_guide/devops_center/job_logs.png) + +如上图所示, 该 Tag 展示了 Flink 任务的日志信息, 包含 Root Exception, 以及 Flink JobManager 和 TaskManager 的日志信息.以便于您快速的定位问题. + +## 版本信息 + +![job_version](http://pic.dinky.org.cn/dinky/docs/zh-CN/user_guide/devops_center/job_version.png) + +如上图所示, 该 Tag 展示了 Flink 任务的历史版本信息, 包含了 Flink 任务的历史版本, 以及每个版本的详细信息,此功能在每次任务执行`发布`时,会自动记录当前任务的版本信息,以便于您快速的回滚到某个版本.点击左侧列表中的 `版本号` 即可查看该版本的详细信息. +:::warning 注意 +注意: 此功能提供删除历史版本的功能,但是请谨慎操作,删除后无法恢复. +::: +## 作业快照 + +![job_checkpoint_list](http://pic.dinky.org.cn/dinky/docs/zh-CN/user_guide/devops_center/job_checkpoint_list.png) + +如上图所示, 该 Tag 展示了 Flink 任务的 CheckPoint 信息, 包含了 CheckPoint 列表和 SavePoint 列表, 以及每个 CheckPoint 的详细信息. + +:::tip 提示 +在 CheckPoint 列表中,可以点击 `此处恢复` 按钮,触发从该 CheckPoint 恢复任务的操作,并停止当前任务实例,启动新的任务实例 +::: + + +## 监控 + +![job_metrics_list](http://pic.dinky.org.cn/dinky/docs/zh-CN/user_guide/devops_center/job_metrics_list.png) + +如上图所示, 该 Tag 展示了 Flink 任务的监控信息, 包含了 Flink 任务的监控指标, 以及每个指标的详细信息.此功能需要再任务运行时,自行配置 Flink 任务的监控指标. + +:::tip 拓展 +此功能产生的监控数据 由 Apache Paimon 进行存储,存储方式为`本地文件存储`, 并由后端通过 SSE(Server-Sent Events) 技术进行实时推送,以便于前端实时展示监控数据. +::: + +:::warning 注意 +此功能必须要在任务状态为 `运行中` 时才能正常使用,否则 `任务监控配置` 按钮则不会出现,无法新增监控指标和实时刷新监控指标,但是该任务下已经定义的监控指标,依然可以正常查看. +::: + +## SQL 血缘 + +![job_lineage](http://pic.dinky.org.cn/dinky/docs/zh-CN/user_guide/devops_center/job_lineage.png) + +如上图所示, 该 Tag 展示了 Flink 任务的 SQL 血缘信息,可以直观的看到 Flink 任务的 SQL 血缘关系,以及字段之间的最终关系. +:::tip RoadMap +目前 SQL 血缘功能还在开发中,后续会支持更多的功能,包括: +- [ ] 连接线展示其转换逻辑关系 +- [ ] 血缘关系图的导出 +- [ ] 血缘关系图的搜索 +- [ ] 全局血缘影响分析 +- ... +::: + +## 告警记录 + +![job_alert_list](http://pic.dinky.org.cn/dinky/docs/zh-CN/user_guide/devops_center/job_alert_list.png) + +如上图所示, 该 Tag 展示了 Flink 任务的告警信息,可以直观的看到 Flink 任务的告警信息,以及告警的详细信息. + +:::warning 注意 + +任务告警只有当 任务的生命周期为 `已发布`时,且满足告警策略,并关联了告警组,当任务某个指标满足告警策略时,会触发告警,并在此处展示. + +::: \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0/user_guide/devops_center/job_overview.md b/docs/versioned_docs/version-1.0/user_guide/devops_center/job_overview.md new file mode 100644 index 0000000000..1b97a637c2 --- /dev/null +++ b/docs/versioned_docs/version-1.0/user_guide/devops_center/job_overview.md @@ -0,0 +1,55 @@ +--- +sidebar_position: 1 +position: 1 +id: job_overview +title: 任务总览 +--- +:::info 简介 + +运维中心包括 FlinkSQL 任务运维、FlinkJar 任务运维. + +在运维中心,您可以查看作业实例运行详情,针对任务的关键指标查看,集群信息,作业快照,异常信息,作业日志,配置信息,FlinkSQL,SQL +血缘,历史版本,告警记录。 + +以便全方位的了解 Flink 任务的运行情况,及时发现问题,解决问题。 + +请注意: 目前只针对于 Flink 任务进行运维管理, 普通 DB SQL 任务暂不支持. +::: + +## 任务总览 + +![devops_overview](http://pic.dinky.org.cn/dinky/docs/zh-CN/user_guide/devops_center/devops_overview.png) + +- 可以点击 `指标卡片` 进行筛选对应状态下的任务,如 `运行中`, `已取消`, `异常作业`, `重启中`, `已完成`, `未知作业` +- 在此页面内,可以直观的看到 Flink 任务的运行状态. 生命周期,及任务耗时等信息. +- 在列表区 右上角可以进行筛选任务所属的`生命周期` +- 如上图所示.子表格中展示的是 `该任务名称所有的历史任务`,可以按需查看历史任务的详情信息.可以点击作业名称左侧的小图标进行打开/关闭 +- 如果您需要查看某个任务的详情,可以点击操作栏的 `小眼睛图标` 进行查看[任务详情](job_details) + +## 指标说明 + + +| 指标名称 | 说明 | 是否可筛选 | 备注 | +| ----------------------- | ------------ | ---------- | --------------------------------------------- | +| 总计 | 总计任务数 | 是 | 包括所有产生运行记录的作业,点击可查看所有作业 | +| 批作业 | 批作业数 | 否 | Flink 批作业 | +| 流作业 | 流作业数 | 否 | Flink 流作业 | +| 运行中
(RUNNING) | 运行中任务数 | 是 | | +| 已取消
(CANCELED) | 已取消任务数 | 是 | | +| 异常作业
(FAILED) | 异常作业数 | 是 | | +| 重启中
(RESTARTING) | 重启中任务数 | 是 | | +| 已完成
(FINISHED) | 已完成任务数 | 是 | | +| 未知作业
(UNKNOWN) | 未知作业数 | 是 | | + +## 状态值说明 + + +| 状态值 | 说明 | 是否与 Flink 状态对应 | 对应 Flink 状态值 | 是否可筛选 | 备注 | +| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------- | ----------------- | ---------- | ----------------------------------------------------------------------------- | +| 运行中
(RUNNING) | 任务正在运行 | 是 | RUNNING | 是 | 点击`运行中` 卡片即可筛选 | +| 已取消
(CANCELED) | 任务被取消 | 是 | CANCELED | 是 | 点击`已取消` 卡片即可筛选 | +| 异常作业
(FAILED) | 任务异常 | 是 | FAILED | 是 | 点击`异常作业` 卡片即可筛选 | +| 重启中
(RESTARTING) | 任务正在重启 | 是 | RESTARTING | 是 | 点击`重启中` 卡片即可筛选 | +| 已完成
(FINISHED) | 任务已完成 | 是 | FINISHED | 是 | 点击`已完成` 卡片即可筛选 | +| 未知作业
(UNKNOWN) | 任务状态未知 ,产生原因是由于 Dinky 访问不到任务所在的 JobManager 了,导致无法获取任务状态 | 否 | | 是 | 点击`未知作业` 卡片即可筛选
Dinky 内部定义的状态值, 不会与 Flink 状态对应 | +| 重连
(RECONNECTING) | 任务正在重连,此状态产生原因是由于 Dinky 访问不到任务所在的 JobManager 了,导致无法获取任务状态,会进行一定次数/时间的 尝试重连,在此期间内,任务状态为`重连`, 如果超过指定次数/时间则直接状态变更为`未知作业(UNKNOWN)` | 否 | | 是 | Dinky 内部定义的状态值, 不会与 Flink 状态对应 | diff --git a/docs/versioned_docs/version-1.0/user_guide/metrics_overview.md b/docs/versioned_docs/version-1.0/user_guide/metrics_overview.md new file mode 100644 index 0000000000..7e47a419fb --- /dev/null +++ b/docs/versioned_docs/version-1.0/user_guide/metrics_overview.md @@ -0,0 +1,28 @@ +--- +position: 6 +sidebar_position: 6 +id: metrics_overview +title: 监控 +--- + +:::info 简介 +Dinky1.0增加了Metrics监控功能,可以实现对 Dinky Server的 JVM 信息的监控 +如需要查看 Dinky Server 的实时的 JVM 等信息,需要再 **配置中心** > **全局配置** > **[Metrics 配置](./system_setting/global_settings/metrics_setting)** 中开启 Dinky JVM Monitor 开关 + +注意: 在 Dinky v1.0.0 版本及以上,Metrics 监控功能默认关闭,需要手动开启,否则无法正常监控 + +::: + + +### Dinky Server 监控 + + +![metrics_overview_dinky](http://pic.dinky.org.cn/dinky/docs/test/metrics_overview_dinky.png) + + +### Flink 监控 + +> 此功能 主要展示在 **运维中心** > **任务详情** > **监控** 中 定义的监控指标 + + +![metrics_flink](http://pic.dinky.org.cn/dinky/docs/test/metrics_flink.png) \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0/user_guide/register_center/_category_.json b/docs/versioned_docs/version-1.0/user_guide/register_center/_category_.json new file mode 100644 index 0000000000..f33ec35441 --- /dev/null +++ b/docs/versioned_docs/version-1.0/user_guide/register_center/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "register_center", + "position": 3 +} diff --git a/docs/versioned_docs/version-1.0/user_guide/register_center/alert/_category_.json b/docs/versioned_docs/version-1.0/user_guide/register_center/alert/_category_.json new file mode 100644 index 0000000000..67be203d96 --- /dev/null +++ b/docs/versioned_docs/version-1.0/user_guide/register_center/alert/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "alert", + "position": 3 +} diff --git a/docs/versioned_docs/version-1.0/user_guide/register_center/alert/alert_group.md b/docs/versioned_docs/version-1.0/user_guide/register_center/alert/alert_group.md new file mode 100644 index 0000000000..27f97fa255 --- /dev/null +++ b/docs/versioned_docs/version-1.0/user_guide/register_center/alert/alert_group.md @@ -0,0 +1,27 @@ +--- +position: 3 +sidebar_position: 3 +id: alert_group +title: 告警组 +--- + +:::warning 触发告警前提条件 + +1. 只适用于 `FlinkSQL,FlinkJar` 任务 +2. 作业为`已发布`状态 +3. 满足告警策略,且该告警策略关联了告警模板 + +::: + +## 告警组列表 + +![alert_group_list](http://pic.dinky.org.cn/dinky/docs/test/alert_group_list.png) + +## 参数解读 + +| 字段 | 说明 | 是否必填 | 默认值 | 示例 | +|:-----:|:-----------------------------------:|:----:|:-----:|:--:| +| 告警组名称 | 告警组名称 | 是 | 无 | 无 | +| 告警实例 | 告警实例,可多选 | 是 | 无 | 无 | +| 是否启用 | 已启用/已禁用
注意:引用状态下,数据开发任务无法关联此告警组 | 否 | false | 无 | +| 备注 | 备注 | 否 | 无 | 无 | diff --git a/docs/versioned_docs/version-1.0/user_guide/register_center/alert/alert_instance.md b/docs/versioned_docs/version-1.0/user_guide/register_center/alert/alert_instance.md new file mode 100644 index 0000000000..259c401205 --- /dev/null +++ b/docs/versioned_docs/version-1.0/user_guide/register_center/alert/alert_instance.md @@ -0,0 +1,178 @@ +--- +position: 2 +sidebar_position: 2 +id: alert_instance +title: 告警实例 +--- + + +:::warning 触发告警前提条件 + +1. 只适用于 `FlinkSQL,FlinkJar` 任务 +2. 作业为`已发布`状态 +3. 满足告警策略,且该告警策略关联了告警模板 + +::: + +目前Dinky支持的告警方式有: + +- **[钉钉](#钉钉)告警 :** WebHook +- **[企业微信](#企业微信)告警 :** 包含 **应用(支持配置代理url)** **群聊** +- **[飞书](#飞书)告警 :** WebHook +- **[邮箱](#邮箱)告警 :** 通过邮件发送报警通知 +- **[短信](#短信)告警 :** 通过短信发送报警通知,目前支持 阿里云短信 和 腾讯云短信 +- **[Http](#http)告警 :** 通过Http Url 发送报警通知 + +## 报警实例列表 + +![alert_instance_list](http://pic.dinky.org.cn/dinky/docs/test/alert_list.png) + +## 参数解读 + +### 公共配置项 + +| 字段 | 说明 | 是否必填 | 默认值 | 示例 | +|:----:|:--------------------------------------------------------------------------------:|:----:|:----:|:--:| +| 名称 | 告警实例名称,需要唯一 | 是 | 无 | 无 | +| 类型 | WeChat(App/群聊)
DingTalk
FeiShu
Email
Http
Sms(阿里云/腾讯云) | 是 | 无 | 无 | +| 是否启用 | 已启用
已禁用
注意:禁用后报警实例不能被告警组所关联, 且关联的报警组下的该实例无法发送告警信息 | 是 | true | 无 | + +### 钉钉 + +| 字段 | 说明 | 是否必填 | 默认值 | 示例 | +|:----------:|:--------------------------:|:----:|:-----:|:-----:| +| WebHook 地址 | 钉钉机器人地址 | 是 | 无 | 无 | +| 关键词 | 自定义关键词,当创建机器人时指定了关键词策略时才生效 | 否 | 无 | Dinky | +| 密令 | 钉钉机器人密令,当创建机器人时指定了加签策略时才生效 | 否 | 无 | 无 | +| 是否启用代理 | 是否启用代理 | 否 | false | 无 | +| 代理地址 | 代理地址,仅当启用代理时生效 | 是 | 无 | 无 | +| 代理端口 | 代理端口,仅当启用代理时生效 | 是 | 无 | 无 | +| 用户名 | 代理用户名,仅当启用代理时生效 | 是 | 无 | 无 | +| 密码 | 代理密码,仅当启用代理时生效 | 是 | 无 | 无 | +| 是否@所有人 | 是否@所有人 | 否 | false | 无 | +| 手机号码 | 手机号码,支持多个,按需添加 ,未启用@全部时必填 | 是 | 无 | 无 | + +**说明:** 自定义机器人发送消息时,在“被@手机号”里面的人员收到该消息时,会有@消息提醒。 + +[钉钉-开发者文档](https://open.dingtalk.com/document/robots/custom-robot-access) + +### 企业微信 + +#### 微信企业应用配置 + +![alert_instance_wechat_app](http://pic.dinky.org.cn/dinky/docs/test/alert_instance_wechat_app.png) + +| 字段 | 说明 | 是否必填 | 默认值 | 示例 | +|:------:|:----------------------------------------------------------------------------------:|:----:|:-----:|:--:| +| 发送方式 | 发送方式,支持应用和群聊,此为 App | 是 | 无 | 无 | +| 企业Id | 企业Id,需要联系管理员获取 | 是 | 无 | 无 | +| 密令 | 应用的密令,需要联系管理员获取 | 是 | 无 | 无 | +| 代理ID | 代理ID,需要联系管理员获取 | 是 | 无 | 无 | +| 企微发送地址 | 企微发送地址,默认为:https://qyapi.weixin.qq.com/cgi-bin 可以支持代理url,如:https://ip:port/cgi-bin | | 是 | 无 | 无 | +| 是否@所有人 | 是否@所有人 | 否 | false | 无 | +| @用户 | 当启用@所有人时,此处填写企业微信用户名,可以联系管理员获取/自行查看个人信息 | 是 | 无 | 无 | + +**说明:** @所有人与被@用户可相互切换 + +#### 微信企业群聊配置 + +![create_wechat_chat_alert](http://pic.dinky.org.cn/dinky/docs/test/alert_instance_wechat_chat.png) + +| 字段 | 说明 | 是否必填 | 默认值 | 示例 | +|:----------:|:---------------------------------------:|:----:|:-----:|:--:| +| WebHook 地址 | WebHook 地址 | 是 | 无 | 无 | +| 关键词 | 自定义关键词,当创建机器人时指定了关键词策略时才生效 | 否 | 无 | 无 | +| 密令 | 应用的密令,需要联系管理员获取 | 是 | 无 | 无 | +| 是否@所有人 | 是否@所有人 | 否 | false | 无 | +| @用户 | 当启用@所有人时,此处填写企业微信用户名,可以联系管理员获取/自行查看个人信息 | 是 | 无 | 无 | + +**说明:** @所有人与被@用户可相互切换 + +其中发送方式分别对应企微文档: + +[应用-开发者文档](https://work.weixin.qq.com/api/doc/90000/90135/90236) +[群聊-开发者文档](https://work.weixin.qq.com/api/doc/90000/90135/90248) + +### 飞书 + +![create_feishu_alert](http://pic.dinky.org.cn/dinky/docs/test/alert_instance_feishu.png) + +| 字段 | 说明 | 是否必填 | 默认值 | 示例 | +|:----------:|:--------------------------:|:----:|:-----:|:-----:| +| WebHook 地址 | 飞书机器人地址 | 是 | 无 | 无 | +| 关键词 | 自定义关键词,当创建机器人时指定了关键词策略时才生效 | 否 | 无 | Dinky | +| 密令 | 钉钉机器人密令,当创建机器人时指定了加签策略时才生效 | 否 | 无 | 无 | +| 是否启用代理 | 是否启用代理 | 否 | false | 无 | +| 代理地址 | 代理地址,仅当启用代理时生效 | 是 | 无 | 无 | +| 代理端口 | 代理端口,仅当启用代理时生效 | 是 | 无 | 无 | +| 用户名 | 代理用户名,仅当启用代理时生效 | 是 | 无 | 无 | +| 密码 | 代理密码,仅当启用代理时生效 | 是 | 无 | 无 | +| 是否@所有人 | 是否@所有人 | 否 | false | 无 | +| @用户 | 当启用@所有人时,此处填写飞书用户名 | 是 | 无 | 无 | + +**说明:** @所有人与被@用户可相互切换 + +[飞书-自定义机器人接入开发文档](https://open.feishu.cn/document/ukTMukTMukTM/ucTM5YjL3ETO24yNxkjN) + +### 邮箱 + +| 字段 | 说明 | 是否必填 | 默认值 | 示例 | +|:---------:|:-----------------------------:|:----:|:-----:|:------------:| +| 邮箱地址 | 邮箱地址 | 是 | 无 | 无 | +| 邮件服务器Port | 邮件服务器端口 | 是 | 无 | 无 | +| 发送者昵称 | 发送者昵称 | 是 | 无 | 无 | +| 收件人邮箱 | 收件人邮箱 | 是 | 无 | 无 | +| 抄送人邮箱 | 抄送人邮箱 | 是 | 无 | 无 | +| 是否开启邮箱验证 | 是否开启邮箱验证 | 否 | false | 无 | +| 邮箱用户名 | 邮箱用户名 | 是 | 无 | 无 | +| 邮箱密码 | 邮箱密码 ,注意:部分邮箱需要自行获取授权码而非密码 | 是 | 无 | 无 | +| 开启tls证书 | 开启tls证书 | 否 | false | 无 | +| 开启SSL | 开启SSL证书 | 否 | false | 无 | +| 受信任域 | 如果开启了SSL,必填(一半情况和邮箱服务器保持一致即可) | 是 | 无 | stmp.126.com | + +### 短信 + +#### 公共配置项 + +| 字段 | 说明 | 是否必填 | 默认值 | 示例 | +|:---------------:|:----------------------------------------------------------------------:|:----:|:-------------------------------------------------------------:|:--:| +| 短信服务商 | 短信服务商,支持阿里云和腾讯云 | 是 | 无 | 无 | +| AccessKeyId | AccessKeyId | 是 | 无 | 无 | +| AccessKeySecret | AccessKeySecret | 是 | 无 | 无 | +| 短信签名 | 短信签名,阿里云可以使用默认的签名,腾讯云需要自行申请 | 是 | 无 | 无 | +| 短信模版ID | 短信模版ID,自行申请 | 是 | 无 | 无 | +| 权重 | 告警权重 | 是 | 1 | 无 | +| 重试间隔时间 | 重试间隔时间,单位秒 | 是 | 5 | 无 | +| 最大重试次数 | 最大重试次数 | 是 | 5 | 无 | +| 请求地址 | 请求地址
阿里云使用:dysmsapi.aliyuncs.com
腾讯云使用sms.tencentcloudapi.com | 是 | 阿里云使用:dysmsapi.aliyuncs.com
腾讯云使用sms.tencentcloudapi.com | 无 | +| 地域信息 | 地域信息,以实际情况选择 | 是 | 无 | 无 | +| 手机号码 | 手机号码 | 是 | 无 | 无 | + +#### 阿里云 + +> 同 公共配置项 + +#### 腾讯云 + +> 仅列出差异项 + +| 字段 | 说明 | 是否必填 | 默认值 | 示例 | +|:--------:|:--------:|:----:|:---:|:--:| +| SdkAppId | SdkAppId | 是 | 无 | 无 | +| 请求超时时间 | 请求超时时间 | 是 | 无 | 无 | + +**说明:** 短信服务商目前支持阿里云和腾讯云,短信模版ID需要自行在短信服务商申请,部分差异字段自行查找相关文档及其值 + +[短信开发文档](https://sms4j.com/doc3/) + +### Http + +| 字段 | 说明 | 是否必填 | 默认值 | 示例 | +|:----:|:-------------------------------------------------------------------------------------------------:|:----:|:---:|:--:| +| 请求方式 | 请求方式,支持POST | 是 | 无 | 无 | +| 请求地址 | 请求地址 | 是 | 无 | 无 | +| 请求头 | 请求头 , 以列表形式填写 | 是 | 无 | 无 | +| 内容字段 | 在http请求中,请求体(body)内被替换为`告警消息`的字段,如果涉及多层嵌套字段,请使用json path表达式,例如 text.markdown.content | 是 | 无 | 无 | +| 标题字段 | 在http请求中,请求体(body)内被替换为`标题内容`的字段,如果涉及多层嵌套字段,请使用json path表达式,例如 markdown.title,如果不填写,则标题默认拼接在内容字段中 | 是 | 无 | 无 | +| 请求体 | 支持json格式 | 是 | 无 | 无 | + diff --git a/docs/versioned_docs/version-1.0/user_guide/register_center/alert/alert_overview.md b/docs/versioned_docs/version-1.0/user_guide/register_center/alert/alert_overview.md new file mode 100644 index 0000000000..2884940500 --- /dev/null +++ b/docs/versioned_docs/version-1.0/user_guide/register_center/alert/alert_overview.md @@ -0,0 +1,36 @@ +--- +position: 1 +sidebar_position: 1 +id: alert_overview +title: 告警功能概览 +--- + +:::info 介绍 + +Dinky的告警功能,可以通过配置告警实例,告警组,告警模版,告警策略,来实现对 Flink 任务的监控告警 + +::: +## 告警实例 + +> 用于配置告警的具体实例,如钉钉,企业微信,飞书,邮箱,短信,Http等 ,一个告警实例可以被多个告警组使用 + +详情请参考 [告警实例](alert_instance) + +## 告警组 + +> 用于配置告警的组,一个告警组可以包含多个告警实例 + +详情请参考 [告警组](alert_group) + +## 告警模版 + +> 用于配置告警的模版,一个告警模版可以被多个告警策略使用 + +详情请参考 [告警模版](alert_template) + + +## 告警策略 + +> 用于配置告警的策略,可配置多种告警策略,已经内置了部分告警策略,也可自行创建自定义告警策略 + +详情请参考 [告警策略](./alert_strategy) \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0/user_guide/register_center/alert/alert_strategy.md b/docs/versioned_docs/version-1.0/user_guide/register_center/alert/alert_strategy.md new file mode 100644 index 0000000000..b14ec4cad7 --- /dev/null +++ b/docs/versioned_docs/version-1.0/user_guide/register_center/alert/alert_strategy.md @@ -0,0 +1,50 @@ +--- +position: 4 +id: alert_strategy +sidebar_position: 4 +title: 告警策略 +--- + +:::info +告警策略是指在满足告警策略的前提下,告警模板的触发条件。 + +默认情况下,系统内置了一些告警策略,需要注意的是,内置的告警策略不可删除,可以修改告警模版,但是规则不可修改 + +如果想要使用自定义的告警策略,可以在告警策略页面进行创建,并且可以删除自定义的告警策略 +::: + +## 内置告警策略列表 + +![alert_strategy](http://www.aiwenmo.com/dinky/docs/test/alert_strategy.png) + +### 参数解读 + +| 参数 | 说明 | 默认值 | +|-------|--------------------------------------------------------|-----| +| 名称 | 告警策略名称 ,需要保证唯一性 | 无 | +| 触发条件 | 1. 任意规则: 任意规则满足触发条件,触发告警
2. 所有规则: 所有规则全部满足才会触发告警 | 无 | +| 触发规则 | 详见下表[触发规则](#触发规则) | 无 | + +### 触发规则 + +| 规则名称 | 说明 | 可选规则 | 值类型 | 示例值 | +|---------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------|--------------|----------------------------------| +| 作业 ID | 指 Flink 作业的 ID | = | 字符串 | 495c4e271dc64a4b7e78b8b1eb8d75f5 | +| 运行时间 | Flink 作业运行时间,即耗时 | >,<,=,<=,>=,!= ,= | 数值(单位:毫秒) | 1000 | +| 作业状态 | Flink 作业状态,可对如下状态值判断:
FINISHED
RUNNING
FAILED
CANCELED
INITIALIZING
RESTARTING
CREATED
FAILING
SUSPENDED
CANCELLING
RECONNECTING
UNKNOWN | = | 字符串 | 'FINISHED' | +| 执行模式 | local
yarn-session
yarn-per-job
yarn-application
kubernetes-session
kubernetes-per-job
kubernetes-application | = | 字符串 | yarn-session | | 无 | +| 批模式 | 可选值:
True,False | = | 下拉框(值类型:字符串) | True | 无 | +| CheckPoint 时间 | 自定义时间 | >,<,=,<=,>=,!= ,= | 数值(单位:毫秒) | 1000 | +| CheckPoint 失败 | 可选值:
True,False | = | 下拉框(值类型:字符串) | True | +| 任务产生异常 | 可选值:
True,False | = | 下拉框(值类型:字符串) | True | + +## 自定义告警策略 + +### 创建自定义的告警策略 + +点击创建告警策略按钮,弹出创建告警策略的弹窗 + +![alert_rules](http://pic.dinky.org.cn/dinky/docs/zh-CN/user_guide/system_setting/alert_template/alert_rules.png) + +注意: 如需添加自定义告警模版, 请点击 **告警模版下拉框**中的**新建告警模版** 按钮,跳转至告警模版页面, 或者直接在 * +*[告警模版](./alert_template)** 页面创建告警模版 diff --git a/docs/versioned_docs/version-1.0/user_guide/register_center/alert/alert_template.md b/docs/versioned_docs/version-1.0/user_guide/register_center/alert/alert_template.md new file mode 100644 index 0000000000..9578a2ec09 --- /dev/null +++ b/docs/versioned_docs/version-1.0/user_guide/register_center/alert/alert_template.md @@ -0,0 +1,56 @@ +--- +position: 4 +sidebar_position: 4 +id: alert_template +title: 告警模版 +--- + +:::warning 触发告警前提条件 + +1. 只适用于 `FlinkSQL,FlinkJar` 任务 +2. 作业为`已发布`状态 +3. 满足告警策略,且该告警策略关联了告警模板 +::: + +## 告警模版列表 + +> 自 v1.0.0 版本开始,扩展了告警模版的功能,支持自定义告警模版,并支持模版参数化 + +eg: + +```markdown +- **Job Name :** ${jobName} +- **Job Status :** ${jobStatus} +- **Alert Time :** ${alertTime} +- **Start Time :** ${jobStartTime} +- **End Time :** ${jobEndTime} +- **${errorMsg}** + [Go toTask Web](http://${taskUrl}) + +``` + +目前支持的模版参数有: + +| 参数名称 | 说明 | 示例 | +|:------------------------|:-------------------------|:------------------------------------------------| +| alertTime | 告警触发时间 | 2023-01-02 00:00:00 | +| jobStartTime | 作业开始时间 | 2023-01-01 00:00:00 | +| jobEndTime | 作业结束时间 | 2023-01-02 00:00:00 | +| duration | 作业持续时间/耗时 | 45s | +| jobName | 作业名称 | demo | +| jobId | 作业ID | fe00e413b7bd3888e8906f2a42e2124f | +| jobStatus | 作业状态 | FAILED | +| taskId | 任务ID | 1 | +| jobInstanceId | 作业实例ID | 2 | +| taskUrl | 任务详情地址 | http://localhost:8000/#/devops/job-detail?id=29 | +| batchModel | 作业类型,true 为批处理,false 为流式 | 无 | +| clusterName | 在Dinky内注册的 Flink实例/集群配置 | 无 | +| clusterType | 集群类型 | 无 | +| clusterHost | 集群地址 | 无 | +| errorMsg | 错误信息 | 无 | +| checkpointCostTime | checkpoint耗时 | 无 | +| checkpointFailedCount | checkpoint失败次数 | 无 | +| checkpointCompleteCount | checkpoint完成次数 | 无 | +| isCheckpointFailed | 是否checkpoint失败 | 无 | +| isException | 是否异常 | 无 | + diff --git a/docs/versioned_docs/version-1.0/user_guide/register_center/cluster_manage.md b/docs/versioned_docs/version-1.0/user_guide/register_center/cluster_manage.md new file mode 100644 index 0000000000..b6032c54f5 --- /dev/null +++ b/docs/versioned_docs/version-1.0/user_guide/register_center/cluster_manage.md @@ -0,0 +1,165 @@ +--- +position: 1 +sidebar_position: 1 +id: cluster_manage +title: 集群 +--- + +# 集群管理 + +:::tip 提示 + +在 Dinky 中,将 Flink 运行模式拆分为了 `Flink实例` 和 `集群配置` 两个概念。请按需选择使用。 + +如果您不清楚 Flink +各个运行模式的区别,请参考 [Flink 官方文档](https://nightlies.apache.org/flink/flink-docs-release-1.18/docs/deployment/resource-providers/standalone/overview/) + +::: + +## Flink实例 + +> Flink实例是指已经启动的 Flink 集群 + +> Flink实例仅可以注册模式为 Local, Standalone, Yarn Session, Kubernetes Session 的 Flink 实例 + + +:::warning 注意 + +1. 在 Flink 实例中,仅可以注册模式为 Local, Standalone, Yarn Session, Kubernetes Session 的 Flink 实例 +2. 在 Flink 实例中,区分了自动注册和手动注册两种方式,手动启动的 Flink 实例需要手动注册, 由`集群配置/application模式` + 任务启动后的 Flink 实例会自动注册 +3. 自动注册的集群无需关心注册过多的情况, 系统会定时清理过期的 自动注册的 Flink 实例,手动注册的无影响 +4. 手动注册的集群需要手动管理 Flink 实例, 如需删除 Flink 实例,请鼠标悬浮某一 Flink 实例,点击删除按钮即可删除 Flink 实例 +5. 提供手动进行心跳检测 +6. 所有Flink 实例删除前会进行引用检测,如果有引用,则无法删除(此为避免实际运行中的任务关联到该Flink + 实例,从而导致一系列问题) +7. 手动注册的集群可以直接删除(前提是未被使用),如果自动注册的集群如果状态为`健康`需要先停止 Flink 实例,然后再删除 Flink + 实例. + +如需查看 自动注册 和 手动注册 下的 Flink 实例,请点击切换按钮进行查看 +::: + +### 手动注册 + +![cluster_instance_m_list](http://pic.dinky.org.cn/dinky/docs/test/cluster_instance_m_list.png) + +### 自动注册 + +![cluster_instance_a_list](http://pic.dinky.org.cn/dinky/docs/test/cluster_instance_a_list.png) + +### 参数解读 + +| 参数 | 说明 | 是否必填 | 默认值 | 示例值 | +|------------------|----------------------------------------------------------------------------------|:----:|:-----:|:-------------:| +| 集群名称 | 集群名称, 用于区分不同集群 | 是 | 无 | flink-session | +| 集群别名 | 集群别名, 用于区分不同集群, 如不填默认同集群名称 | 否 | 同集群名称 | flink-session | +| 集群类型 | 集群类型, 目前支持 Local, Standalone, Yarn Session, Kubernetes Session | 是 | 无 | Standalone | +| JobManager 高可用地址 | 添加 Flink 集群的 JobManager 的 RestApi 地址。当 HA 模式时,地址间用英文逗号分隔,例如:192.168.123.101:8081 | 是 | 无 | +| 备注 | 备注, 用于备注集群信息 | 否 | 无 | flink-session | + +## 集群配置 + +> 集群配置是指 预先定义的 Flink 集群配置, 用于提交 Flink 作业时,会自动启动 Flink 集群 + +> 集群配置仅可以注册模式为 Yarn Per-Job, Yarn Application, Kubernetes Application 的 Flink 实例 + +:::warning 注意 + +1. 在集群配置中,仅可以注册模式为 Yarn(可用于Yarn Per-Job, Yarn Application),Kubernetes Native,Kubernetes Operator的 + Flink 配置 +2. 在此模式中支持可以以配置方式 启动一个 YarnSession/KubernetesSession 的 Flink实例, 启动成功后,会自动注册到 `Flink实例` + 中 +3. 支持手动心跳检测 +4. 所有集群配置删除前会进行引用检测,如果有引用,则无法删除(此为避免实际运行中的任务关联到该Flink 配置,从而导致一系列问题) + +注意: 在集群配置中,如果使用Yarn 模式,需要有 Hadoop 与 Flink 集成的 jar 包,如果使用Kubernetes +模式,需要有Flink运行时的jar包,否则会导致启动失败,如遇到依赖加载问题,请查看详细日志进行排查 +::: + +### 集群配置列表 + +![cluster_config_list](http://pic.dinky.org.cn/dinky/docs/test/cluster_config_list.png) + +### 参数解读 + +- 基本配置-公共配置 + +| 参数 | 说明 | 是否必填 | 默认值 | 示例值 | +|--------|--------------------------------------------------------|:----:|:---:|:----------:| +| 类型 | 集群类型, 目前支持 Yarn, Kubernetes Native,Kubernetes Operator | 是 | 无 | Yarn | +| 集群配置名称 | 集群配置名称, 用于区分不同集群配置 | 是 | 无 | flink-yarn | +| 备注 | 描述信息 | 否 | 无 | | +| 是否启用 | 标志是否启用该集群配置,如果不启用,则该集群配置不会在数据开发集群列表下拉框中显示 | 是 | 无 | | + +- 提交 FlinkSQL 配置项 (Application 模式必填)-公共配置 + +| 参数 | 说明 | 是否必填 | 默认值 | 示例值 | +|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:----:|:---:|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:| +| Jar 文件路径 | 指定 Jar 文件路径,如果该集群配置用于提交 Application 模式任务时 则必填
需要包含以下文件:dinky-app-{version}-jar-with-dependencies.jar
Yarn 模式下此参数可以设置为: hdfs:///dinky/dinky-app-1.17-with-dependencies.jar 或者 rs:/dinky/dinky-app-1.17-with-dependencies.jar
如果设置为 rs:/ 协议,则需要将该jar包上传到 Dinky 的资源中心中,然后填写该路径。
K8s 模式下仅支持 local:// 协议 | 是 | 无 | hdfs:///dinky/dinky-app-1.16-1.0.0-SNAPSHOT-jar-with-dependencies.jar
请注意: 如果使用 Kubernetes 模式,路径需要指定为: local:///dinky/dinky-app-1.16-1.0.0-SNAPSHOT-jar-with-dependencies.jar | + +- Flink 预设配置(高优先级)-公共配置 + +| 参数 | 说明 | 是否必填 | 默认值 | 示例值 | +|-----------------|--------------------|:----:|:---:|:------------------------:| +| JobManager 内存 | JobManager 内存大小! | 否 | 无 | 1g | +| TaskManager 内存 | TaskManager 内存大小! | 否 | 无 | 1g | +| TaskManager 堆内存 | TaskManager 堆内存大小! | 否 | 无 | 1g | +| 插槽数 | 插槽数量 | 否 | 无 | 2 | +| 保存点路径 | 对应SavePoint目录 | 否 | 无 | hdfs:///flink/savepoint | +| 检查点路径 | 对应CheckPoint目录 | 否 | 无 | hdfs:///flink/checkpoint | + +--- + +#### Yarn 模式 + +- Hadoop 配置 + +| 参数 | 说明 | 是否必填 | 默认值 | 示例值 | +|--------------------|---------------------------------------------------------------------|:----:|:---:|:---:| +| Hadoop 配置文件路径 | 指定配置文件路径(末尾无/),需要包含以下文件:core-site.xml,hdfs-site.xml,yarn-site.xml ! | 是 | 无 | | +| Hadoop 自定义配置(高优先级) | Hadoop 的其他参数配置 | 否 | 无 | | + +- Flink 配置 + +| 参数 | 说明 | 是否必填 | 默认值 | 示例值 | +|-------------------|-------------------------------------------|:----:|:---:|:-----------------:| +| Flink Lib 路径 | 指定 lib 的 hdfs 路径(末尾无/),需要包含 Flink 运行时的依赖! | 是 | 无 | hdfs:///flink/lib | +| Flink 配置文件路径 | 仅指定到文件夹,dinky会自行读取文件夹下的配置文件,k8s模式下此参数可选填 | 是 | 无 | /opt/flink/conf | +| Flink 自定义配置(高优先级) | Flink 的其他参数配置 | 否 | 无 | | + +--- + +#### Kubernetes Native 模式 + +- Kubernetes 配置 + +| 参数 | 说明 | 是否必填 | 默认值 | 示例值 | +|----------------------|------------------------------------------|:----:|:---:|:---------------:| +| 暴露端口类型 | 指定暴露端口类型, 目前支持 NodePort, ClusterIP | 是 | 无 | NodePort | +| Kubernetes 命名空间 | 指定 Kubernetes 命名空间 | 是 | 无 | flink | +| Kubernetes 提交账号 | 指定 Kubernetes 提交账号 | 是 | 无 | flink | +| Flink 镜像地址 | 指定 Flink 镜像地址 | 是 | 无 | flink:1.16.0 | +| JobManager CPU 配置 | 指定 JobManager CPU 配置 | 否 | 无 | 1000m | +| TaskManager CPU 配置 | 指定 TaskManager CPU 配置 | 否 | 无 | 1000m | +| Flink 配置文件路径 | 仅指定到文件夹,dinky会自行读取文件夹下的配置文件,k8s模式下此参数可选填 | 否 | 无 | /opt/flink/conf | +| 自定义配置 | Flink 的其他参数配置 | 否 | 无 | | +| K8s KubeConfig | 指定 K8s KubeConfig,支持从本地上传并加载 | 否 | 无 | | +| Default Pod Template | 指定 Default Pod Template,支持从本地上传并加载 | 否 | 无 | | +| JM Pod Template | 指定 JobManager Pod Template,支持从本地上传并加载 | 否 | 无 | | +| TM Pod Template | 指定 TaskManager Pod Template,支持从本地上传并加载 | 否 | 无 | | + +--- + +#### Kubernetes Operator 模式 + +- Kubernetes 配置 + +> 注意: 与 Kubernetes Native 模式不同的是, Kubernetes Operator 模式下, 需要指定 Flink 版本而不需要指定暴露端口类型, +> 其他配置项都一致,以下仅列出不同的配置项 + +| 参数 | 说明 | 是否必填 | 默认值 | 示例值 | +|----------|--------------------------------------|:----:|:---:|:------:| +| Flink 版本 | 指定 Flink 版本,支持 Flink1.15 - Flink1.18 | 是 | 无 | 1.16.0 | + +--- + diff --git a/docs/versioned_docs/version-1.0/user_guide/register_center/datasource_manage.md b/docs/versioned_docs/version-1.0/user_guide/register_center/datasource_manage.md new file mode 100644 index 0000000000..972f0f894a --- /dev/null +++ b/docs/versioned_docs/version-1.0/user_guide/register_center/datasource_manage.md @@ -0,0 +1,133 @@ +--- +position: 2 +sidebar_position: 2 +id: datasource_manage +title: 数据源 + +--- + + +:::tip 简介 + +数据源管理是 Dinky 管理系统中重要的功能之一,主要用于管理数据源,包括数据源的创建、编辑、删除、查看元数据、可支持自动构建 +FlinkDDL 等。 + +目前支持的数据源类型包括:MySQL、Oracle、PostgreSQL、SQLServer、Phoenix、ClickHouse、Doris、StartRocks、Presto、Hive。 + +注意: 删除前会进行引用检查,如果有作业引用该数据源,将无法删除。 +::: + +## 数据源管理 + +![database_manager_list](http://pic.dinky.org.cn/dinky/docs/test/datasource00.png) + +## 创建数据源 + +当用户使用 Dinky 做为数据开发工具时,用户首先需要进入 **注册中心 > 数据源管理**,点击 **新建** 即可。 + +![create_database_jdbc](http://pic.dinky.org.cn/dinky/docs/test/datasource0.png) + +![create_database](http://pic.dinky.org.cn/dinky/docs/test/datasource1.png) + +### 参数解读 + +| 参数名称 | 参数说明 | 是否必填 | 默认值 | +|------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------|-------| +| 名称 | 数据源名称,自定义,建议使用英文,不超过 20 个字符,建议使用全小写. | 是 | 无 | +| 分组类型 | 数据源分组类型,包括来源、数仓、应用、备份、其他 | 否 | 无 | +| 数据源类型 | 数据源类型,目前支持以下多种数据源:
MySQL、Oracle、PostgreSQL、SQLServer、Phoenix、ClickHouse、Doris、StartRocks
Presto、Hive。 | 是 | MySQL | +| url | 数据库连接地址,如 jdbc:mysql://127.0.0.1:3306/dinky,点击输入框即可触发常用的数据库URL示例,选中后自动填充,根据实际情况填写 | 是 | 无 | +| 用户名 | 连接数据库的用户名 | 是 | 无 | +| 密码 | 连接数据库的密码 | 是 | 无 | +| 备注 | 自定义 | 否 | 无 | +| Flink 连接配置 | 避免私密信息泄露,同时作为全局变量复用连接配置:在 FlinkSQL 中可使用 `${数据源名称}` 来加载连接配置,如 `${MySQL}`。说明:名称指的是英文唯一标识,即如图所示的名称。注意需要开启全局变量。请参考[全局变量](./global_var) | 否 | 无 | +| Flink 连接模板 | Flink 连接模板作用是为生成 FlinkSQL DDL 而扩展的功能。其中`#{schemaName}`动态获取数据库,`#{tableName}` 动态获取表名称。其他flink相关参数请参考[Flink 官网](https://nightlies.apache.org/flink/flink-docs-master/docs/connectors/table/overview/) | 否 | 无 | + +--- +配置完成之后点击测试链接: +![create_database_jdbc_mysql](http://pic.dinky.org.cn/dinky/docs/test/datasource3.png) + +## Flink 连接配置 && Flink 连接模板 Demo + +以上图创建的数据源为例。 + +**FLink链接配置:**将一些固定参数如数据库的地址、端口、账号、密码等填在此处 +开启全局变量,使用** ${数据源名称} ** 代替数据源连接的隐私信息,*使用方法*如下: +![create_database_jdbc_mysql](http://pic.dinky.org.cn/dinky/docs/test/datasource6.png) + +**Flink连接模板:**作为预设信息,在生成flinksql时无需手动填写flink的相关参数,自动填充。 +*未配置*Flink连接模板,生成的flinksql的with部分为空: +![create_database_jdbc_mysql](http://pic.dinky.org.cn/dinky/docs/test/datasource55.png) + +### 两种配置方式: + +#### 第一种方式: + +![create_database_jdbc_mysql](http://pic.dinky.org.cn/dinky/docs/test/datasource4.png) + +```sql +-- Flink 连接配置: (可以放入公共参数,及敏感信息参数) + 'hostname' = 'localhost' + ,'port' = '3306' + ,'username' = 'root' + ,'password' = '123456' + ,'server-time-zone' = 'UTC' + +-- Flink 连接模板: + 'connector' = 'mysql-cdc' + ,'hostname' = 'localhost' + ,'port' = '3306' + ,'username' = 'root' + ,'password' = '123456' + ,'server-time-zone' = 'UTC' + ,'scan.incremental.snapshot.enabled' = 'true' + ,'debezium.snapshot.mode'='latest-offset' + ,'database-name' = '#{schemaName}' + ,'table-name' = '#{tableName}' +``` + +##### 生成 FlinkSQL DDL 效果: + +![create_database_jdbc_mysql](http://pic.dinky.org.cn/dinky/docs/test/datasource5.png) + +#### 第二种方式: + +![create_database_jdbc_mysql](http://pic.dinky.org.cn/dinky/docs/test/datasource44.png) + +```sql +-- Flink 连接配置,同第一种方式的连接配置: + 'hostname' = 'localhost' + ,'port' = '3306' + ,'username' = 'root' + ,'password' = '123456' + ,'server-time-zone' = 'UTC' + +-- Flink 连接模板: 注意引用变量的前后逗号,使用此方式作业右侧必须开启全局变量 + 'connector' = 'mysql-cdc' + ,${MySQL} + ,'scan.incremental.snapshot.enabled' = 'true' + ,'debezium.snapshot.mode'='latest-offset' + ,'database-name' = '#{schemaName}' + ,'table-name' = '#{tableName}' + +``` + +##### 生成 FlinkSQL DDL 效果: + +![create_database_jdbc_mysql](http://pic.dinky.org.cn/dinky/docs/test/datasource555.png) +:::tip 说明 +在 Dinky 1.0.0 之前的版本,动态获取库名和表名的变量格式为'${schemaName}' 和 '${tableName}',其主要场景应用于 FlinkSQL DDL 中的 with 配置中和整库同步的场景。 + +在 Dinky 1.0.0 之后,此处为避免与全局变量冲突,动态获取表名的变量格式为'#{schemaName}' 和 '#{tableName}',此不兼容变更对 FlinkSQL DDL 中的 with 配置无影响, 但是对于整库同步的场景需要注意修改为新的变量格式'#{schemaName}' 和 '#{tableName}' ,与此同时,在整库同步的场景下,也可以支持使用全局变量了. +::: + +## 获取数据源元数据信息 + +在数据源管理页面,点击某一数据源的 Logo ,即可进入该数据源的详情页面 + +![datssource_detail](http://pic.dinky.org.cn/dinky/docs/zh-CN/user_guide/register_center/datasource/datssource_detail.png) + +可以以表格式查询某一表数据 + +![datasource_search](http://pic.dinky.org.cn/dinky/docs/zh-CN/user_guide/register_center/datasource/datasource_search.png) + diff --git a/docs/versioned_docs/version-1.0/user_guide/register_center/document_manager.md b/docs/versioned_docs/version-1.0/user_guide/register_center/document_manager.md new file mode 100644 index 0000000000..858a922b9d --- /dev/null +++ b/docs/versioned_docs/version-1.0/user_guide/register_center/document_manager.md @@ -0,0 +1,42 @@ +--- +position: 4 +sidebar_position: 4 +id: document_manager +title: 文档管理 +--- + +:::tip 简介 +文档管理是 Dinky 系统中重要的功能之一,主要用于数据开发编辑器内的函数快捷提示,自动补全,以及常用 SQL 模版语句的快捷输入等功能. + +Dinky 管理系统中的文档管理功能,可以对文档进行新增、编辑、删除等操作。新增/更新完成后,即可在数据开发中使用. + +在系统初始化时,默认插入了一些常用的函数文档, 以供参考. +::: + +## 文档管理列表 + +![document_manager_list](http://pic.dinky.org.cn/dinky/docs/zh-CN/user_guide/register_center/document_manager/document_manager_list.png) + +## 查看文档描述 + +![doc_desc](http://pic.dinky.org.cn/dinky/docs/zh-CN/user_guide/register_center/document_manager/doc_desc.png) + +## 创建文档 + +![doc_create](http://pic.dinky.org.cn/dinky/docs/zh-CN/user_guide/register_center/document_manager/doc_create.png) + +## 参数解读 + +| 参数名称 | 参数说明 | 是否必填 | 默认值 | +|:-----|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-----|:--------| +| 名称 | 文档名称,用于触发快捷提示 | 是 | 无 | +| 文档类型 | 文档类型,主要用于管理文档分类,从而在编辑器内实现不同的提示/补全效果 ,可选值:
代码片段/模版
Flink 参数
函数/UDF
其他 | 是 | 代码片段/模板 | +| 注册类型 | 注册类型, 该类型决定了在编辑器内的提示/补全效果渲染各种类型 | 是 | 无 | +| 子类型 | 定义函数子类型/语言 | 是 | 无 | +| 描述 | 该文档描述 | 否 | 无 | +| 填充值 | 填充值 ,由 名称触发快捷提示时,回车后将自动补全该值
如: _`SELECT * FROM table WHERE name = ${1:}`_ ;
如果希望在函数 _`LTRIM(parms)`_ 中输入参数 则此处填充值语法为: _`LTRIM(${1:})`_ 此时的1代表第一个光标 ; 如需多个数字+1即可 tab键切换光标,如不需要参数则直接输入期望填充值即可 | 是 | 无 | +| 版本 | 文档版本
Flink1.14
Flink1.15
Flink1.16
Flink1.17
Flink1.18
All Version | 是 | 无 | +| 是否启用 | 是否启用 , 只有启用的文档才会在数据开发中使用触发快捷提示 | 是 | 不启用 | + +**填充值提示效果:** +![ducument_fill_style](http://pic.dinky.org.cn/dinky/docs/zh-CN/user_guide/register_center/document/ducument_fill_style.png) \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0/user_guide/register_center/git_project.md b/docs/versioned_docs/version-1.0/user_guide/register_center/git_project.md new file mode 100644 index 0000000000..ba4d3f441a --- /dev/null +++ b/docs/versioned_docs/version-1.0/user_guide/register_center/git_project.md @@ -0,0 +1,38 @@ +--- +position: 6 +sidebar_position: 6 +id: git_project +title: Git 项目 +--- + +:::info 简介 +Dinky 在 v1.0.0 版本开始,提供了 Git 项目管理的功能,可以在 Dinky 中管理 Git 项目,方便的进行項目编译打包操作,并提供了全构建流程的实时化日志查看功能. +::: + +## 支持功能列表 +1. 可以托管 Jar任务的项目, 并将打包产物自动推送至 [`资源中心`](resource) 以便数据开发中使用 jar 任务提交方式 +2. 可以托管 UDF 项目, 并将打包产物自动推送至 [`资源中心`](resource) 以便数据开发中使用该 UDF +3. 支持自动解析 UDF 项目打包后的 UDF function +4. 支持查看 clone 后的代码 +5. 支持查看全流程构建日志 +6. 支持配置 GitHub 项目/GitLab 项目 +7. 支持配置 Maven 私服仓库,配置详见: [Maven 配置](../system_setting/global_settings/maven_setting) +8. 支持 Python/Java 项目 +9. 支持 https/ssh 协议 clone 方式 + +## 列表 +![git_project](http://pic.dinky.org.cn/dinky/docs/test/git_project_list.png) + +## 构建 + +![git_build](http://pic.dinky.org.cn/dinky/docs/test/git.png) + + +**注意:** 构建完成后,会将构建产物推送至 [`资源中心`](resource_center) ,进行集中管理 + + +## 查看代码 + +![git_show_code](http://pic.dinky.org.cn/dinky/docs/test/git_show_code.png) + +**注意:** 目前仅支持查看 clone 后的代码,不支持编辑代码 \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0/user_guide/register_center/global_var.md b/docs/versioned_docs/version-1.0/user_guide/register_center/global_var.md new file mode 100644 index 0000000000..1d8399d310 --- /dev/null +++ b/docs/versioned_docs/version-1.0/user_guide/register_center/global_var.md @@ -0,0 +1,173 @@ +--- +position: 5 +sidebar_position: 5 +id: global_var +title: 全局变量 +--- + +## 背景及介绍 +:::info 简介 + +为了方便/统一/可复用/安全的使用变量,Dinky 提供了全局变量的功能 + +全局变量可以在 `数据开发` 中使用 , 并且支持关键词触发提示, 在开发过程中, 输入全局变量名称 ,即可触发关键词提示, 选择后即可自动补全 + +另外: Dinky 提供了多种全局变量使用/声明方式, 请根据自己的需求选择 ,具体请看下面的介绍 + +::: + + + +:::warning 注意 + +如需使用全局变量相关功能,需要在`数据开发`的`作业配置`中开启全局变量。 + +::: + + + +## 方式 1: 通过 `注册中心`->`全局变量` 定义 + +> 可以在 `注册中心` -> `全局变量` 中定义/查看/修改/删除全局变量 + +```sql +# 比如定义了一个 名称为 `kafkaTopicName` 的变量, 值为 test_topic +# 可以在`数据开发`编辑器内使用, 使用方式为: ${kafkaTopicName} +-- eg: +select ${kafkaTopicName}; + + +# 需要注意的是并不局限于在查询语句中, 也可在 flinksql ddl 定义的 with 配置中使用 +-- eg: +create table tast_table ( + id int, + name string +) with ( + 'connector'='kafka', + 'topic'='${kafkaTopicName}' +# etc ... +); + +``` +基于此方式, 可以实现由 Dinky 平台托管一些常用的`连接/敏感信息` | `常用/通用变量` ,etc... + + +## 方式 2: 通过 `注册中心`->`数据源` 注册全局变量 + +在 Dinky 中提供了数据源管理的功能, 在`注册数据源`的同时,如果填写了 `Flink 连接配置` ,会自动注册为全局变量,使用`注册数据源的名称`作为`全局变量名称` + +假设注册了一个名称为 `dockermysql` 的数据源 并将 `Flink 连接配置` 的值设置为如下: +```sql +'hostname' = '192.168.1.110', +'port' = '3306', +'username' = 'root', +'password' = '123wsd!@d', +``` + +在 `数据开发` 中使用 `dockermysql` 变量 +```sql + +create table tast_table ( + id int, + name string, +# ... +) with ( + 'connector'='mysql-cdc', + ${dockermysql} +# etc ... +); +``` +以上案例即在 `数据开发` 中使用 `dockermysql` 变量,此种方式在数据源侧声明了链接信息,用户可以直接使用,且对于作业维度而言,保证了连接信息的安全性 + + + + +## 方式 3: 通过 `数据开发` 中定义全局变量 + +:::warning 注意 +此种方式只能在 `数据开发` 中定义全局变量,如果需要多作业复用,请自行创建作业类型为 `FlinkSQLEnv` 的作业,将变量写入并保存,然后在 `FlinkSQL` 作业右侧的作业配置中关联该 FlinkSQLEnv +::: +```sql map=sql +# 格式 +key:= value; + +# 示例 +var1:=student; +select * from ${var1}; + +# 查看所有变量 (该查询会包含所有声明的变量,包括注册中心中定义的全局变量) +SHOW FRAGMENTS; +# 查看单个变量 +SHOW FRAGMENT var1; +``` + +## 方式 4: 表达式变量 + +> 由于部分场景需要使用到类似于 `当前时间戳` `当前日期` 等变量, 为了方便使用, Dinky 提供了表达式变量的功能. + + +:::warning 注意 + +在 `1.0.0` 之前, Dinky 提供了类似 `${_CURRENT_DATE_}` `${_CURRENT_TIMESTAMP_}` 的变量,但是此种方式比较受限,自由度不高,基于以上痛点 Dinky-1.0.0 重构了此功能,改为提供`表达式变量`功能,并且不与之前的 `${_CURRENT_DATE_}` `${_CURRENT_TIMESTAMP_}` 变量兼容, 请知悉! + +如您升级到 `1.0.0` 及以上版本, 请修改引用 `${_CURRENT_DATE_}` `${_CURRENT_TIMESTAMP_}` 变量的相关作业 + +新的表达式变量无需声明 ,直接使用即可, +请注意: 表达式变量调用时请使用小驼峰命名法 +::: + +### 日期时间类表达式变量 + +> 日期相关: `dateUtil` 为实例名用来调用方法`(必须固定)`,使用 [DateUtil](https://doc.hutool.cn/pages/DateUtil/)工具类实现,且支持此工具类的所有方法调用 + + +```sql +-- 获取当前秒 +select '${dateUtil.currentSeconds()}'; + +# 获取日期 减去 10 天 +select '${dateUtil.offsetDay(date.date(), -10)}'; + +# 获取当前日期 标准格式 yyyy-MM-dd HH:mm:ss +select '${dateUtil.now()}'; + +# etc ..... + +``` + + + + +### 随机串相关表达式变量 + +> `randomUtil` 为实例名用来调用方法`(必须固定)`, 使用 [RandomUtil](https://doc.hutool.cn/pages/RandomUtil/)工具类实现,且支持此工具类的所有方法调用 + +```sql +# 产生一个[10, 100)的随机数 +select '${randomUtil.randomInt(10, 100)}'; + +# 随机字符串(只包含数字和字符) +select '${randomUtil.randomString()}'; + +# 获得一个只包含数字的字符串 +select '${randomUtil.randomNumbers()}'; + +``` + +### 唯一 ID 相关表达式变量 + +> idUtil 为实例名用来调用方法`(必须固定)` , 使用 [IdUtil](https://doc.hutool.cn/pages/IdUtil/) 工具类实现 + +```sql +# 生成的UUID是带-的字符串,类似于:a5c8a5e8-df2b-4706-bea4-08d0939410e3 +select '${idUtil.randomUUID()}'; + +# 生成的是不带-的字符串,类似于:b17f24ff026d40949c85a24f4f375d42 +select '${idUtil.simpleUUID()}'; +``` + +:::tip 扩展 + +如您需要扩展更多表达式变量, 请参考 [Dinky 表达式变量扩展](../../extend/function_expansion/global_var_ext) + +::: \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0/user_guide/register_center/resource.md b/docs/versioned_docs/version-1.0/user_guide/register_center/resource.md new file mode 100644 index 0000000000..8660e6a3a5 --- /dev/null +++ b/docs/versioned_docs/version-1.0/user_guide/register_center/resource.md @@ -0,0 +1,50 @@ +--- +position: 8 +sidebar_position: 8 +id: resource +title: 资源中心 +--- + +:::info 简介 +Dinky 在 v1.0.0 版本开始,提供了资源中心的功能,可以在 Dinky 中很方便的进行资源的管理,包括上传资源,删除资源(逻辑删除),预览资源等 + +需要注意的是,资源中心中的资源,并不是指 Dinky 服务的资源,而是指 Dinky 服务所管理的资源,比如上传的文件,或者是 Git 项目的产物等,都可以在资源中心中进行管理 + +在 Dinky v1.0.0 版本中,扩展了 rs 协议,可以通过 rs 协议访问资源中心中的资源,方便的进行资源的访问. +::: + + +![resource_overview](http://pic.dinky.org.cn/dinky/docs/zh-CN/user_guide/register_center/resource/resource_overview.png) + +## 支持功能 +1. 支持托管 Git 构建任务的产物,包含 Jar Zip 等 +2. 支持上传资源 +3. 支持预览部分文件类型内容,如: 配置文件,文本文件等 +4. 支持 rs 协议,不管原本的文件系统是什么,只要是由`资源中心`管理的,都可以通过 rs 协议访问 +5. 支持 Jar 任务提交时,通过 rs 协议访问资源中心中的 Jar 资源,并适用于 Flink 全模式任务的提交 + + + +:::warning 注意 + +1. 该功能依赖于资源配置, 请确保已经配置了文件系统,配置详见: [文件系统配置](../system_setting/global_settings/resource_setting) ,请在配置完成后,再使用该功能,否则会出现异常 +2. 请注意,虽然提供了删除功能,为了避免误操作,在 Dinky 中删除资源并不会删除文件系统中的文件,仅会删除 Dinky 的数据库中的记录, 如需彻底删除, 请自行手动删除文件系统中的文件 +3. 如果上传 同名文件,会覆盖原有文件,请谨慎操作 +4. 资源中心默认有一层逻辑根节点 Root, 该节点目录不可删除, 所有上传文件/新建目录,都归于该节点下, 如果使用 rs 协议访问, 请注意路径,不要带上 Root 节点 + +::: + + + +## 使用方式 + +> eg: 假设在 `配置中心` -> `Resource 配置` 中使用 `LOCAL` 协议 ,并设置了 `上传根路径`为 /tmp/dinky/resource +> 那么可以通过以下方式访问资源中心中的资源, 在使用过程中,可以直接忽视 `上传根路径` 的配置. + +```bash +# 假设基于以上配置, 在资源中心 Root 根目录下上传了一个 app.jar 文件,那么可以通过以下方式访问 +rs:/app.jar + +# 假设基于以上配置, 在资源中心 Root 根目录 新建了一个目录 test,并在 test 目录下上传了一个 app.jar 文件,那么可以通过以下方式访问 +rs:/test/app.jar +``` diff --git a/docs/versioned_docs/version-1.0/user_guide/register_center/udf.md b/docs/versioned_docs/version-1.0/user_guide/register_center/udf.md new file mode 100644 index 0000000000..6f0b9d543a --- /dev/null +++ b/docs/versioned_docs/version-1.0/user_guide/register_center/udf.md @@ -0,0 +1,35 @@ +--- +position: 7 +sidebar_position: 7 +id: udf +title: UDF +--- + +:::info 简介 +Dinky 在 v1.0.0 版本开始,提供了 UDF 管理的功能,可以在 Dinky 中管理 自定义的UDF,方便的进行作业所使用的UDF 管理。 +::: + + +## UDF 注册管理 + +> 在 Git 项目中管理的 UDF 项目经过构建后,会自动将产物推动至 [资源中心](./resource) 的 udf 节点下集中管理 + +在新增时 可以直接拉取 [资源中心](./resource) 中的 UDF 产物进行添加, 实现解析 UDF 具体的函数信息,并提供方可修改函数名功能 + +![udf_register_list](http://pic.dinky.org.cn/dinky/docs/test/udf_register_list.png) + +**注意:** 此方法没有实现自动注册给Flink 集群,后续实现在数据开发中自动解析补全UDF函数名称,并自动生成注册函数的 Flink 语句 + + + +## UDF 模板管理 + +> 可以在该功能中管理常用的 UDF 模板,方便的进行 UDF 函数的开发,避免重复的编写模板代码 + +:::warning 注意 +1. 删除模版时会进行引用检查,如果有作业引用该模版,将无法删除 +::: + +- 支持 scala/java/python 三种语言的模板管理 + +![udf_template_list](http://pic.dinky.org.cn/dinky/docs/test/udf_template_list.png) diff --git a/docs/versioned_docs/version-1.0/user_guide/studio/_category_.json b/docs/versioned_docs/version-1.0/user_guide/studio/_category_.json new file mode 100644 index 0000000000..0faec5ba02 --- /dev/null +++ b/docs/versioned_docs/version-1.0/user_guide/studio/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "studio", + "position": 1 +} diff --git a/docs/versioned_docs/version-1.0/user_guide/studio/catalog.md b/docs/versioned_docs/version-1.0/user_guide/studio/catalog.md new file mode 100644 index 0000000000..9ff51b3068 --- /dev/null +++ b/docs/versioned_docs/version-1.0/user_guide/studio/catalog.md @@ -0,0 +1,6 @@ +--- +sidebar_position: 5 +position: 5 +id: catalog +title: 内置Catalog功能 +--- diff --git a/docs/versioned_docs/version-1.0/user_guide/studio/execute_env_config.md b/docs/versioned_docs/version-1.0/user_guide/studio/execute_env_config.md new file mode 100644 index 0000000000..835ee547e3 --- /dev/null +++ b/docs/versioned_docs/version-1.0/user_guide/studio/execute_env_config.md @@ -0,0 +1,164 @@ +--- +sidebar_position: 2 +position: 2 +id: environment_config +title: 执行模式 +--- + +> 本章节仅简单介绍Dinky支持的执行模式与配置方法,具体参数配置请参考[集群管理](../register_center/cluster_manage) + + +### Local 本地执行模式 + +:::tip 特点 + +Dinky 内置的 Flink MiniCluster,资源受限,用于语法校验等操作。 + +**特点:** 不需要外部 Flink 集群,资源受限。 + +**适用于:** 测试任务,语法校验、查看 JobPlan、查看字段级血缘、执行资源占用非常小的作业。 + +::: + +作业配置处的`执行模式`中,勾选`Local模式`,即可使用。 +![local_mode](http://pic.dinky.org.cn/dinky/docs/zh-CN/user_guide/studio/execute_env_config/local_mode.png) +### Standalone 执行模式 + +:::tip 特点 + +与外部 Standalone 集群共享资源,用于批操作和小流量任务。 + +Dinky 将通过 JobManager 的 Rest 端口提交 FlinkSQL 作业至外部的 Flink Standalone 集群。 + +**特点:** 作业资源共享,启动快,不依赖 Yarn 或 K8S。 + +**适用于:** 批作业、Flink OLAP 查询、资源占用小的流作业。 + +::: + +自行根据Flink官网教程部署一个Standalone模式,并将地址其添加到`注册中心-Flink实例`中。 +![create_standalone_cluster](http://pic.dinky.org.cn/dinky/docs/zh-CN/user_guide/studio/execute_env_config/create_standalone_cluster.png) + +相关依赖添加完成后,在作业配置处的`执行模式`中,勾选`standalone模式`,并且在下方的`flink集群`选项框中勾选上方添加的集群,即可使用。 +![select_standalone](http://pic.dinky.org.cn/dinky/docs/zh-CN/user_guide/studio/execute_env_config/select_standalone.png) + +### Yarn Session 执行模式 + +:::tip 特点 + +与外部 Yarn Session 集群共享资源,用于批操作和小流量任务。 + +Dinky 将通过 JobManager 的 Rest 端口提交 FlinkSQL 作业至外部的 Flink Yarn Session 集群。 + +**特点:** 作业资源共享,启动快。 + +**适用于:** 作业资源共享,启动快,批作业、Flink OLAP 查询、资源占用小的流作业。 + +::: + +自行根据Flink官网教程部署一个 `Flink Yarn Session`模式,并将地址其添加到`注册中心-Flink实例`中。 + +![create_yarn_session_cluster](http://pic.dinky.org.cn/dinky/docs/zh-CN/user_guide/studio/execute_env_config/create_yarn_session_cluster.png) +相关依赖添加完成后,在作业配置处的`执行模式`中,勾选`yarn session模式`,并且在下方的`flink集群`选项框中勾选上方添加的集群,即可使用。 + +![select_yarn_session](http://pic.dinky.org.cn/dinky/docs/zh-CN/user_guide/studio/execute_env_config/select_yarn_session.png) + +### Yarn Per-Job 执行模式 + +:::tip 特点 + +每个 JobGraph 创建一个集群,资源隔离,用于资源占用大的任务。 + +Dinky 将通过 Yarn 来创建 Flink Yarn Per-Job 集群。 + +**特点:** 作业资源隔离,启动慢,每个 JobGraph 创建一个集群。 + +**适用于:** 资源占用较多的批作业和流作业。 + +::: + +在 `注册中心-集群配置` 中注册 Hadoop 与 Flink 相关配置,具体配置过程见[集群管理](../register_center/cluster_manage) +的集群配置管理。 + +![create_yarn_per_job_cluster](http://pic.dinky.org.cn/dinky/docs/zh-CN/user_guide/studio/execute_env_config/create_yarn_per_job_cluster.png) + +在配置完成后并且相关依赖添加完成后,在作业配置处的`执行模式`中,勾选`yarn per-job模式`,并且在下方的`flink集群` +选项框中勾选上方添加的集群,即可使用。 + +![select_yarn_per_job](http://pic.dinky.org.cn/dinky/docs/zh-CN/user_guide/studio/execute_env_config/select_yarn_per_job.png) +### Yarn Application 执行模式 + +:::tip 特点 + +所有 JobGraph 共享一个集群,资源隔离,节约网络资源。 + +Dinky 将通过 Yarn 来创建 Flink Yarn Application 集群。 + +**特点:** 作业资源隔离,启动慢,节约网络资源,所有 JobGraph 只创建一个集群。 + +**适用于:** 资源占用较多的批作业和流作业。 + +::: + +在 `注册中心-集群配置` 中注册 Hadoop 与 Flink 相关配置,具体配置过程详见[集群管理](../register_center/cluster_manage) +的集群配置管理。 + +![create_yarn_application_cluster](http://pic.dinky.org.cn/dinky/docs/zh-CN/user_guide/studio/execute_env_config/create_yarn_application_cluster.png) + +### Kubernetes Session 执行模式 + +:::tip 特点 + +与外部 Kubernetes Session 集群共享资源,动态扩容。 + +Dinky 将通过暴露的 NodePort 端口提交 FlinkSQL 作业至外部的 Flink Kubernetes Session 集群。 + +**特点:** 作业资源隔离,启动快,动态扩容。 + +**适用于:** 作业资源隔离,启动快,动态扩容,批作业、Flink OLAP 查询、资源占用小的流作业。 + +::: + +根据 Flink 官网手动部署一个 Flink Kubernetes Session 集群,并暴露 **NodePort **端口, 注册到 **集群实例** 中 + +![create_kubernetes_session_cluster](http://pic.dinky.org.cn/dinky/docs/zh-CN/user_guide/studio/execute_env_config/create_kubernetes_session_cluster.png) + +注册完成后,在创建作业后可在右侧作业配置处进行勾选执行模式 + +![select_kubernetes_session](http://pic.dinky.org.cn/dinky/docs/zh-CN/user_guide/studio/execute_env_config/select_kubernetes_session.png) + +### Kubernetes Application 执行模式 + +:::tip 特点 + +每个 JobGraph 创建一个 Pod,资源隔离,动态扩容。 + +**特点:** 作业资源隔离,启动慢,动态扩容,节约网络资源,所有 JobGraph 只创建一个集群。 + +**适用于:** 作业资源隔离,启动慢,动态扩容,节约网络资源,资源占用较多的批作业和流作业。 + +::: + +在 **注册中心 > 集群管理 > 集群配置管理** 中注册 Kubernetes Native类型 + +![create_kubernetes_application_cluster](http://pic.dinky.org.cn/dinky/docs/zh-CN/user_guide/studio/execute_env_config/create_kubernetes_application_cluster.png) + +### Kubernetes Operator 执行模式 + +:::tip 特点 + +使用 Kubernetes Operator 对 Flink 集群进行管理,可以实现集群的动态伸缩。 + +**特点:** 自动化管理,Operator 可以自动化管理应用程序的生命周期和运维任务;高度可扩展,Operator 允许开发者扩展 Kubernetes +的功能,以适应特定应用程序或工作负载的需求;智能决策和自愈能力,Operator +可以通过监视和分析应用程序的状态,做出智能决策以确保应用程序的健康和高可用性;自定义资源定义(CRD),Operator +使用自定义资源定义(CRD)来扩展 Kubernetes API,以支持新的自定义资源类型。 + +**适用于:** 作业资源隔离,启动慢,动态扩容,节约网络资源,资源占用较多的批作业和流作业。 + +::: + +在 **注册中心 > 集群管理 > 集群配置管理** 中注册 Kubernetes Opeartor类型 + +![create_kubernetes_operator_cluster](http://pic.dinky.org.cn/dinky/docs/zh-CN/user_guide/studio/execute_env_config/create_kubernetes_operator_cluster.png) + diff --git a/docs/versioned_docs/version-1.0/user_guide/studio/flink_env_task_devlop.md b/docs/versioned_docs/version-1.0/user_guide/studio/flink_env_task_devlop.md new file mode 100644 index 0000000000..c0ac991479 --- /dev/null +++ b/docs/versioned_docs/version-1.0/user_guide/studio/flink_env_task_devlop.md @@ -0,0 +1,6 @@ +--- +sidebar_position: 4 +position: 4 +id: flink_env_task_devlop +title: FlinkSqlEnv作业 +--- diff --git a/docs/versioned_docs/version-1.0/user_guide/studio/flink_sql_task_devlop.md b/docs/versioned_docs/version-1.0/user_guide/studio/flink_sql_task_devlop.md new file mode 100644 index 0000000000..8b10a662a0 --- /dev/null +++ b/docs/versioned_docs/version-1.0/user_guide/studio/flink_sql_task_devlop.md @@ -0,0 +1,201 @@ +--- +sidebar_position: 3 +position: 3 +id: all_task_devlop +title: Flink作业 +--- + +本章节介绍Flink Sql与Flink Jar作业开发 + +## 基础作业配置 + +### 作业配置 + +![task_config_panel](http://pic.dinky.org.cn/dinky/docs/zh-CN/user_guide/studio/flink_sql_task_devlop/task_config_panel.png) +该面板仅在 FlinkSQL 与 Flink Jar 类型作业需要配置,您可以根据具体需求配置参数,参数设置如下 + +| 是否必填 | 配置项 | 备注 | +|:----:|:------------:|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| 是 | 执行模式 | 指定 FlinkSQL 的执行模式,默认为local,支持以下几种运行模式**
Local
Standalone
Yarn / Yarn Session
Yarn Prejob / Yarn Application
K8s Application / K8s Session** | +| 是 | Flink集群 | 除Local模式外,Standalone与Session模式需要选择对应的集群实例,Application与PreJob模式需要选择对应的集群配置,具体配置方法参考注册中心内容 | +| 否 | FlinkSQL 环境 | 选择当前 FlinkSQL 执行环境或Catalog,默认无,请参考[FlinkSQLEnv 作业](./flink_env_task_devlop)或Catalog章节 | +| 是 | 任务并行度 | 设置Flink任务的并行度,默认为 1 | +| 否 | 全局变量 | 默认禁用,开启 FlinkSQL 全局变量,以`${}`进行调用 | +| 否 | 批模式 | 默认禁用,开启后启用 Batch Mode | +| 否 | SavePoint 策略 | 默认禁用,策略包括:
**最近一次**
**最早一次**
**指定一次** | +| 否 | 报警组 | 报警组配置详见[报警管理](../register_center/alert/alert_overview) | +| 否 | 其他配置 | 其他的 Flink 作业配置,具体可选参数,详见[Flink 官网](https://nightlies.apache.org/flink/flink-docs-release-1.14/docs/deployment/config/) | + +**使用Local模式的作业运行在那里?** + +Dinky内置了一个Flink MiniCluster,提交Local模式作业后,Dinky会启动一个单机Flink MiniCluster,作业被运行在此集群上, +该集群资源受限,仅适用于快速体验或临时测试Flink任务,不建议在生产环境使用,生产作业请使用其他模式。 + +**其他配置的列表里没有我需要的参数怎么办?** + +为防止误输入,错误输入,Dinky提供了常用的Flink配置,如果您需要的参数不存在,可以修改dinky安装目录下的 `dinky-loader/FlinkConfClass` +文件, +新增一行为该参数所在flink源码中的全路径类名,重启dinky即可。 + +除此之外,您还可以在 `注册中心-->文档-->新建文档` 中添加您需要的配置,类型选择 +Flink参数,添加完成后即可在配置列表中找到刚刚添加的Flink参数,具体请参考注册中心文档管理模块 + +### 保存点 + +Dinky 提供 FlinkSQL 在通过 **智能停止** 作业时,自动触发**savepoint**。也可以在运维中心手动触发,触发成功后会保存结果并记录在这里 + +![save_point](http://pic.dinky.org.cn/dinky/docs/zh-CN/user_guide/studio/flink_sql_task_devlop/save_point.png) + +### 版本历史 + +在创建作业后,点击`发布`会自动创建一个历史版本,用于记录历史并回退 +![history](http://pic.dinky.org.cn/dinky/docs/zh-CN/user_guide/studio/flink_sql_task_devlop/history.png) + +单击历史版本即可查看当前版本与所选版本的代码差异 +![code_diff](http://pic.dinky.org.cn/dinky/docs/zh-CN/user_guide/studio/flink_sql_task_devlop/code_diff.png) + +可点击此处回滚版本 +![rollback](http://pic.dinky.org.cn/dinky/docs/zh-CN/user_guide/studio/flink_sql_task_devlop/rollback.png) + +### 运行作业 + +单击左上角`执行`按钮即可提交任务到指定集群,提交为同步操作,运行过程下方控制台会实时打印执行日志,如果作业运行失败,请参考日志内容进行定位。 +:::tip 说明 + +请勿将Select语句作为FlinkSQL作业提交,Select语句请使用预览功能,详见下方预览功能章节 + +::: +![preview](http://pic.dinky.org.cn/dinky/docs/zh-CN/user_guide/studio/flink_sql_task_devlop/preview.png) + +### 作业预览 + +在Flink +Sql开发过程中,我们经常需要select查看数据,Dinky提供了预览功能,可以在开发过程中实时查看数据,对于select语句,点击右上角`预览` +即可。 + +同时你也可以对预览功能进行配置,如下图 +![preview_config](http://pic.dinky.org.cn/dinky/docs/zh-CN/user_guide/studio/flink_sql_task_devlop/preview_config.png) + +参数设置如下 + +| 是否必填 | 配置项 | 备注 | +|:----:|:----:|:-----------------------------------------------------------:| +| 否 | 打印流 | 默认禁用,开启打印流将同步运行并返回含有**op**字段信息的 ChangeLog
默认不开启则返回最终结果 | +| 否 | 最大行数 | 预览数据的最大行数,默认100 | +| 否 | 自动停止 | 默认禁用,开启自动停止将在捕获最大行记录数后自动停止 | + +提交成功后会切换到`结果选项卡`,点击 `获取最新数据` ,即可查看 Select 语句的执行结果。 +![preview_result](http://pic.dinky.org.cn/dinky/docs/zh-CN/user_guide/studio/flink_sql_task_devlop/preview_result.png) + +:::tip FlinkSQL 预览结果的必要条件 + +1. 执行模式必须是 Local、Standalone、Yarn Session、Kubernetes Session 其中的一种; + +2. 除 SET 和 DDL 外,必须只提交一个 SELECT 或 SHOW 或 DESC 语句; + +3. 作业必须是提交成功并且返回 JID,同时在远程集群可以看到作业处于 RUNNING 或 FINISHED 状态; + +4. Dinky 重启后,之前的预览结果将失效 + +::: + +## 工具栏使用 + +在数据开发页面右上方的工具栏可帮助用户快速对作业进行操作 +![tool_bar](http://pic.dinky.org.cn/dinky/docs/zh-CN/user_guide/studio/flink_sql_task_devlop/tool_bar.png) +具体含义如下 + +| 名称 | 作用 | 备注 | +|:---:|:--------------------:|:------------------------------------------------------------------------------:| +| 保存 | 保存当前作业 | | +| DAG | 获取Flink sql流程图 | | +| 检查 | 对sql进行校验 | | +| 发布 | 发布任务 | 任务发布后不允许进行修改 | +| 推送 | 推送至 DolphinScheduler | 该按钮仅在以下条件全部满足时方可展示/使用, 条件:
1. 启用了DolphinScheduler,且配置正确
2. 任务已经发布
| +| 运维 | 跳转运维页面 | 作用未运行不会有此按钮 | +| 运行 | 提交作业 | | +| 预览 | 预览作业数据 | | + +## Flink sql作业 + +编写FlinkSql语句 + +```sql +--创建源表datagen_source +CREATE TABLE datagen_source +( + id BIGINT, + name STRING +) +WITH ( 'connector' = 'datagen'); +--创建结果表blackhole_sink +CREATE TABLE blackhole_sink +( + id BIGINT, + name STRING +) +WITH ( 'connector' = 'blackhole'); +--将源表数据插入到结果表 +INSERT INTO blackhole_sink +SELECT id, + name +from datagen_source; +``` + +点击提交按钮,即可提交任务到集群,任务提交完成,我们可以进入运维中心页面,状态为Running表示运行成功。 +![runing_success](http://pic.dinky.org.cn/dinky/docs/zh-CN/user_guide/studio/flink_sql_task_devlop/runing_success.png) + +## Flink JAR作业 + +编写FlinkSql语句 +:::tip 注意 + +1. 此为dinky增强扩展语法, 详见 [Flink SQL 扩展语法](../../extend/expand_statements/execute_jar) +2. 此语法仅能在Flink jar作业中使用,请注意创建作业时选择作业类型为 `FlinkJar` + +::: + **语法结构** + +```sql + +EXECUTE JAR WITH ( +'uri'='.jar', -- jar文件路径 必填 +'main-class'='', -- jar作业运行的主类 必填 +'args'='', -- 主类入参 可选 +'parallelism'='', -- 任务并行度 可选 +); + +``` + +**样例代码1** + +```sql +set 'execution.checkpointing.interval'='21 s'; + +EXECUTE JAR WITH ( +'uri'='rs:/jar/flink/demo/SocketWindowWordCount.jar', +'main-class'='org.apache.flink.streaming.examples.socket', +'args'=' --hostname localhost ', +'parallelism'='', +); +``` + +:::warning 注意 + +1. 以上示例中, uri 的值为 rs:/jar/flink/demo/SocketWindowWordCount.jar, 该值为资源中心中的资源路径, + 请确保资源中心中存在该资源,请忽略资源中心 Root 节点(该节点为虚拟节点) +2. 如果要读取 S3,HDFS,LOCAL 等存储上面的文件均可通过rs协议进行桥接使用,请参考 [资源管理](../../user_guide/register_center/resource) 中 rs 协议使用方式 + +::: +**样例代码2** +```sql +EXECUTE JAR WITH ( +'uri'='rs:/paimon-flink-action-0.7.0-incubating.jar', +'main-class'='org.apache.paimon.flink.action.FlinkActions', +'args'='compact --warehouse hdfs:///tmp/paimon --database default --table use_be_hours_2' +); +``` +:::warning 注意 +1. 注意填写main-class,不能为空 +2. 注意args中的空格填写 +::: diff --git a/docs/versioned_docs/version-1.0/user_guide/studio/jdbc_task_devlop.md b/docs/versioned_docs/version-1.0/user_guide/studio/jdbc_task_devlop.md new file mode 100644 index 0000000000..fee7dfaeb2 --- /dev/null +++ b/docs/versioned_docs/version-1.0/user_guide/studio/jdbc_task_devlop.md @@ -0,0 +1,6 @@ +--- +sidebar_position: 4 +position: 4 +id: jdbc_task_devlop +title: Jdbc作业 +--- diff --git a/docs/versioned_docs/version-1.0/user_guide/studio/studio_overview.md b/docs/versioned_docs/version-1.0/user_guide/studio/studio_overview.md new file mode 100644 index 0000000000..b49748f018 --- /dev/null +++ b/docs/versioned_docs/version-1.0/user_guide/studio/studio_overview.md @@ -0,0 +1,53 @@ +--- +sidebar_position: 1 +position: 1 +id: studio_overview +title: 数据开发功能简介 +--- + +:::info 简介 +本章节主要介绍 Dinky 数据开发的基本设计理念,以及如何使用 Dinky 数据开发功能。 +::: + +## 数据开发引导 + +### 数据开发功能介绍 + +Dinky 数据开发功能主要包括: + +- 基于 普通 DB 的SQL 的数据开发与调试和运行 +- 基于 Flink SQL/Flink Jar 任务的开发与调试和运行 +- 基于 Python/Java/Scala 的 UDF 开发与调试和运行 +- 根据作业类型自动渲染数据开发界面,使得页面交互更加友好,开发更加高效 + +## 创建作业 + +Dinky支持创建多种类型作业,以满足不同需求,主要分为 Flink类型作业,Jdbc类型作业,其他类型作业(UDF),如图,下面开始介绍各种类型作业使用教程 + +![](http://pic.dinky.org.cn/dinky/docs/zh-CN/user_guide/studio/create_task.png) + +#### FlinkSql作业 + +此作业类型用于开发**FlinkSQL**,与 **FlinkCDC整库同步**作业。 + +#### FlinkJar作业 + +用于运行**自定义jar包**,对于非Flink sql作业,使用原生flink代码开发的jar包,可以通过dinky的`execute jar`语法进行提交与管理 + +#### FlinkSqlEnv作业类型 + +这是一个比较特殊的作业类型,对于sql作业开发,我们总是不可避免的需要一些通用参数需求,或者一些通用代码片段等,除了使用全局变量以外 +我们还可以通过创建一个`FlinkSqlEnv`类型作业把代码写在里面供其他任务引用,以此避免重复编写一些通用的语句,提高开发效率。 + +#### Jdbc作业 + +此作业类型用于执行**Jdbc sql语句**,目前支持多种数据库,如:Mysql,ClickHouse、Doris 等,需要提前在配置中心进行数据源注册。 + +#### 其他类型作业 + +目前支持编写**UDF**类型的作业,如:Python、Java、Scala 等。 + +:::tip 说明 + +Dinky将多种类型作业编写全部SQL化,并拓展了语法,不同类型作业语法并不通用,在创建作业时请注意不要创建错误类型的作业。 +::: \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0/user_guide/system_setting/_category_.json b/docs/versioned_docs/version-1.0/user_guide/system_setting/_category_.json new file mode 100644 index 0000000000..106055d472 --- /dev/null +++ b/docs/versioned_docs/version-1.0/user_guide/system_setting/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "system_setting", + "position": 5 +} diff --git a/docs/versioned_docs/version-1.0/user_guide/system_setting/global_settings/_category_.json b/docs/versioned_docs/version-1.0/user_guide/system_setting/global_settings/_category_.json new file mode 100644 index 0000000000..f06d46d152 --- /dev/null +++ b/docs/versioned_docs/version-1.0/user_guide/system_setting/global_settings/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "global_settings", + "position": 1 +} diff --git a/docs/versioned_docs/version-1.0/user_guide/system_setting/global_settings/dinky_setting.md b/docs/versioned_docs/version-1.0/user_guide/system_setting/global_settings/dinky_setting.md new file mode 100644 index 0000000000..5b042ca70c --- /dev/null +++ b/docs/versioned_docs/version-1.0/user_guide/system_setting/global_settings/dinky_setting.md @@ -0,0 +1,32 @@ +--- +position: 1 +id: dinky_setting +sidebar_position: 1 +title: Dinky 环境配置 +--- + +:::info 简介 +为了方便用户使用 Dinky,避免因为配置变更而重启 Dinky 服务,Dinky 提供了页面化配置功能,可以在页面上修改配置,修改后会自动生效,无需重启 +Dinky 服务。 +::: + +![global_setting_dinky](http://pic.dinky.org.cn/dinky/docs/zh-CN/user_guide/system_setting/global_settings/dinky_setting/global_setting_dinky.png) + +**参数配置说明:** +:::warning 注意 + +1. 在下列配置项`Dinky 地址` 该项,Dinky 会自动获取,但是由于多网卡等原因,获取到的地址可能不是用户期望的,如有此种情况,可以手动修改此项。 +2. 如果用户使用容器部署/提交任务,请保证容器 ip 与 `Dinky 地址` 互通, 否则会导致任务状态回传失败/无法获取到任务状态。 + +::: + +| 参数名称 | 参数说明 | 默认值 | +|-------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------| +| Python 环境变量 | Python 环境变量,用于提交 Python 任务以及构建 Python Udf ,PyFlink任务需要设置此参数 | python3 | +| Dinky 地址 | Dinky 后端服务地址,用于 application 和 prejob 模式下任务状态回传, 这样就不会出现0.7那样任务结束后dinky页面变为unknown或者还是running的情况,所以这个参数务必为容器内与dinky可以互通的地址。 | 系统自动获取 | +| 告警防重发间隔 | 在此间隔内,发送告警信息达到 [`告警防重发最大条数`] 配置的值时,达到阈值后,不再发送告警信息; 单位:秒 | 60 | +| 告警防重发最大条数 | 此配置用于在 [`告警防重发间隔`] 配置的指定间隔内,发送了 N 次告警信息,达到此配置设置的最大条数后,不再发送告警信息,注意: 此配置以任务实例为单位,即: 每个任务实例都会单独计算 ,单位:条 | 1 | +| 作业历史最大保留数量 | 提交的作业历史与自动注册的集群记录最大保留数量,如果不足该数量,则不会被删除,即使已经过了最大保留天数,也不会被删除, 单位(个) | 10 | +| 作业历史最大保留天数 | 提交的作业历史与自动注册的集群记录最大保留天数,过期会被自动删除, 单位(天) | 30 | +| 表达式变量列表 | 用于扩展表达式变量,**逗号分割**,需要使用类的全限定名,例如: com.dinky.common.utils.DateUtils,请确保类在Dinky的classpath中 ,如果想增加该表达式变量, 请参考 [表达式变量扩展](../../../extend/function_expansion/global_var_ext) 注意: 该配置对所有用户生效 | cn.hutool.core.date.DateUtil,
cn.hutool.core.util.IdUtil,
cn.hutool.core.util.RandomUtil,
cn.hutool.core.util.StrUtil | + diff --git a/docs/versioned_docs/version-1.0/user_guide/system_setting/global_settings/dolphinscheduler_setting.md b/docs/versioned_docs/version-1.0/user_guide/system_setting/global_settings/dolphinscheduler_setting.md new file mode 100644 index 0000000000..80d8ea935d --- /dev/null +++ b/docs/versioned_docs/version-1.0/user_guide/system_setting/global_settings/dolphinscheduler_setting.md @@ -0,0 +1,50 @@ +--- +position: 4 +sidebar_position: 4 +id: dolphinscheduler_setting +title: Dolphinscheduler 配置 +--- + + +:::info 简介 + +为了方便用户使用 Dinky 与 DolphinScheduler 进行集成,Dinky 提供了 DolphinScheduler 相关配置。 + +在 Dinky V1.0.0 版本开始,提供了 DolphinScheduler 页面化配置功能,可以在页面上修改配置,修改后会自动生效,无需重启 Dinky 服务。 + +::: + +如果用户想要将Dinky开发好的Flink任务推送到Dolphinscheduler。 + +### 1.生成海豚调度令牌 + +访问Dolphinscheduler系统,安全中心>令牌管理,创建令牌 +:::warning 注意 +设置令牌的失效时间,默认失效时间=创建时间,创建即失效,记得更改。 +::: + +### 2.在Dinky配置Dolphinscheduler相关参数 + +![dolphin_setting](http://pic.dinky.org.cn/dinky/docs/test/dolphin_setting.jpg) + +**参数配置说明:** + +| 参数名称 | 参数说明 | +|------------------------|--------------------------------------------------------------------------------------------------------------------------| +| 是否启用 DolphinScheduler | 如果启用,Dinky 会将开发好的任务推送到 DolphinScheduler 系统中,并在 DolphinScheduler 系统中创建项目
请最后修改此配置,因为启用时会自动创建项目.如果下边的几项配置不正确,会导致创建项目失败 | +| DolphinScheduler 地址 | 能正常访问的DolphinScheduler 地址 | +| DolphinScheduler Token | 步骤1中在DolphinScheduler系统中生成的令牌 | +| DolphinScheduler 项目名 | DolphinScheduler系统中的项目名,如果不存在,在修改 `是否启用 DolphinScheduler`配置为true后,会自动创建 | + +### 3.推送任务 + +将 Dinky 开发好的 Flink 任务推送到海豚调度:数据开发页,作业右上角依次点击 **保存** -> **上线** -> **推送** 按钮即可 + +### 4.访问Dolphinscheduler + +可以看到与配置的 **DolphinScheduler 项目名** 同名的项目 +![dolphin](http://pic.dinky.org.cn/dinky/docs/test/dolphin3.png) +**项目管理** > **项目名称** > **工作流定义**,可以看到dinky推送过来的工作流,依次点击右边**上线**,**运行** 按钮即可。 +:::warning 注意 +如果报错提示租户相关问题,可能是海豚调度的项目对应的账户没有关联租户,需要在海豚调度安全中心创建租户后,对用户进行分配租户。 +::: \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0/user_guide/system_setting/global_settings/flink_setting.md b/docs/versioned_docs/version-1.0/user_guide/system_setting/global_settings/flink_setting.md new file mode 100644 index 0000000000..7b1a7cde0d --- /dev/null +++ b/docs/versioned_docs/version-1.0/user_guide/system_setting/global_settings/flink_setting.md @@ -0,0 +1,28 @@ +--- +position: 2 +id: flink_setting +sidebar_position: 2 +title: Flink 配置 +--- + + +当用户使用 **Application 模式**以及 **RestAPI** 时,需要在 **Flink 设置** 页面进行相关修改。 + +另外**Application 模式** 支持**Yarn** 和 **Kubernetes**,启用 **RestAPI** 后,Flink 任务的 savepoint,停止等操作都将会通过 +JobManager 的 RestAPI 进行。 + +首先进入**配置中心** > **全局配置** > **Flink设置**,对参数配置进行修改即可。 + +![flink_setting](http://pic.dinky.org.cn/dinky/docs/test/flink_setting.jpg) + +**参数配置说明:** + +| 参数名称 | 参数说明 | +|:---------------|:--------------------------------------------------------------| +| **使用 RestAPI** | 是否使用 RestAPI 进行任务操作,开启后,FlinkSQL 任务的 savepoint、停止等操作将通过此参数进行。 | +| **Job 提交等待时间** | 提交 Application 或 PerJob 任务时获取 Job ID 的最大等待时间,单位是秒。 | + +:::warning 注意 +1. **SQL 分隔符** 配置项自 Dinky1.0.0-release 开始已被删除,不支持自定义,请严格遵守 SQL 语法规范。必须以 `;\n` 作为 SQL 语句的分隔符。`\n`为隐式换行符(即: 回车),不是明文字符串。 + +::: \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0/user_guide/system_setting/global_settings/ldap.md b/docs/versioned_docs/version-1.0/user_guide/system_setting/global_settings/ldap.md new file mode 100644 index 0000000000..f08e2d94b2 --- /dev/null +++ b/docs/versioned_docs/version-1.0/user_guide/system_setting/global_settings/ldap.md @@ -0,0 +1,80 @@ +--- +position: 5 +sidebar_position: 5 +id: ldap_setting +title: LDAP 配置 +--- + +:::info 简介 + +1. 为了方便用户使用 Dinky 并与公司内部的用户进行集成时,Dinky 提供了LDAP配置。并支持可视化配置,修改后会自动生效,无需重启 + Dinky 服务。 +2. 同时实现了LDAP用户导入功能,开启后,当用户使用LDAP登录时,如果没有相应的Dinky用户映射,则会自动拉取LDAP信息创建一个Dinky用户与之映射。如果关闭此功能,对于未导入的LDAP用户将无法登录。 + +::: + +## 1. 什么是LDAP? + +LDAP(轻量级目录访问协议)是一种用于访问和维护分布式目录服务信息的开放标准协议。 +它提供了一种结构化的方式来存储、查询和修改目录中的数据,如用户、组织和设备等信息。 +LDAP广泛应用于企业、组织和网络中,提供了高效、安全和可扩展的身份验证和访问控制机制。 + +## 2. 为什么使用LDAP + +首先,当涉及到存储和管理大量用户、组织和设备等信息时,我们需要一种高效、可靠且安全的方式来完成这个任务。 +这就是为什么使用LDAP(轻量级目录访问协议)的原因。 +其次,除了存储和管理信息,LDAP还有一个重要功能,即为不同系统之间提供统一的访问认证服务。 +当一个组织中有多个应用程序或系统时,每个系统都需要自己的用户账户和密码来进行身份验证。 +这对于用户来说可能会非常不便,因为他们需要记住多个不同的账户信息。同时,对于系统管理员来说,管理和维护这些账户也是一项复杂的任务。 +LDAP通过提供统一的身份验证服务来解决这个问题。 +组织可以将所有用户的账户信息存储在LDAP目录中,而不是每个系统都单独维护账户信息。 +这意味着用户只需要记住一个账户和密码,就可以访问所有连接到LDAP的系统。 + +## 3. Dinky与LDAP对接 + +:::danger 注意 + +1. 当你需要配置此功能时, 默认你已经了解LDAP的相关知识, 并且已经在你的公司内部搭建了LDAP服务, 并且你已经拥有了LDAP管理员账号, + 或者有权限查询列表的ldap用户。 +2. 请确保你的LDAP服务已经正常运行, 并且你的LDAP服务可以被Dinky服务所连接。 +3. 如果对接LDAP失败, 请检查你的LDAP服务是否正常运行, 并且检查你的LDAP服务是否可以被Dinky服务所连接。 +4. 如果不懂如何配置LDAP/根本不了解LDAP, 请自己百度/谷歌/..., 或者联系你们公司的LDAP管理员。 + +::: + +### 3.1 系统要求 + +在与我们的系统对接LDAP之前,请确保系统满足以下要求: + +- 已经安装和配置LDAP服务器 +- 确保系统网络连接正常 +- 拥有ldap管理员,或者有权限查询列表的ldap用户 + +### 3.2 配置LDAP连接 + +首先进入**配置中心** > **全局配置** > **LDAP设置**,对参数配置进行修改即可。 + +:::tip 提示 + +1. 所有参数配置完成之后, 请动动你的小手点一下 `测试链接`, 如果提示 `连接成功`, 则表示你的LDAP配置成功, + 否则请检查你的LDAP服务是否正常运行, 并且检查你的LDAP服务是否可以被Dinky服务所连接。 +2. 可以点击 Dinky 提供的 `测试登录` 按钮测试`登录功能`是否正常。 +3. 可以点击 `导入用户` 按钮, 导入LDAP用户到Dinky中。 + +::: + +**参数配置说明:** + +| 参数名称 | 参数说明 | 默认值 | +|:-------------|:----------------------------------------------------------------------------------------|:--------------| +| LDAP 服务地址 | ldap认证服务地址,例如:ldap://192.168.111.1:389 | | +| 登录用户名(DN) | 用于连接ldap服务的用户名,或者管理员DN,例如:cn=admin,dc=jakehu,dc=mez | | +| 登录密码 | 用于连接ldap服务的密码 | | +| 连接超时 | 连接ldap服务的最大时间,超过则断开 | | +| 用户基础DN | Dinky会在此基础dn下进行用户搜索,例如:ou=users,dc=dinky,dc=com | | +| 用户过滤规则 | 使用ldap的filter语法进行用户过滤,例如: (&(objectClass=inetOrgPerson)) | | +| 登录时自动映射用户 | 开启后,当用户使用LDAP登录时,如果没有相应的Dinky用户映射,则会自动拉取LDAP信息创建一个Dinky用户与之映射。如果关闭此功能,对于未导入的LDAP用户将无法登录 | true | +| LDAP导入默认租户编码 | 开启自动导入用户后,新用户登录需要一个默认的租户编码,否则无法登录,请注意租户编码必须在Dinky中存在 | DefaultTenant | +| LDAP用户名字段 | 需要填写一个LDAP中用户的属性字段来与Dinky用户对应,必须填写,一般可选为 cn 或者 uid 表示用户唯一标识 | | +| LDAP昵称字段 | 需要填写一个LDAP中用户的属性字段来与Dinky昵称对应,必须填写,一般可选为 sn 或者其他标识,不要求唯一 | | +| 是否启用 LDAP | 开启LDAP登录功能,开启前请先填写上面配置并确保正确配置,请最后修改此项配置 | false | \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0/user_guide/system_setting/global_settings/maven_setting.md b/docs/versioned_docs/version-1.0/user_guide/system_setting/global_settings/maven_setting.md new file mode 100644 index 0000000000..b0b7f60235 --- /dev/null +++ b/docs/versioned_docs/version-1.0/user_guide/system_setting/global_settings/maven_setting.md @@ -0,0 +1,23 @@ +--- +position: 3 +id: maven_setting +sidebar_position: 3 +title: Maven 配置 +--- + +:::info 简介 +Dinky1.0增加了从git拉取项目编译的功能(比如udf项目),当用户使用 **注册中心** > * +*[Git项目](../../register_center/git_project)**,构建项目需要下载jar包依赖,所以需要在 **配置中心** > **全局配置** > * +*Maven 配置** 页面进行相关设置。 +::: + +![maven_setting](http://pic.dinky.org.cn/dinky/docs/test/maven_setting.png) + +**参数配置说明:** + +| 参数名称 | 参数说明 | +|:-----------------|:-------------------------------------------------------------------------------------------------------------------| +| **Maven 配置文件路径** | setting文件地址,如果配置了环境变量 `MAVEN_HOME`,则优先使用环境变量配置的路径,但是需要注意 setting 文件的名称是默认的 `settings.xml`,如果名称不对或者没有配置环境变量,可以在此处填写 | +| **Maven 仓库地址** | 默认为阿里云仓库地址 | +| **Maven 仓库用户名** | Maven 私服地址的用户名,如无则不用填 | +| **Maven 仓库密码** | Maven 私服地址的密码,如无则不用填 | diff --git a/docs/versioned_docs/version-1.0/user_guide/system_setting/global_settings/metrics_setting.md b/docs/versioned_docs/version-1.0/user_guide/system_setting/global_settings/metrics_setting.md new file mode 100644 index 0000000000..fff16cf2fb --- /dev/null +++ b/docs/versioned_docs/version-1.0/user_guide/system_setting/global_settings/metrics_setting.md @@ -0,0 +1,25 @@ +--- +position: 6 +sidebar_position: 6 +id: metrics_setting +title: Metrics 配置 +--- + +:::info 简介 + +Dinky1.0增加了Metrics监控功能,可以实现对 Dinky Server的JVM信息的监控 + +如开启Dinky JVM Monitor开关,可以在`监控`中看到 Dinky Server 的实时的 JVM 等信息 + +::: + +![metrics_setting](http://pic.dinky.org.cn/dinky/docs/test/metrics_setting.png) + +**参数配置说明:** + +| 参数名称 | 参数说明 | +|:----------------------------------|:----------------------------------------------------------------| +| **Dinky JVM Monitor 开关** | 此开关会关系到Dinky JVM Monitor,决定监控页面中的Dinky Server显示,以及JVM Metrics采集 | +| **Dinky JVM Metrics 采集时间粒度** | Dinky JVM Metrics 采集时间粒度,定时任务间隔触发 | +| **Flink Metrics 采集时间粒度** | Flink Metrics 采集时间粒度,定时任务间隔触发 | +| **Flink Metrics 采集时间粒度,定时任务间隔触发** | Flink Metrics 采集超时时长,定时任务间隔触发(此配置项应小于Flink Metrics 采集时间粒度) | \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0/user_guide/system_setting/global_settings/resource_setting.md b/docs/versioned_docs/version-1.0/user_guide/system_setting/global_settings/resource_setting.md new file mode 100644 index 0000000000..ed0f27b30f --- /dev/null +++ b/docs/versioned_docs/version-1.0/user_guide/system_setting/global_settings/resource_setting.md @@ -0,0 +1,70 @@ +--- +position: 7 +sidebar_position: 7 +id: resource_setting +title: Resource 配置 +--- + + +当用户使用 **注册中心** > **[资源](../../register_center/resource)**,需要再本功能页面进行相关参数配置。配置保存后即生效 + +:::info 简介 +从 Dinky v1.0.0 版本开始,提供了资源管理的功能,可以在 Dinky 中管理资源. 方便管理各个文件系统, 支持了 Local File System, +HDFS, OSS 三种文件系统. +::: + +### Local File System 配置 + +![global_setting_resource_local](http://pic.dinky.org.cn/dinky/docs/test/global_setting_resource_local.png) + +**参数配置说明:** + +| 参数名称 | 参数说明 | 默认值 | +|--------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------| +| 是否启用Resource | 启用资源管理功能,如果切换存储模式时,需关闭此开关,相关配置完成后,再开启。 | true | +| 存储模式 | 支持HDFS、S3(Minio、阿里云OSS、腾讯云COS等..),切换选项后即可生效。 | Local | +| 上传目录的根路径 | 资源存储在HDFS/OSS (S3)路径上,资源文件将存储到此基本路径,自行配置,请确保该目录存在于相关存储系统上并具有读写权限。
如果是本地存储,则写本地文件存储路径,如 /User/xxx/data
如果是 HDFS 存储则写 HDFS 文件访问路径,如 /user/xxx
如果是 OSS 存储则写 OSS 文件访问路径(即 oss 的桶),如 /dinky | 无 | + +### HDFS 配置 + +![global_setting_resource_hdfs](http://pic.dinky.org.cn/dinky/docs/zh-CN/user_guide/system_setting/global_settings/resource_setting/global_setting_resource_hdfs.png) + +| 参数名称 | 参数说明 | 默认值 | +|----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------| +| 是否启用Resource | 启用资源管理功能,如果切换存储模式时,需关闭此开关,相关配置完成后,再开启。 | true | +| 存储模式 | 支持HDFS、S3(Minio、阿里云OSS、腾讯云COS等..),切换选项后即可生效。 | Local | +| 上传目录的根路径 | 资源存储在HDFS/OSS (S3)路径上,资源文件将存储到此基本路径,自行配置,请确保该目录存在于相关存储系统上并具有读写权限。
如果是本地存储,则写本地文件存储路径,如 /User/xxx/data
如果是 HDFS 存储则写 HDFS 文件访问路径,如 /user/xxx
如果是 OSS 存储则写 OSS 文件访问路径(即 oss 的桶),如 /dinky | 无 | +| HDFS操作用户名 | hdfs用户名 | hdfs | +| HDFS defaultFS | fs.defaultFS 配置项,例如: 远程 HDFS:hdfs://localhost:9000,本地:file:/// 高可用: hdfs://namespace | file:/// | +| core-site.xml | core-site.xml 配置**文件内容**,高可用必填 , 请**手动将配置文件内容填入到此处**(全选复制粘贴即可) | | | file:/// | +| hdfs-site.xml | hdfs-site.xml 配置**文件内容**,高可用必填 , 请**手动将配置文件内容填入到此处**(全选复制粘贴即可) | | + +:::warning 注意 + +1. HDFS defaultFS 配置项,可以支持高可用, 但是需要配置 core-site.xml 和 hdfs-site.xml 文件内容, + 请手动将配置文件内容写到此处(全选复制粘贴即可) +2. core-site.xml 和 hdfs-site.xml 仅在你的 HDFS 是高可用模式时才需要填写, 如果是其他模式,则不需要填写 +3. core-site.xml 和 hdfs-site.xml **不是填写文件路径,而是文件内容**,这么做的好处在于 在 Dinky 中提交 Application + 任务时可以直接使用 + HDFS 文件系统(高可用模式), 达到全模式通用目的 +4. 请自行确保上述配置文件内容正确, 否则会导致 HDFS 文件系统无法正常使用 + +::: + +### OSS 配置 + +![global_setting_resource_oss](http://pic.dinky.org.cn/dinky/docs/test/global_setting_resource_oss.png) + +| 参数名称 | 参数说明 | 默认值 | +|-----------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------| +| 是否启用Resource | 启用资源管理功能,如果切换存储模式时,需关闭此开关,相关配置完成后,再开启。 | true | +| 存储模式 | 支持HDFS、S3(Minio、阿里云OSS、腾讯云COS等..),切换选项后即可生效。 | Local | +| 上传目录的根路径 | 资源存储在HDFS/OSS (S3)路径上,资源文件将存储到此基本路径,自行配置,请确保该目录存在于相关存储系统上并具有读写权限。
如果是本地存储,则写本地文件存储路径,如 /User/xxx/data
如果是 HDFS 存储则写 HDFS 文件访问路径,如 /user/xxx
如果是 OSS 存储则写 OSS 文件访问路径(即 oss 的桶),如 /dinky | 无 | +| 对象存储服务的 URL(Endpoint) | 例如:https://oss-cn-hangzhou.aliyuncs.com | | +| Access key | Access key就像用户ID,可以唯一标识你的账户 | | +| Secret key | Secret key是你账户的密码,必须保管好,切勿泄露。 | | +| 存储桶名称 | 存储的Bucket名称 | dinky | +| 区域 | 区域是oss的服务所在地域 如:oss-cn-hangzhou,无默认值,但是必须填写。 | 无 | +| Path Style | 是否开启 path style, 不同的提供方(如阿里云oss,腾讯云cos)支持情况不同,请阅读提供方文档说明进行填写 | true | + + diff --git a/docs/versioned_docs/version-1.0/user_guide/system_setting/system_log.md b/docs/versioned_docs/version-1.0/user_guide/system_setting/system_log.md new file mode 100644 index 0000000000..a60a252de4 --- /dev/null +++ b/docs/versioned_docs/version-1.0/user_guide/system_setting/system_log.md @@ -0,0 +1,26 @@ +--- +position: 2 +id: system_log +sidebar_position: 2 +title: 系统日志 +--- + +:::info + +为了方便的查看系统日志,Dinky 提供了页面化查看系统日志功能,方便排查问题。不需要频繁使用 SSH 登录服务器查看日志。 + +1. 支持查看主日志文件 +2. 支持查看所有历史归档日志文件 +3. 在查看同时支持 向下/向上, 跳至顶部/底部, 以及定时刷新(5s) 等功能 +4. 支持日志下载功能 +::: + + +## 查看系统日志 + +![root_log](http://pic.dinky.org.cn/dinky/docs/test/root_log.jpg) + + +## 查看历史归档日志 + +![history_logs](http://pic.dinky.org.cn/dinky/docs/test/history_logs.jpg) \ No newline at end of file diff --git a/docs/versioned_sidebars/version-1.0-sidebars.json b/docs/versioned_sidebars/version-1.0-sidebars.json new file mode 100644 index 0000000000..caea0c03ba --- /dev/null +++ b/docs/versioned_sidebars/version-1.0-sidebars.json @@ -0,0 +1,8 @@ +{ + "tutorialSidebar": [ + { + "type": "autogenerated", + "dirName": "." + } + ] +} diff --git a/docs/versions.json b/docs/versions.json index 0e3039d15b..87892fbfc4 100644 --- a/docs/versions.json +++ b/docs/versions.json @@ -1,4 +1,5 @@ [ + "1.0", "0.7", "0.6" ]