• 部署SeaTunnel单节点Standalone 模式环境


    1.前置准备:

            SeaTunnel支持运行在JDK8及以上环境。该步骤需要用户自行安装JDK环境。

    2.下载安装包

            本次部署使用的是2.3.1版本。如果你需要下载其它版本,可以从如下网址中查询对应的版本。

    Apache SeaTunnel

    1. mkdir ~/seatunnel
    2. cd ~/seatunnel
    3. wget https://dlcdn.apache.org/seatunnel/2.3.1/apache-seatunnel-incubating-2.3.1-bin.tar.gz
    4. tar -zxvf apache-seatunnel-incubating-2.3.1-bin.tar.gz

    3.安装需要的插件

            SeaTunnel需要自己安装同步数据需要的连接器插件,需要用户编辑config下plugin_config文件,该文件描述了需要下载和安装的连接器插件,默认所有已经支持的连接器插件都会下载和安装。我们可以修改该文件,删除我们不需要的插件,只保留我们需要的插件。

    1. cd ~/seatunnel/apache-seatunnel-incubating-2.3.1
    2. vi config/plugin_config

    4.运行下载命令

            运行下载安装连接器插件的命令:

    1. cd ~/seatunnel/apache-seatunnel-incubating-2.3.1
    2. sh bin/install-plugin.sh

    等待命令执行完成,连接器插件即下载安装完成。安装完成后可见~/seatunnel/apache-seatunnel-incubation-2.3.1/connectors/seatunnel/目录下已经有了安装好的连接器插件。

    1. -rw-r--r-- 1 root root 11501046 10月 24 19:00 connector-amazondynamodb-2.3.1.jar
    2. -rw-r--r-- 1 root root 70099 10月 24 19:01 connector-assert-2.3.1.jar
    3. -rw-r--r-- 1 root root 13850207 10月 24 19:17 connector-cassandra-2.3.1.jar
    4. -rw-r--r-- 1 root root 31837415 10月 24 19:39 connector-cdc-mysql-2.3.1.jar
    5. -rw-r--r-- 1 root root 30487309 10月 24 20:17 connector-clickhouse-2.3.1.jar
    6. -rw-r--r-- 1 root root 52023 2月 18 2022 connector-console-2.3.1.jar
    7. -rw-r--r-- 1 root root 7004361 10月 24 20:29 connector-datahub-2.3.1.jar
    8. -rw-r--r-- 1 root root 5575890 10月 24 20:33 connector-dingtalk-2.3.1.jar
    9. -rw-r--r-- 1 root root 1972948 10月 24 20:36 connector-doris-2.3.1.jar
    10. -rw-r--r-- 1 root root 5475697 10月 24 20:43 connector-elasticsearch-2.3.1.jar
    11. -rw-r--r-- 1 root root 730013 10月 24 20:44 connector-email-2.3.1.jar
    12. -rw-r--r-- 1 root root 153432 2月 18 2022 connector-fake-2.3.1.jar
    13. -rw-r--r-- 1 root root 23578424 10月 24 22:10 connector-file-hadoop-2.3.1.jar
    14. -rw-r--r-- 1 root root 23574827 10月 24 22:57 connector-file-local-2.3.1.jar
    15. -rw-r--r-- 1 root root 235391594 10月 25 00:36 connector-file-oss-jindo-2.3.1.jar
    16. -rw-r--r-- 1 root root 26585017 10月 25 00:39 connector-file-s3-2.3.1.jar
    17. -rw-r--r-- 1 root root 23878459 10月 25 00:43 connector-file-sftp-2.3.1.jar
    18. -rw-r--r-- 1 root root 6840166 10月 25 00:52 connector-google-sheets-2.3.1.jar
    19. -rw-r--r-- 1 root root 50730916 10月 25 03:22 connector-hbase-2.3.1.jar
    20. -rw-r--r-- 1 root root 23598219 10月 25 01:05 connector-hive-2.3.1.jar
    21. -rw-r--r-- 1 root root 5177581 10月 25 01:12 connector-http-base-2.3.1.jar
    22. -rw-r--r-- 1 root root 5180838 10月 25 01:19 connector-http-feishu-2.3.1.jar
    23. -rw-r--r-- 1 root root 5186017 10月 25 01:27 connector-http-github-2.3.1.jar
    24. -rw-r--r-- 1 root root 5185488 10月 25 01:22 connector-http-gitlab-2.3.1.jar
    25. -rw-r--r-- 1 root root 5184487 10月 25 01:32 connector-http-jira-2.3.1.jar
    26. -rw-r--r-- 1 root root 5185674 10月 25 01:36 connector-http-klaviyo-2.3.1.jar
    27. -rw-r--r-- 1 root root 5185305 10月 25 01:41 connector-http-lemlist-2.3.1.jar
    28. -rw-r--r-- 1 root root 5188184 10月 25 01:44 connector-http-myhours-2.3.1.jar
    29. -rw-r--r-- 1 root root 5185496 10月 25 01:48 connector-http-notion-2.3.1.jar
    30. -rw-r--r-- 1 root root 5185558 10月 25 01:52 connector-http-onesignal-2.3.1.jar
    31. -rw-r--r-- 1 root root 5185309 10月 25 01:54 connector-http-wechat-2.3.1.jar
    32. -rw-r--r-- 1 root root 168487797 10月 25 02:45 connector-hudi-2.3.1.jar
    33. -rw-r--r-- 1 root root 29383607 10月 25 02:49 connector-iceberg-2.3.1.jar
    34. -rw-r--r-- 1 root root 3444329 10月 25 02:49 connector-influxdb-2.3.1.jar
    35. -rw-r--r-- 1 root root 5780985 10月 25 02:50 connector-iotdb-2.3.1.jar
    36. -rw-r--r-- 1 root root 288042 10月 25 02:50 connector-jdbc-2.3.1.jar
    37. -rw-r--r-- 1 root root 13731460 10月 25 02:53 connector-kafka-2.3.1.jar
    38. -rw-r--r-- 1 root root 25520058 10月 25 02:54 connector-kudu-2.3.1.jar
    39. -rw-r--r-- 1 root root 20540761 10月 25 02:55 connector-maxcompute-2.3.1.jar
    40. -rw-r--r-- 1 root root 2419398 10月 25 02:56 connector-mongodb-2.3.1.jar
    41. -rw-r--r-- 1 root root 5070244 10月 25 02:57 connector-neo4j-2.3.1.jar
    42. -rw-r--r-- 1 root root 148797758 10月 25 03:11 connector-openmldb-2.3.1.jar
    43. -rw-r--r-- 1 root root 42273251 10月 25 03:11 connector-pulsar-2.3.1.jar
    44. -rw-r--r-- 1 root root 790519 10月 25 03:11 connector-rabbitmq-2.3.1.jar
    45. -rw-r--r-- 1 root root 1331781 10月 25 03:12 connector-redis-2.3.1.jar
    46. -rw-r--r-- 1 root root 35638134 10月 25 03:16 connector-s3-redshift-2.3.1.jar
    47. -rw-r--r-- 1 root root 1623004 10月 25 03:21 connector-selectdb-cloud-2.3.1.jar
    48. -rw-r--r-- 1 root root 625274 10月 25 03:16 connector-sentry-2.3.1.jar
    49. -rw-r--r-- 1 root root 5930367 10月 25 03:17 connector-slack-2.3.1.jar
    50. -rw-r--r-- 1 root root 134855 10月 25 03:17 connector-socket-2.3.1.jar
    51. -rw-r--r-- 1 root root 20267439 10月 25 03:20 connector-starrocks-2.3.1.jar
    52. -rw-r--r-- 1 root root 10758366 10月 25 03:21 connector-tablestore-2.3.1.jar

    5.启动一个单节点SeaTunnel

    1. cd ~/seatunnel/apache-seatunnel-incubating-2.3.1
    2. nohup sh bin/seatunnel-cluster.sh 2>&1 &

    通过jps命令我们能查看进程是否已经启动,进程名为SeaTunnelServer

    6.使用自带例子测试任务

            在config目录下有一个自带的实时同步任务的配置文件v2.streaming.conf.template,该文件定义了一个作业,使用一个叫FakeSource的Source连接器生成数据,并将数据发送给Console这个Sink,Console Sink的作用是将接收到的数据打印到控制台。

            所以运行该作业可以看到在控制台中会打印数据,因为是实时作业,该作业不会自动停止,v2.streaming.conf.template文件的内容如下:

    1. #
    2. # Licensed to the Apache Software Foundation (ASF) under one or more
    3. # contributor license agreements. See the NOTICE file distributed with
    4. # this work for additional information regarding copyright ownership.
    5. # The ASF licenses this file to You under the Apache License, Version 2.0
    6. # (the "License"); you may not use this file except in compliance with
    7. # the License. You may obtain a copy of the License at
    8. #
    9. # http://www.apache.org/licenses/LICENSE-2.0
    10. #
    11. # Unless required by applicable law or agreed to in writing, software
    12. # distributed under the License is distributed on an "AS IS" BASIS,
    13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    14. # See the License for the specific language governing permissions and
    15. # limitations under the License.
    16. #
    17. ######
    18. ###### This config file is a demonstration of streaming processing in Seatunnel config
    19. ######
    20. env {
    21. # You can set flink configuration here
    22. execution.parallelism = 2
    23. job.mode = "STREAMING"
    24. checkpoint.interval = 2000
    25. #execution.checkpoint.interval = 10000
    26. #execution.checkpoint.data-uri = "hdfs://localhost:9000/checkpoint"
    27. }
    28. source {
    29. # This is a example source plugin **only for test and demonstrate the feature source plugin**
    30. FakeSource {
    31. parallelism = 2
    32. result_table_name = "fake"
    33. row.num = 16
    34. schema = {
    35. fields {
    36. name = "string"
    37. age = "int"
    38. }
    39. }
    40. }
    41. # If you would like to get more information about how to configure Seatunnel and see full list of source plugins,
    42. # please go to https://seatunnel.apache.org/docs/category/source-v2
    43. }
    44. sink {
    45. Console {
    46. }
    47. # If you would like to get more information about how to configure Seatunnel and see full list of sink plugins,
    48. # please go to https://seatunnel.apache.org/docs/category/sink-v2

             执行该demo作业:

    1. cd ~/seatunnel/apache-seatunnel-incubating-2.3.1
    2. sh bin/seatunnel.sh --config config/v2.streaming.conf.template

            运行结果

    1. ***********************************************
    2. Job Id : 769365937475289089
    3. Read Count So Far : 32
    4. Write Count So Far : 32
    5. Average Read Count : 0/s
    6. Average Write Count : 0/s
    7. Last Statistic Time : 2023-10-25 09:23:34
    8. Current Statistic Time : 2023-10-25 09:24:34
    9. ***********************************************
    10. 2023-10-25 09:25:33,998 INFO org.apache.seatunnel.engine.client.job.JobMetricsRunner -
    11. ***********************************************
    12. Job Progress Information
    13. ***********************************************
    14. Job Id : 769365937475289089
    15. Read Count So Far : 32
    16. Write Count So Far : 32
    17. Average Read Count : 0/s
    18. Average Write Count : 0/s
    19. Last Statistic Time : 2023-10-25 09:24:34
    20. Current Statistic Time : 2023-10-25 09:25:33
    21. ***********************************************

            说明作业正常运行,通过Control+C结束该作业,中止作业运行,SeaTunnel部署及验证完成。

  • 相关阅读:
    论文精读(保姆级解析)——DiFaReli: Diffusion Face Relighting
    【计算机网络】TCP报文详解
    万亿咖啡赛道或将再出一个IPO?窄门入局、宽门出圈的它,做对了什么?
    AIE荧光性质温温敏性水凝胶纳米微球PS-co-PNIPAM/银纳米团簇与吡啶羧酸AIE水凝胶的制备
    【 OpenGauss源码学习 —— 列存储(CStoreAllocator 类)】
    Vue3如何封装组件?
    HarmonyOS应用开发-RushOrm体验
    热分析技术在工业设备状态监测中的应用
    git强制推送代码教程
    container_of解析及应用
  • 原文地址:https://blog.csdn.net/jiedaodezhuti/article/details/134026735