环境和配置说明:
1、2台mysql之间做迁移
2、在mysqlreader端部署了datax,然后希望能迁移到writer端。
3、2台服务器上mysql已经互相开放权限且网络正常,能连接成功。
4、reader端是lamp环境 ,writer端为wamp环境 。
5、datax配置信息如下:
{
"job": {
"content": [
{
"reader": {
"name": "mysqlreader",
"parameter": {
"username": "root",
"password": "123",
"column": ["id","name","body","url","listurl","detailurl","demo","status","listbegin","listend","listitempat","musthave","listurlpat","listurlreplace","nohave","listtype","curlPost","pagename","detailmust","detailno","ifhandleadd","ifallok","updatezq","daarea","area","province","city","qu","money","zhuti","lxglf","time_duan","is_fenduan","tel_to","dizhi","re_dizhi","start_line_time","end_line_time","end_for","is_tongji"],
"splitPk": "id",
"connection": [
{
"jdbcUrl": ["jdbc:mysql://192.168.1.124:3306/dla"],
"table": ["lzh_sitelist"]
}
],
"where": "id<3000"
}
},
"writer": {
"name": "mysqlwriter",
"parameter": {
"writeMode": "insert",
"username": "root",
"password": "123",
"column": ["id","name","body","url","listurl","detailurl","demo","status","listbegin","listend","listitempat","musthave","listurlpat","listurlreplace","nohave","listtype","curlPost","pagename","detailmust","detailno","ifhandleadd","ifallok","updatezq","daarea","area","province","city","qu","money","zhuti","lxglf","time_duan","is_fenduan","tel_to","dizhi","re_dizhi","start_line_time","end_line_time","end_for","is_tongji"],
"connection": [
{
"jdbcUrl": "jdbc:mysql://192.168.1.128:3306/dla",
"table": ["lzh_sitelist"]
}
],
}
}
}
],
"setting": {
"speed": {
"channel": "2"
}
}
}
}
故障报错:
1、中途有报错 Field 'body' doesn't have a default value 。
2、之后插入时部分数据插入成功 还有部分数据报错 脏数据... 报错截图如下
这个错误是「duplicate entry」,也就是说通过DataX写mysql表的时候,mysql报了这个错误,原因是有重复的primary key。
具体如何解决的话,可以google下duplicate entry when insert data into mysql.
补充:本来准备用datax将青岛的ECS上mysql迁移到我的ADS上的,所以用datax做了mysql到mysql的初步测试,可是...
论坛admin管理员,这不是阿里的技术讨论社区么?怎么一个question抛出去一点回应都没有,还不如工单来得实在....
社区管理员,这社区提问有什么规则或者要求么?为何我的问题无人回答?
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。