MySQL SQL

Overview

Currently, Agent supports MYSQL version 5.1.x , 5.5.x , 5.6.x , 5.7.x , 8.0.x Currently, the Agent only supports the curl request to create a Job to submit collection tasks, and temporarily does not support the manager front-end to create SQL collection

Create A MySQL Job

  1. Apply for access on the manager, when filling in the data information, select the message source as “Independent Push”
  2. Select the source data field separator
  3. Fill in the source data fields, and the field order should be consistent with the field order in the sql query result
  4. Create a SQL read task using curl request

Parameter Description

  1. Each parameter used in SQL Agent Job is described as
  2. 1. job.sql.command: The actual executed sql statement, for example: select * from apache_inlong_manager.user
  3. 2. job.sql.user: the user used when connecting to the database, for example: abc
  4. 3. job.sql.password: The password used when connecting to the database, for example: 123456
  5. 4. job.sql.hostname: The IP address of the connected database, for example: 127.0.0.1
  6. 5. job.sql.port: the connected database port, for example: 3306
  7. 6. job.sql.separator: The separator used to separate multiple fields needs to be used with the manager front-end

Example

  1. curl --location --request POST 'http://localhost:8008/config/job' \--header 'Content-Type: application/json' \--data '{
  2. "job": {
  3. "sql": {
  4. "command": "select * from apache_inlong_manager.user",
  5. "user": "root",
  6. "password": "inlong",
  7. "hostname": "10.0.0.6",
  8. "port": "3306",
  9. "separator": "|"
  10. },
  11. "id": 1,
  12. "thread": {
  13. "running": {
  14. "core": "4"
  15. }
  16. },
  17. "name": "test",
  18. "source": "org.apache.inlong.agent.plugin.sources.DataBaseSource",
  19. "sink": "org.apache.inlong.agent.plugin.sinks.ProxySink",
  20. "channel": "org.apache.inlong.agent.plugin.channel.MemoryChannel"
  21. },
  22. "proxy": {
  23. "inlongGroupId": "b_test_tube_hive_20211221_01",
  24. "inlongStreamId": "test_data_stream_20211221_01_01"
  25. },
  26. "op": "add"
  27. }
  28. '