win10部署DataX

Posted on 2026-04-29 14:20  打杂滴  阅读(73)  评论(0)    收藏  举报

您上传的表格图片(包含“杨子明”、数字“2826”等信息)与您输入的文字“win10 部署 DataX-web”没有直接关联。

DataX-web 是基于 Java 和 Python 的数据同步工具 DataX 的可视化 Web 管理界面。在 Windows 10 系统上部署它,需要按照以下步骤进行环境准备和配置:

 1.  环境准备(前置条件)

在部署之前,请确保您的 Win10 电脑上已经安装了以下环境:

  1. JDK 1.8:DataX-web 是基于 Spring Boot 开发的,需要 Java 环境 。

  2. Python 2.7 或 Python 3.x:DataX 的调度脚本依赖于 Python 运行 。

  3. Maven 3.x(可选):如果您打算从源码编译打包,需要安装 Maven 。

  4. MySQL 5.7 或更高版本:用于存储 DataX-web 的元数据 。

  5. Git(可选):用于从 GitHub 拉取源码

 

image

 

2. 下载 DataX 和 DataX-web 源码

从github下载源码

image

 

 

下载 DataX:从阿里云 OSS 或 GitHub 下载 DataX 的发行包(如 datax.tar.gz)并解压

 

image

解压如下

image

 

 

编译datax-web

由于 Win10 无法运行 install.sh,我们需要手动编译生成 JAR 包。

3. 初始化数据库

在 MySQL 中创建一个名为 datax_web的空数据库

image

找到 DataX-web 源码目录下的 SQL 脚本(通常在 bin/db/datax_web.sql),将其在 MySQL 中执行,完成表结构的初始化

 

image

 4.修改配置文件

编辑 datax-admin/src/main/resources/application.yml(编译前)或修改 JAR 包同目录下的 application.yml(编译后),确保数据库连接信息正确:

 F:\DataX\datax-web\datax-admin\target\classes

image

 

5. 配置 DataX 路径(关键)

DataX-Web 通过 Python 调用 DataX。你需要修改执行器的配置文件:

找到 datax-executor/src/main/resources/application.yml(编译前)或 JAR 包同目录下的配置文件。

F:\DataX\datax-web\datax-executor\target\classes

修改以下关键参数:

注意:如果使用 Python 3,需替换 DataX 安装目录 bin/下的三个 .py文件(datax.py, dxprofiling.py, profiling.py)为官方提供的 Python3 兼容版本(位于源码 doc/datax-web/datax-python3/目录下)

 6. 启动服务

在 Win10 下,我们使用 java -jar命令手动启动,需要打开两个独立的 CMD 窗口

image

你需要分别在 ‌datax-admin‌ 和 ‌datax-executor‌ 两个模块的 pom.xml 文件中,确保添加了 spring-boot-maven-plugin 插件,并正确配置了 <executions> 和 <mainClass>。

打开 datax-admin/pom.xml,找到 <build><plugins> 部分,添加或修改如下配置:

<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<!-- 建议指定版本,与你的Spring Boot版本一致,例如 2.1.2.RELEASE 或 2.2.2.RELEASE -->
<version>2.1.2.RELEASE</version>
<configuration>
<!-- 指定启动类的全路径,DataX-Admin 的启动类通常是这个 -->
<mainClass>com.wugui.datax.admin.DataXAdminApplication</mainClass>
<!-- 如果使用了 system scope 的依赖(如本地jar),需要设置为 true -->
<includeSystemScope>true</includeSystemScope>
</configuration>
<executions>
<execution>
<goals>
<!-- 关键:使用 repackage 目标,它会生成可执行的 fat jar -->
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>

image

 

 

 同样,检查 ‌datax-executor/pom.xml‌,确保也有类似的配置,但 mainClass 需改为 Executor 的启动类:

<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.1.2.RELEASE</version>
<configuration>
<!-- DataX-Executor 的启动类 -->
<mainClass>com.wugui.datax.executor.DataXExecutorApplication</mainClass>
<includeSystemScope>true</includeSystemScope>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>

image

 

 

 指定 Spring Boot 为兼容的版本  2.7.18

 重新清理并打包

image

 重复步骤4,步骤5

 再次启动服务

 继续报错

2026-04-30 09:58:19.567 INFO 12420 --- [ main] ru.yandex.clickhouse.ClickHouseDriver : Driver registered
_ _ |_ _ _|_. ___ _ | _
| | |\/|_)(_| | |_\ |_)||_|_\
/ |
3.3.1
2026-04-30 09:58:20.691 WARN 12420 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name '
jobAdminConfig': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.mail.javamail.JavaMailSender' available: expected at least 1 bean which qualif
ies as autowire candidate. Dependency annotations: {@javax.annotation.Resource(shareable=true, lookup=, name=, description=, authenticationType=CONTAINER, type=class java.lang.Object, mappedName=)}
2026-04-30 09:58:20.693 INFO 12420 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2026-04-30 09:58:20.703 INFO 12420 --- [ main] ConditionEvaluationReportLoggingListener :

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2026-04-30 09:58:20.914 ERROR 12420 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :

***************************
APPLICATION FAILED TO START
***************************

Description:

A component required a bean of type 'org.springframework.mail.javamail.JavaMailSender' that could not be found.


Action:

Consider defining a bean of type 'org.springframework.mail.javamail.JavaMailSender' in your configuration.

 

打开 datax-admin/pom.xml(或者项目根目录下的 pom.xml,如果是单模块项目)。
找到 <dependencies> 标签。
在其中添加以下代码:
xml
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>

 

重新编译编译datax-web,重复步骤4,5或者编译前修改相关配置文件

 

博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3