Relational database management system (RDBMS) Reader is a common plug-in for reading data from relational databases. You can add or register a database driver to enable RDBMS Reader to read data from various relational databases. This topic describes how to add a relational database driver for RDBMS Reader.
Prerequisites
Before you add a relational database driver, an Elastic Compute Service (ECS) instance
is purchased as your custom resource group. We recommend that you purchase an ECS instance that meets the following requirements:
- The ECS instance runs CentOS V6, CentOS V7, or AliOS.
- If you want to run MaxCompute nodes or sync nodes on the ECS instance, the ECS instance runs Python V2.6 or V2.7. CentOS V5 uses Python V2.4. Other operating systems use a Python version later than V2.6.
- The ECS instance is accessible from the Internet. To check the Internet access, send PING messages to www.aliyun.com on the ECS instance.
- We recommend that you configure the ECS instance with an 8-core CPU and 16 GB memory.
Background information
Create a custom resource group
Add a MySQL driver
Configure a sync node
You can use RDBMS Reader to configure a sync node only in the code editor. The following
sample code shows how to configure a sync node:
{
"job": {
"setting": {
"speed": {
"byte": 1048576
},
"errorLimit": {
"record": 0,
"percentage": 0.02
}
},
"content": [
{
"reader": {
"name": "rdbmsreader",
"parameter": {
"username": "xxxxx",
"password": "yyyyyy",
"column": [
"*",
],
"splitPk": "id",
"connection": [
{
"table": [
"a2"
],
"jdbcUrl": [
"jdbc:mysql://xxx.mysql.yy.aliyuncs.com:3306/xxx" // Enter the JDBC URL of your MySQL database.
]
}
],
"where": ""
}
},
"writer": { // Configure the writer as required.
"name": "streamwriter",
"parameter": {
"print": true
}
}
}
]
}
}