| <div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#docusaurus_skipToContent_fallback">Skip to main content</a></div><nav class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" href="/zh-CN/"><div class="navbar__logo"><img src="/zh-CN/img/logo.png" alt="Apache Linkis Logo" class="themedImage_ToTc themedImage--light_HNdA"><img src="/zh-CN/img/logo.png" alt="Apache Linkis Logo" class="themedImage_ToTc themedImage--dark_i4oU"></div><b class="navbar__title text--truncate">Apache Linkis</b></a><a class="navbar__item navbar__link" href="/zh-CN/download/main">下载</a><a class="navbar__item navbar__link" href="/zh-CN/community/how-to-subscribe">社区</a><a class="navbar__item navbar__link" href="/zh-CN/blog">博客</a><a class="navbar__item navbar__link" href="/zh-CN/team">团队</a><a class="navbar__item navbar__link" href="/zh-CN/user">用户</a><a href="https://docs.qq.com/doc/DUkdTTGhVSlZ0VXVt" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">FAQ</a><div class="navbar__item dropdown dropdown--hoverable"><a href="#" aria-haspopup="true" aria-expanded="false" role="button" class="navbar__link">Apache</a><ul class="dropdown__menu"><li><a href="https://www.apache.org/" target="_blank" rel="noopener noreferrer" class="dropdown__link">基金会</a></li><li><a href="https://www.apache.org/licenses/" target="_blank" rel="noopener noreferrer" class="dropdown__link">证书</a></li><li><a href="https://www.apache.org/events/current-event" target="_blank" rel="noopener noreferrer" class="dropdown__link">事件</a></li><li><a href="https://www.apache.org/security/" target="_blank" rel="noopener noreferrer" class="dropdown__link">安全</a></li><li><a href="https://www.apache.org/foundation/sponsorship.html" target="_blank" rel="noopener noreferrer" class="dropdown__link">赞助</a></li><li><a href="https://privacy.apache.org/policies/privacy-policy-public.html" target="_blank" rel="noopener noreferrer" class="dropdown__link">Privacy</a></li><li><a href="https://www.apache.org/foundation/thanks.html" target="_blank" rel="noopener noreferrer" class="dropdown__link">致谢</a></li></ul></div></div><div class="navbar__items navbar__items--right"><div class="navbar__item dropdown dropdown--hoverable dropdown--right"><a href="#" aria-haspopup="true" aria-expanded="false" role="button" class="navbar__link">文档</a><ul class="dropdown__menu"><li><a class="dropdown__link" href="/zh-CN/docs/latest/about/introduction">1.6.0</a></li><li><a class="dropdown__link" href="/zh-CN/docs/1.5.0/about/introduction">1.5.0</a></li><li><a class="dropdown__link" href="/zh-CN/docs/1.4.0/about/introduction">1.4.0</a></li><li><a class="dropdown__link" href="/zh-CN/docs/1.7.0/about/introduction">Next(1.7.0)</a></li><li><a class="dropdown__link" href="/zh-CN/versions">All Version</a></li></ul></div><a href="https://github.com/apache/linkis" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-github-link" aria-label="GitHub"></a><div class="navbar__item dropdown dropdown--hoverable dropdown--right"><a href="#" aria-haspopup="true" aria-expanded="false" role="button" class="navbar__link"><svg viewBox="0 0 24 24" width="20" height="20" aria-hidden="true" class="iconLanguage_nlXk"><path fill="currentColor" d="M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"></path></svg>简体中文</a><ul class="dropdown__menu"><li><a href="/docs/1.4.0/engine-usage/seatunnel" target="_self" rel="noopener noreferrer" class="dropdown__link" lang="en">English</a></li><li><a href="/zh-CN/docs/1.4.0/engine-usage/seatunnel" target="_self" rel="noopener noreferrer" class="dropdown__link dropdown__link--active" lang="zh-CN">简体中文</a></li></ul></div><div class="searchBox_ZlJk"><button type="button" class="DocSearch DocSearch-Button" aria-label="搜索"><span class="DocSearch-Button-Container"><svg width="20" height="20" class="DocSearch-Search-Icon" viewBox="0 0 20 20" aria-hidden="true"><path d="M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z" stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"></path></svg><span class="DocSearch-Button-Placeholder">搜索</span></span><span class="DocSearch-Button-Keys"></span></button></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="回到顶部" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebar_njMd"><nav class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" href="/zh-CN/docs/1.4.0/about/introduction">关于 Linkis</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" href="/zh-CN/docs/1.4.0/feature/overview">版本特性</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" href="/zh-CN/docs/1.4.0/quick/live-demo">快速体验</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" href="/zh-CN/docs/1.4.0/deployment/deploy-quick">部署指南</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" href="/zh-CN/docs/1.4.0/user-guide/how-to-use">使用指南</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret menu__link--active" aria-expanded="true" href="/zh-CN/docs/1.4.0/engine-usage/overview">引擎使用</a></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/zh-CN/docs/1.4.0/engine-usage/overview">总览</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/zh-CN/docs/1.4.0/engine-usage/spark">Spark</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/zh-CN/docs/1.4.0/engine-usage/hive">Hive</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/zh-CN/docs/1.4.0/engine-usage/python">Python</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/zh-CN/docs/1.4.0/engine-usage/shell">Shell</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/zh-CN/docs/1.4.0/engine-usage/jdbc">JDBC</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/zh-CN/docs/1.4.0/engine-usage/flink">Flink</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/zh-CN/docs/1.4.0/engine-usage/openlookeng">openLooKeng</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/zh-CN/docs/1.4.0/engine-usage/sqoop">Sqoop</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/zh-CN/docs/1.4.0/engine-usage/pipeline">Pipeline</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/zh-CN/docs/1.4.0/engine-usage/elasticsearch">ElasticSearch</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/zh-CN/docs/1.4.0/engine-usage/presto">Presto</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/zh-CN/docs/1.4.0/engine-usage/impala">Impala</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/zh-CN/docs/1.4.0/engine-usage/trino">Trino</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/zh-CN/docs/1.4.0/engine-usage/seatunnel">Seatunnel</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" href="/zh-CN/docs/1.4.0/auth/ldap">安全认证</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" href="/zh-CN/docs/1.4.0/api/overview">API</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" href="/zh-CN/docs/1.4.0/architecture/overview">架构设计</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" href="/zh-CN/docs/1.4.0/development/directory-structure">开发指南</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" href="/zh-CN/docs/1.4.0/tuning-and-troubleshooting/overview">调优排障</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" href="/zh-CN/docs/1.4.0/upgrade/upgrade-from-0.X-to-1.0-guide">升级指南</a></div></li></ul></nav></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="theme-doc-version-banner alert alert--warning margin-bottom--md" role="alert"><div>This is documentation for <!-- -->Apache Linkis<!-- --> <b>1.4.0</b>, 非最新版本。</div><div class="margin-top--md">有关最新文档,请参阅最新稳定版本<b><a href="/zh-CN/docs/latest/engine-usage/seatunnel">latest version</a></b> (<!-- -->1.6.0<!-- -->).</div></div><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="页面路径"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="主页面" class="breadcrumbs__link" href="/zh-CN/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_OVgt"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li class="breadcrumbs__item"><span class="breadcrumbs__link">引擎使用</span><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Seatunnel</span><meta itemprop="position" content="2"></li></ul></nav><span class="theme-doc-version-badge badge badge--secondary">版本:1.4.0</span><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><header><h1>Seatunnel</h1></header><p>本文主要介绍在 <code>Linkis</code> 中,<code>Seatunnel</code> 引擎插件的安装、使用和配置。</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="1-前置工作">1. 前置工作<a class="hash-link" href="#1-前置工作" title="Direct link to heading"></a></h2><h3 class="anchor anchorWithStickyNavbar_LWe7" id="11-引擎安装">1.1 引擎安装<a class="hash-link" href="#11-引擎安装" title="Direct link to heading"></a></h3><p>如果您希望在您的 <code>Linkis</code> 服务上使用 <code>Seatunnel</code> 引擎,您需要安装 <code>Seatunnel</code> 引擎。而且 <code>Seatunnel</code> 是依赖 <code>Spark</code> 或 <code>Flink</code> 环境,使用 <code>linkis-seatunnel</code> 引擎前,强烈建议本地跑通 <code>Seatunnel</code> 环境。</p><p><code>Seatunnel 2.1.2</code> 下载地址:<a href="https://dlcdn.apache.org/incubator/seatunnel/2.1.2/apache-seatunnel-incubating-2.1.2-bin.tar.gz" target="_blank" rel="noopener noreferrer">https://dlcdn.apache.org/incubator/seatunnel/2.1.2/apache-seatunnel-incubating-2.1.2-bin.tar.gz</a></p><table><thead><tr><th>环境变量名称</th><th>环境变量内容</th><th>是否需要</th></tr></thead><tbody><tr><td>JAVA_HOME</td><td>JDK安装路径</td><td>需要</td></tr><tr><td>SEATUNNEL_HOME</td><td>Seatunnel安装路径</td><td>需要</td></tr><tr><td>SPARK_HOME</td><td>Spark安装路径</td><td>Seatunnel执行基于Spark就需要</td></tr><tr><td>FLINK_HOME</td><td>Flink安装路径</td><td>Seatunnel执行基于Flink就需要</td></tr></tbody></table><p>表1-1 环境配置清单</p><table><thead><tr><th>Linkis变量名称</th><th>变量内容</th><th>是否必须</th></tr></thead><tbody><tr><td>wds.linkis.engine.seatunnel.plugin.home</td><td>Seatunnel安装路径</td><td>是</td></tr></tbody></table><h3 class="anchor anchorWithStickyNavbar_LWe7" id="12-引擎环境验证">1.2 引擎环境验证<a class="hash-link" href="#12-引擎环境验证" title="Direct link to heading"></a></h3><p>以执行 <code>Spark</code> 任务为例</p><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token builtin class-name" style="color:rgb(189, 147, 249)">cd</span><span class="token plain"> </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$SEATUNNEL_HOME</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">./bin/start-seatunnel-spark.sh --master local</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token number">4</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"> --deploy-mode client --config ./config/spark.batch.conf.template</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg class="copyButtonIcon_y97N" viewBox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewBox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>输出结果如下:</p><p><img loading="lazy" src="/zh-CN/assets/images/check-seatunnel-eb158e0b946d2e55b7bfac3b90b0448b.png" width="1014" height="515" class="img_ev3q"></p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="2-引擎插件部署">2. 引擎插件部署<a class="hash-link" href="#2-引擎插件部署" title="Direct link to heading"></a></h2><h3 class="anchor anchorWithStickyNavbar_LWe7" id="21-引擎插件准备二选一非默认引擎">2.1 引擎插件准备(二选一)<a href="/zh-CN/docs/1.4.0/engine-usage/overview">非默认引擎</a><a class="hash-link" href="#21-引擎插件准备二选一非默认引擎" title="Direct link to heading"></a></h3><p>方式一:直接下载引擎插件包</p><p><a href="https://linkis.apache.org/zh-CN/blog/2022/04/15/how-to-download-engineconn-plugin" target="_blank" rel="noopener noreferrer">Linkis 引擎插件下载</a></p><p>方式二:单独编译引擎插件(需要有 <code>maven</code> 环境)</p><div class="codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain"># 编译</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">cd ${linkis_code_dir}/linkis-engineconn-plugins/seatunnel/</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">mvn clean install</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"># 编译出来的引擎插件包,位于如下目录中</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">${linkis_code_dir}/linkis-engineconn-plugins/seatunnel/target/out/</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg class="copyButtonIcon_y97N" viewBox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewBox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p><a href="/zh-CN/docs/1.4.0/deployment/install-engineconn">EngineConnPlugin 引擎插件安装</a></p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="22-引擎插件的上传和加载">2.2 引擎插件的上传和加载<a class="hash-link" href="#22-引擎插件的上传和加载" title="Direct link to heading"></a></h3><p>将 2.1 中的引擎包上传到服务器的引擎目录下</p><div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${LINKIS_HOME}</span><span class="token plain">/lib/linkis-engineconn-plugins</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg class="copyButtonIcon_y97N" viewBox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewBox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>上传后目录结构如下所示</p><div class="codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">linkis-engineconn-plugins/</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">├── seatunnel</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">│ ├── dist</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">│ │ └── 2.1.2</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">│ │ ├── conf</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">│ │ └── lib</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">│ └── plugin</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">│ └── 2.1.2</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg class="copyButtonIcon_y97N" viewBox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewBox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="23-引擎刷新">2.3 引擎刷新<a class="hash-link" href="#23-引擎刷新" title="Direct link to heading"></a></h3><h4 class="anchor anchorWithStickyNavbar_LWe7" id="231-重启刷新">2.3.1 重启刷新<a class="hash-link" href="#231-重启刷新" title="Direct link to heading"></a></h4><p>通过重启 <code>linkis-cg-linkismanager</code> 服务刷新引擎</p><div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token builtin class-name" style="color:rgb(189, 147, 249)">cd</span><span class="token plain"> </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${LINKIS_HOME}</span><span class="token plain">/sbin</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token function" style="color:rgb(80, 250, 123)">sh</span><span class="token plain"> linkis-daemon.sh restart cg-linkismanager</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg class="copyButtonIcon_y97N" viewBox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewBox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="232-检查引擎是否刷新成功">2.3.2 检查引擎是否刷新成功<a class="hash-link" href="#232-检查引擎是否刷新成功" title="Direct link to heading"></a></h3><p>可以查看数据库中的 <code>linkis_engine_conn_plugin_bml_resources</code> 这张表的<code>last_update_time</code> 是否为触发刷新的时间。</p><div class="language-sql codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-sql codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">#登陆到 `linkis` 的数据库 </span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">select</span><span class="token plain"> </span><span class="token operator">*</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> linkis_cg_engine_conn_plugin_bml_resources</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg class="copyButtonIcon_y97N" viewBox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewBox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="3-引擎的使用">3. 引擎的使用<a class="hash-link" href="#3-引擎的使用" title="Direct link to heading"></a></h2><h3 class="anchor anchorWithStickyNavbar_LWe7" id="31-通过-linkis-cli-提交任务">3.1 通过 <code>Linkis-cli</code> 提交任务<a class="hash-link" href="#31-通过-linkis-cli-提交任务" title="Direct link to heading"></a></h3><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">sh</span><span class="token plain"> ./bin/linkis-cli --mode once -code </span><span class="token string" style="color:rgb(255, 121, 198)">'test'</span><span class="token plain"> -engineType seatunnel-2.1.2 -codeType sspark -labelMap </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">userCreator</span><span class="token operator">=</span><span class="token plain">hadoop-seatunnel -labelMap </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">engineConnMode</span><span class="token operator">=</span><span class="token plain">once -jobContentMap </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">code</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">'env {</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> spark.app.name = "SeaTunnel"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> spark.executor.instances = 2</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> spark.executor.cores = 1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> spark.executor.memory = "1g"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> }</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> source { </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> Fake {</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> result_table_name = "my_dataset"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> }</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> }</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> transform {}</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> sink {Console {}}'</span><span class="token plain"> -jobContentMap </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">master</span><span class="token operator">=</span><span class="token plain">local</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token number">4</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"> -jobContentMap deploy-mode</span><span class="token operator">=</span><span class="token plain">client -sourceMap </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">jobName</span><span class="token operator">=</span><span class="token plain">OnceJobTest -submitUser hadoop -proxyUser hadoop</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg class="copyButtonIcon_y97N" viewBox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewBox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="32-通过-onceengineconn-提交任务">3.2 通过 OnceEngineConn 提交任务<a class="hash-link" href="#32-通过-onceengineconn-提交任务" title="Direct link to heading"></a></h3><p>OnceEngineConn 通过 LinkisManagerClient 调用 LinkisManager 的 createEngineConn 接口,并将代码发送到创建的 Seatunnel 引擎,然后 Seatunnel 引擎开始执行。 Client 的使用也非常简单,首先创建一个新的 maven 项目,或者在项目中引入以下依赖项</p><div class="language-xml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-xml codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token tag punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token tag" style="color:rgb(255, 121, 198)">dependency</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">></span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token tag punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token tag" style="color:rgb(255, 121, 198)">groupId</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">></span><span class="token plain">org.apache.linkis</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)"></</span><span class="token tag" style="color:rgb(255, 121, 198)">groupId</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">></span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token tag punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token tag" style="color:rgb(255, 121, 198)">artifactId</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">></span><span class="token plain">linkis-computation-client</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)"></</span><span class="token tag" style="color:rgb(255, 121, 198)">artifactId</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">></span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token tag punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token tag" style="color:rgb(255, 121, 198)">version</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">></span><span class="token plain">${linkis.version}</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)"></</span><span class="token tag" style="color:rgb(255, 121, 198)">version</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">></span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token tag punctuation" style="color:rgb(248, 248, 242)"></</span><span class="token tag" style="color:rgb(255, 121, 198)">dependency</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg class="copyButtonIcon_y97N" viewBox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewBox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p><strong>示例代码</strong></p><div class="language-java codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-java codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">package org.apache.linkis.computation.client;</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">import org.apache.linkis.common.conf.Configuration;</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">import org.apache.linkis.computation.client.once.simple.SubmittableSimpleOnceJob;</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">import org.apache.linkis.computation.client.utils.LabelKeyUtils;</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">public class SeatunnelOnceJobTest {</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> public static void main(String[] args) {</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> LinkisJobClient.config().setDefaultServerUrl("http://ip:9001");</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> String code =</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> "\n"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> + "env {\n"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> + " spark.app.name = \"SeaTunnel\"\n"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> + " spark.executor.instances = 2\n"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> + " spark.executor.cores = 1\n"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> + " spark.executor.memory = \"1g\"\n"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> + "}\n"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> + "\n"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> + "source {\n"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> + " Fake {\n"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> + " result_table_name = \"my_dataset\"\n"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> + " }\n"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> + "\n"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> + "}\n"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> + "\n"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> + "transform {\n"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> + "}\n"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> + "\n"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> + "sink {\n"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> + " Console {}\n"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> + "}";</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> SubmittableSimpleOnceJob onceJob =</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> LinkisJobClient.once()</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> .simple()</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> .builder()</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> .setCreateService("seatunnel-Test")</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> .setMaxSubmitTime(300000)</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> .addLabel(LabelKeyUtils.ENGINE_TYPE_LABEL_KEY(), "seatunnel-2.1.2")</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> .addLabel(LabelKeyUtils.USER_CREATOR_LABEL_KEY(), "hadoop-seatunnel")</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> .addLabel(LabelKeyUtils.ENGINE_CONN_MODE_LABEL_KEY(), "once")</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> .addStartupParam(Configuration.IS_TEST_MODE().key(), true)</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> .addExecuteUser("hadoop")</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> .addJobContent("runType", "sspark")</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> .addJobContent("code", code)</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> .addJobContent("master", "local[4]")</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> .addJobContent("deploy-mode", "client")</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> .addSource("jobName", "OnceJobTest")</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> .build();</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> onceJob.submit();</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> System.out.println(onceJob.getId());</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> onceJob.waitForCompleted();</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> System.out.println(onceJob.getStatus());</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> LinkisJobMetrics jobMetrics = onceJob.getJobMetrics();</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> System.out.println(jobMetrics.getMetrics());</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> }</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg class="copyButtonIcon_y97N" viewBox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewBox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="4-引擎配置说明">4. 引擎配置说明<a class="hash-link" href="#4-引擎配置说明" title="Direct link to heading"></a></h2><h3 class="anchor anchorWithStickyNavbar_LWe7" id="41-默认配置说明">4.1 默认配置说明<a class="hash-link" href="#41-默认配置说明" title="Direct link to heading"></a></h3><table><thead><tr><th>配置</th><th>默认值</th><th>说明</th><th>是否必须</th></tr></thead><tbody><tr><td>wds.linkis.engine.seatunnel.plugin.home</td><td>/opt/linkis/seatunnel</td><td>Seatunnel安装路径</td><td>true</td></tr></tbody></table><h3 class="anchor anchorWithStickyNavbar_LWe7" id="42-配置修改">4.2 配置修改<a class="hash-link" href="#42-配置修改" title="Direct link to heading"></a></h3><p>如果默认参数不满足时,有如下几中方式可以进行一些基础参数配置</p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="421-客户端配置参数">4.2.1 客户端配置参数<a class="hash-link" href="#421-客户端配置参数" title="Direct link to heading"></a></h4><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">sh</span><span class="token plain"> ./bin/linkis-cli --mode once -code </span><span class="token string" style="color:rgb(255, 121, 198)">'test'</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">-engineType seatunnel-2.1.2 -codeType sspark </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">-labelMap </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">userCreator</span><span class="token operator">=</span><span class="token plain">hadoop-seatunnel -labelMap </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">engineConnMode</span><span class="token operator">=</span><span class="token plain">once </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">-jobContentMap </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">code</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">'env {</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> spark.app.name = "SeaTunnel"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> spark.executor.instances = 2</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> spark.executor.cores = 1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> spark.executor.memory = "1g"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> }</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> source { </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> Fake {</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> result_table_name = "my_dataset"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> }</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> }</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> transform {}</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> sink {Console {}}'</span><span class="token plain"> -jobContentMap </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">master</span><span class="token operator">=</span><span class="token plain">local</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token number">4</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -jobContentMap deploy-mode</span><span class="token operator">=</span><span class="token plain">client </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -sourceMap </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">jobName</span><span class="token operator">=</span><span class="token plain">OnceJobTest </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -runtimeMap wds.linkis.engine.seatunnel.plugin.home</span><span class="token operator">=</span><span class="token plain">/opt/linkis/seatunnel </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -submitUser hadoop -proxyUser hadoop </span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg class="copyButtonIcon_y97N" viewBox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewBox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h4 class="anchor anchorWithStickyNavbar_LWe7" id="422-任务接口配置">4.2.2 任务接口配置<a class="hash-link" href="#422-任务接口配置" title="Direct link to heading"></a></h4><p>提交任务接口,通过参数 <code>params.configuration.runtime</code> 进行配置</p><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">http 请求参数示例 </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"executionContent"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token string" style="color:rgb(255, 121, 198)">"code"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'env {</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> spark.app.name = "SeaTunnel"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> spark.executor.instances = 2</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> spark.executor.cores = 1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> spark.executor.memory = "1g"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> }</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> source { </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> Fake {</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> result_table_name = "my_dataset"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> }</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> }</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> transform {}</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> sink {Console {}}'</span><span class="token plain">, </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"runType"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"sql"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"params"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"variable"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"configuration"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"runtime"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"wds.linkis.engine.seatunnel.plugin.home"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"/opt/linkis/seatunnel"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"labels"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"engineType"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"seatunnel-2.1.2"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"userCreator"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"hadoop-IDE"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg class="copyButtonIcon_y97N" viewBox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewBox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/apache/linkis-website/edit/dev/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.4.0/engine-usage/seatunnel.md" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>编辑</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages navigation"><a class="pagination-nav__link pagination-nav__link--prev" href="/zh-CN/docs/1.4.0/engine-usage/trino"><div class="pagination-nav__sublabel">上一篇</div><div class="pagination-nav__label">Trino</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/zh-CN/docs/1.4.0/auth/ldap"><div class="pagination-nav__sublabel">下一篇</div><div class="pagination-nav__label">LDAP</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#1-前置工作" class="table-of-contents__link toc-highlight">1. 前置工作</a><ul><li><a href="#11-引擎安装" class="table-of-contents__link toc-highlight">1.1 引擎安装</a></li><li><a href="#12-引擎环境验证" class="table-of-contents__link toc-highlight">1.2 引擎环境验证</a></li></ul></li><li><a href="#2-引擎插件部署" class="table-of-contents__link toc-highlight">2. 引擎插件部署</a><ul><li><a href="#21-引擎插件准备二选一非默认引擎" class="table-of-contents__link toc-highlight">2.1 引擎插件准备(二选一)非默认引擎</a></li><li><a href="#22-引擎插件的上传和加载" class="table-of-contents__link toc-highlight">2.2 引擎插件的上传和加载</a></li><li><a href="#23-引擎刷新" class="table-of-contents__link toc-highlight">2.3 引擎刷新</a></li><li><a href="#232-检查引擎是否刷新成功" class="table-of-contents__link toc-highlight">2.3.2 检查引擎是否刷新成功</a></li></ul></li><li><a href="#3-引擎的使用" class="table-of-contents__link toc-highlight">3. 引擎的使用</a><ul><li><a href="#31-通过-linkis-cli-提交任务" class="table-of-contents__link toc-highlight">3.1 通过 <code>Linkis-cli</code> 提交任务</a></li><li><a href="#32-通过-onceengineconn-提交任务" class="table-of-contents__link toc-highlight">3.2 通过 OnceEngineConn 提交任务</a></li></ul></li><li><a href="#4-引擎配置说明" class="table-of-contents__link toc-highlight">4. 引擎配置说明</a><ul><li><a href="#41-默认配置说明" class="table-of-contents__link toc-highlight">4.1 默认配置说明</a></li><li><a href="#42-配置修改" class="table-of-contents__link toc-highlight">4.2 配置修改</a></li></ul></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="row footer__links"><div class="col footer__col"><div class="footer__title">Linkis</div><ul class="footer__items clean-list"><li class="footer__item"><a class="footer__link-item" href="/zh-CN/docs/latest/about/introduction">文档</a></li><li class="footer__item"><a class="footer__link-item" href="/zh-CN/faq/main">FAQ</a></li><li class="footer__item"><a href="https://github.com/apache/linkis/releases" target="_blank" rel="noopener noreferrer" class="footer__link-item">版本</a></li></ul></div><div class="col footer__col"><div class="footer__title">社区</div><ul class="footer__items clean-list"><li class="footer__item"><a href="https://github.com/apache/linkis" target="_blank" rel="noopener noreferrer" class="footer__link-item">GitHub</a></li><li class="footer__item"><a href="https://github.com/apache/linkis/issues" target="_blank" rel="noopener noreferrer" class="footer__link-item">Issue Tracker</a></li><li class="footer__item"><a href="https://github.com/apache/linkis/pulls" target="_blank" rel="noopener noreferrer" class="footer__link-item">Pull Requests</a></li></ul></div><div class="col footer__col"><div class="footer__title">订阅邮件组</div><ul class="footer__items clean-list"><li class="footer__item"><a class="footer__link-item" href="/zh-CN/community/how-to-subscribe">如何订阅</a></li><li class="footer__item"><a href="mailto:dev-subscribe@linkis.apache.org" target="_blank" rel="noopener noreferrer" class="footer__link-item">订阅邮件</a></li><li class="footer__item"><a href="https://lists.apache.org/list.html?dev@linkis.apache.org" target="_blank" rel="noopener noreferrer" class="footer__link-item">邮件归档</a></li></ul></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div style="text-align: left;"> |