使用 tdengine 同步时,需要在机器上安装 libtaos.so,如果同步配置采用 td-reader 写到 td-writer 中,会加载同一个本地类库,报错如下:
`经DataX智能分析,该任务最可能的错误原因是:
com.alibaba.datax.common.exception.DataXException: Code:[Framework-13], Description:[DataX插件运行时出错, 具体原因请参看DataX运行结束时的错误诊断信息 .]. - java.lang.UnsatisfiedLinkError: Native Library /usr/local/taos/driver/libtaos.so.2.4.0.30 already loaded in another classloader
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1900)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1850)
at java.lang.Runtime.loadLibrary0(Runtime.java:871)
at java.lang.System.loadLibrary(System.java:1124)
at com.taosdata.jdbc.TSDBJNIConnector.(TSDBJNIConnector.java:28)
at com.taosdata.jdbc.TSDBDriver.connect(TSDBDriver.java:130)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at com.alibaba.datax.plugin.writer.tdenginewriter.DefaultDataHandler.handle(DefaultDataHandler.java:75)
at com.alibaba.datax.plugin.writer.tdenginewriter.TDengineWriter$Task.startWrite(TDengineWriter.java:109)
at com.alibaba.datax.core.taskgroup.runner.WriterRunner.run(WriterRunner.java:56)
at java.lang.Thread.run(Thread.java:750)
java.lang.UnsatisfiedLinkError: Native Library /usr/local/taos/driver/libtaos.so.2.4.0.30 already loaded in another classloader
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1900)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1850)
at java.lang.Runtime.loadLibrary0(Runtime.java:871)
at java.lang.System.loadLibrary(System.java:1124)
at com.taosdata.jdbc.TSDBJNIConnector.(TSDBJNIConnector.java:28)
at com.taosdata.jdbc.TSDBDriver.connect(TSDBDriver.java:130)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at com.alibaba.datax.plugin.writer.tdenginewriter.DefaultDataHandler.handle(DefaultDataHandler.java:75)
at com.alibaba.datax.plugin.writer.tdenginewriter.TDengineWriter$Task.startWrite(TDengineWriter.java:109)
at com.alibaba.datax.core.taskgroup.runner.WriterRunner.run(WriterRunner.java:56)
at java.lang.Thread.run(Thread.java:750)
at com.alibaba.datax.common.exception.DataXException.asDataXException(DataXException.java:40)
at com.alibaba.datax.core.job.scheduler.processinner.ProcessInnerScheduler.dealFailedStat(ProcessInnerScheduler.java:39)
at com.alibaba.datax.core.job.scheduler.AbstractScheduler.schedule(AbstractScheduler.java:99)
at com.alibaba.datax.core.job.JobContainer.schedule(JobContainer.java:534)
at com.alibaba.datax.core.job.JobContainer.start(JobContainer.java:119)
at com.alibaba.datax.core.Engine.start(Engine.java:92)
at com.alibaba.datax.core.Engine.entry(Engine.java:171)
at com.alibaba.datax.core.Engine.main(Engine.java:204)
Caused by: java.lang.UnsatisfiedLinkError: Native Library /usr/local/taos/driver/libtaos.so.2.4.0.30 already loaded in another classloader
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1900)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1850)
at java.lang.Runtime.loadLibrary0(Runtime.java:871)
at java.lang.System.loadLibrary(System.java:1124)
at com.taosdata.jdbc.TSDBJNIConnector.(TSDBJNIConnector.java:28)
at com.taosdata.jdbc.TSDBDriver.connect(TSDBDriver.java:130)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at com.alibaba.datax.plugin.writer.tdenginewriter.DefaultDataHandler.handle(DefaultDataHandler.java:75)
at com.alibaba.datax.plugin.writer.tdenginewriter.TDengineWriter$Task.startWrite(TDengineWriter.java:109)
at com.alibaba.datax.core.taskgroup.runner.WriterRunner.run(WriterRunner.java:56)
at java.lang.Thread.run(Thread.java:750)`
使用 tdengine 同步时,需要在机器上安装 libtaos.so,如果同步配置采用 td-reader 写到 td-writer 中,会加载同一个本地类库,报错如下: `经DataX智能分析,该任务最可能的错误原因是: com.alibaba.datax.common.exception.DataXException: Code:[Framework-13], Description:[DataX插件运行时出错, 具体原因请参看DataX运行结束时的错误诊断信息 .]. - java.lang.UnsatisfiedLinkError: Native Library /usr/local/taos/driver/libtaos.so.2.4.0.30 already loaded in another classloader at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1900) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1850) at java.lang.Runtime.loadLibrary0(Runtime.java:871) at java.lang.System.loadLibrary(System.java:1124) at com.taosdata.jdbc.TSDBJNIConnector.(TSDBJNIConnector.java:28)
at com.taosdata.jdbc.TSDBDriver.connect(TSDBDriver.java:130)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at com.alibaba.datax.plugin.writer.tdenginewriter.DefaultDataHandler.handle(DefaultDataHandler.java:75)
at com.alibaba.datax.plugin.writer.tdenginewriter.TDengineWriter$Task.startWrite(TDengineWriter.java:109)
at com.alibaba.datax.core.taskgroup.runner.WriterRunner.run(WriterRunner.java:56)
at java.lang.Thread.run(Thread.java:750)
java.lang.UnsatisfiedLinkError: Native Library /usr/local/taos/driver/libtaos.so.2.4.0.30 already loaded in another classloader at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1900) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1850) at java.lang.Runtime.loadLibrary0(Runtime.java:871) at java.lang.System.loadLibrary(System.java:1124) at com.taosdata.jdbc.TSDBJNIConnector.(TSDBJNIConnector.java:28)
at com.taosdata.jdbc.TSDBDriver.connect(TSDBDriver.java:130)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at com.alibaba.datax.plugin.writer.tdenginewriter.DefaultDataHandler.handle(DefaultDataHandler.java:75)
at com.alibaba.datax.plugin.writer.tdenginewriter.TDengineWriter$Task.startWrite(TDengineWriter.java:109)
at com.alibaba.datax.core.taskgroup.runner.WriterRunner.run(WriterRunner.java:56)
at java.lang.Thread.run(Thread.java:750)
at com.alibaba.datax.common.exception.DataXException.asDataXException(DataXException.java:40) at com.alibaba.datax.core.job.scheduler.processinner.ProcessInnerScheduler.dealFailedStat(ProcessInnerScheduler.java:39) at com.alibaba.datax.core.job.scheduler.AbstractScheduler.schedule(AbstractScheduler.java:99) at com.alibaba.datax.core.job.JobContainer.schedule(JobContainer.java:534) at com.alibaba.datax.core.job.JobContainer.start(JobContainer.java:119) at com.alibaba.datax.core.Engine.start(Engine.java:92) at com.alibaba.datax.core.Engine.entry(Engine.java:171) at com.alibaba.datax.core.Engine.main(Engine.java:204) Caused by: java.lang.UnsatisfiedLinkError: Native Library /usr/local/taos/driver/libtaos.so.2.4.0.30 already loaded in another classloader at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1900) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1850) at java.lang.Runtime.loadLibrary0(Runtime.java:871) at java.lang.System.loadLibrary(System.java:1124) at com.taosdata.jdbc.TSDBJNIConnector.(TSDBJNIConnector.java:28)
at com.taosdata.jdbc.TSDBDriver.connect(TSDBDriver.java:130)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at com.alibaba.datax.plugin.writer.tdenginewriter.DefaultDataHandler.handle(DefaultDataHandler.java:75)
at com.alibaba.datax.plugin.writer.tdenginewriter.TDengineWriter$Task.startWrite(TDengineWriter.java:109)
at com.alibaba.datax.core.taskgroup.runner.WriterRunner.run(WriterRunner.java:56)
at java.lang.Thread.run(Thread.java:750)`
job 配置如下:
{ "job": { "content": [{ "reader": { "name": "tdenginereader", "parameter": { "username": "root", "password": "taosdata", "connection": [ { "querySql": [ "select * from power.d1001" ], "jdbcUrl": [ "jdbc:TAOS://bigdata7:6030?timestampFormat=TIMESTAMP" ] } ] } }, "writer": { "name": "tdenginewriter", "parameter": { "username": "root", "password": "taosdata", "column": [ "ts", "c", "v", "p" ], "connection": [ { "table": [ "meters1" ], "jdbcUrl": "jdbc:TAOS://bigdata7:6030/power1" } ], "batchSize": 100, "ignoreTagsUnmatched": true } } }], "setting": { "speed": { "channel": 1 } } } }
请问需要怎么配置 libtaos.so 才能让它只加载一次?