Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using rest-api to submit job is failed. #6794

Open
pppeace opened this issue May 6, 2024 Discussed in #6793 · 0 comments
Open

Using rest-api to submit job is failed. #6794

pppeace opened this issue May 6, 2024 Discussed in #6793 · 0 comments

Comments

@pppeace
Copy link

pppeace commented May 6, 2024

Discussed in #6793

Originally posted by pppeace May 4, 2024
When I using rest-api to submit a job (mysql2mysql, a simple job), it's failure. And the response is {"status":"fail","message":"null"}

Here are the steps that I did

-- mysql 准备数据表
mysql -h xxx -uroot -proot

mysql> use test;

mysql> create table st_src(id int, name varchar(255));
Query OK, 0 rows affected (0.32 sec)

mysql> create table st_sink like st_src;
Query OK, 0 rows affected (0.25 sec)

mysql> insert into st_src values(1, 'A');
Query OK, 1 row affected (0.03 sec)

mysql> insert into st_src values(2, 'B');
Query OK, 1 row affected (0.09 sec)

mysql> insert into st_src values(3, 'C');
Query OK, 1 row affected (0.03 sec)

================================================================================================================================================================================================================================================
-- seatunnel version: 2.3.3
-- seatunnel api.conf

# Set the basic configuration of the task to be performed
env {
  execution.parallelism = 1
  job.mode = "BATCH"
}

source {
  Jdbc {
    url = "jdbc:mysql://xxx:3306/test"
    driver = "com.mysql.cj.jdbc.Driver"
    user = "root"
    password = "root"
    query = "select * from st_src"
  }
}

sink {
  Jdbc {
        url = "jdbc:mysql://xxx:3306/test"
        driver = "com.mysql.cj.jdbc.Driver"
        user = "root"
        password = "root"
        database = "test"
        table = "st_sink"
        query = "insert into st_sink values(?,?)"
  }
}

================================================================================================================================================================================================================================================
-- 启动集群
./bin/seatunnel-cluster.sh -d

-- 查看集群服务
jps | grep SeaTunnelServer

-- 集群模式提交任务
./bin/seatunnel.sh --config config/api.conf

***********************************************
           Job Statistic Information
***********************************************
Start Time                : 2024-05-04 20:14:00
End Time                  : 2024-05-04 20:14:04
Total Time(s)             :                   3
Total Read Count          :                   3
Total Write Count         :                   3
Total Failed Count        :                   0
***********************************************

-- 这里可以确认 seatunnel cluster 配置和任务 conf 都没有问题

================================================================================================================================================================================================================================================

-- Rest-api
---- 获取所有运行中任务(成功,空列表)
curl -X GET http://localhost:5801/hazelcast/rest/maps/running-jobs

---- 获取所有已完成任务(无信息,未报错)
curl -X GET http://localhost:5801/hazelcast/rest/maps/finished-jobs/

---- 获取系统监控指标信息(成功)
curl -X GET http://localhost:5801/hazelcast/rest/maps/system-monitoring-information | jq

---- 提交任务
curl -X POST http://localhost:5801/hazelcast/rest/maps/submit-job \
     -H "Content-Type: application/json" \
     --data '{
    "env":{
        "job.mode":"batch"
    },
    "source":[
        {
            "plugin_name":"Jdbc",
            "url":"jdbc:mysql://xxx:3306/test",
            "driver":"com.mysql.cj.jdbc.Driver",
            "user":"root",
            "password":"root",
            "query":"select * from st_src"
        }
    ],
    "transform":[

    ],
    "sink":[
        {
            "plugin_name":"Jdbc",
            "url":"jdbc:mysql://xxx:3306/test",
            "driver":"com.mysql.cj.jdbc.Driver",
            "user":"root",
            "password":"root",
            "database":"test",
            "table":"st_sink",
            "query":"insert into st_sink values(?,?)"
        }
    ]
}'

---- response
{"status":"fail","message":"null"}

I also tried to find the logs to get more information, but there is nothing in ${SEATUNNEL_HOME}/logs/seatunnel-engine-server.log(just some 'Job info detail', seems cycle).

Anybody can help with this? pretty thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant