暂无图片
暂无图片
暂无图片
暂无图片
暂无图片
dolphinscheduler配置datax .pdf
94
19页
0次
2023-06-24
5墨值下载
dolphinscheduler配置datax
1、安装datax
2datax同步MySQL数据
[root@datax ~]# yum install java-1.8.0-openjdk java-1.8.0-openjdk-devel
[root@datax ~]# wget https://datax-opensource.oss-cn-
hangzhou.aliyuncs.com/202303/datax.tar.gz
[root@datax ~]# tar xzf datax.tar.gz -C /usr/local/
[root@datax ~]# chmod -R 755 /usr/local/datax
[root@datax ~]# echo "export PATH=\$PATH:/usr/local/datax/bin" >>/etc/profile
[root@datax ~]# source /etc/profile
--新建源表
create database test1;
use test1;
CREATE TABLE `t_user_info` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) DEFAULT NULL,
`content` text,
`createdate` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
INSERT INTO `test1`.`t_user_info` (`id`, `name`, `content`, `createdate`) VALUES
('1', 'linux重启mysql的命令', 'linux重启mysql的命令', '2020-04-19 21:18:58');
INSERT INTO `test1`.`t_user_info` (`id`, `name`, `content`, `createdate`) VALUES
('2', 'jQueryinput绑定回车事件', 'jQueryinput绑定回车事件', '2020-04-20
21:19:14');
INSERT INTO `test1`.`t_user_info` (`id`, `name`, `content`, `createdate`) VALUES
('3', 'Web开发Session超时设置', 'Web开发Session超时设置', '2020-04-21 21:19:19');
--新建目标表
create database test2;
use test2;
CREATE TABLE `t_user_info` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) DEFAULT NULL,
`content` text,
`createdate` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--新建同步用户
create user test@'%' identified by '123456';
grant all on *.* to test@'%';
flush privileges;
--编写同步job
[root@datax ~]# cat /usr/local/datax/job/mysql_2_mysql.json
{
 "job": {
   "setting": {
     "speed": {
       "channel": 1
     }
   },
   "content": [
     {
       "reader": {
         "name": "mysqlreader",
         "parameter": {
           "username": "test",
           "password": "123456",
           "column": [ "id", "name","content" ,"createdate"],
           "splitPk": "id",
           "connection": [
             {
               "table": [
                 "t_user_info"
               ],
               "jdbcUrl": [
                 "jdbc:mysql://192.168.100.82:3306/test1?
useSSL=false"
               ]
             }
           ]
         }
       },
       "writer": {
         "name": "mysqlwriter",
         "parameter": {
           "writeMode": "insert",
           "username": "test",
           "password": "123456",
           "column": [ "id", "name","content","createdate"],
           "session": [
             "set session sql_mode='ANSI'"
           ],
           "connection": [
             {
               "jdbcUrl":
"jdbc:mysql://192.168.100.82:3306/test2?useSSL=false",
               "table": [
                 "t_user_info"
               ]
             }
           ]
of 19
5墨值下载
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文档的来源(墨天轮),文档链接,文档作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论

关注
最新上传
暂无内容,敬请期待...
下载排行榜
Top250 周榜 月榜