Я пытаюсь заставить sqoop работать с sqlanywhere17 sajdbc4.jar
. Я продолжаю получать библиотечные ошибки для команды, так как я не могу найти .so
связанных файлов, необходимых с jar.
Теперь я создал символическую ссылку на sajdbc4.jar -> /opt/sqlanywhere17/java/sajdbc4.jar
внутри /usr/hdp/current/sqoop-client/lib/
.
ln -s /opt/sqlanywhere17/java/sajdbc4.jar /usr/hdp/current/sqoop-client/lib/sajdbc4.jar
Я получаю эту ошибку:
Исключение в потоке "main" java.lang.UnsatisfiedLinkError: нет dbjdbc17 в java.library. путь
После следования этого руководства и этой документации :
cat /opt/sqlanywhere17/bin64/sa_config.sh >> ~/.bashrc
cat /opt/sqlanywhere17/bin64/sa_config.sh >> ~/.bash_profile
И проверки echo $LD_LIBRARY_PATH
:
/opt/sqlanywhere17/lib64:/opt/sqlanywhere17/bin64/jre180/lib/amd64/client:/opt/sqlanywhere17/bin64/jre180/lib/amd64/server:/opt/sqlanywhere17/bin64/jre180/lib/amd64:/opt/sqlanywhere17/bin64/jre180/lib/amd64/native_threads:
И проверка java.library.path для: /opt/sqlanywhere17/lib64
java -XshowSettings:properties
Property settings:
awt.toolkit = sun.awt.X11.XToolkit
com.sap.vm.codeline = 81_REL
com.sap.vm.compressedoops = true
com.sap.vm.profilingserver = true
com.sap.vm.type = opt
com.sap.vm.version = 10
file.encoding = UTF-8
file.encoding.pkg = sun.io
file.separator = /
java.awt.graphicsenv = sun.awt.X11GraphicsEnvironment
java.awt.printerjob = sun.print.PSPrinterJob
java.class.path = .
java.class.version = 52.0
java.endorsed.dirs = /opt/sqlanywhere17/bin64/jre180/lib/endorsed
java.ext.dirs = /opt/sqlanywhere17/bin64/jre180/lib/ext-sap
/opt/sqlanywhere17/bin64/jre180/lib/ext
/usr/java/packages/lib/ext
java.home = /opt/sqlanywhere17/bin64/jre180
java.io.tmpdir = /tmp
java.library.path = /opt/sqlanywhere17/lib64
/opt/sqlanywhere17/bin64/jre180/lib/amd64/client
/opt/sqlanywhere17/bin64/jre180/lib/amd64/server
/opt/sqlanywhere17/bin64/jre180/lib/amd64
/opt/sqlanywhere17/bin64/jre180/lib/amd64/native_threads
/usr/java/packages/lib/amd64
/usr/lib64
/lib64
/lib
/usr/lib
Полная ошибка:
19/10/22 08:30:05 INFO sqoop.Sqoop: Running Sqoop version: 1.4.6.2.5.3.0-37
19/10/22 08:30:07 WARN sqoop.ConnFactory: Parameter --driver is set to an explicit driver however appropriate connection manager is not being set (via --connection-manager). Sqoop is going to fall back to org.apache.sqoop.manager.GenericJdbcManager. Please specify explicitly which connection manager should be used next time.
19/10/22 08:30:07 INFO manager.SqlManager: Using default fetchSize of 1000
Exception in thread "main" java.lang.UnsatisfiedLinkError: no dbjdbc17 in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at sap.jdbc4.sqlanywhere.IDriver.try_load(IDriver.java:451)
at sap.jdbc4.sqlanywhere.IDriver.<clinit>(IDriver.java:413)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at org.apache.sqoop.manager.SqlManager.makeConnection(SqlManager.java:873)
at org.apache.sqoop.manager.GenericJdbcManager.getConnection(GenericJdbcManager.java:52)
at org.apache.sqoop.tool.EvalSqlTool.run(EvalSqlTool.java:64)
at org.apache.sqoop.Sqoop.run(Sqoop.java:147)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:76)
at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:183)
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:225)
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:234)
at org.apache.sqoop.Sqoop.main(Sqoop.java:243)
[root@server1 dag_scripts]# echo $LD_LIBRARY_PATH
/opt/sqlanywhere17/lib64:/opt/sqlanywhere17/bin64/jre180/lib/amd64/client:/opt/sqlanywhere17/bin64/jre180/lib/amd64/server:/opt/sqlanywhere17/bin64/jre180/lib/amd64:/opt/sqlanywhere17/bin64/jre180/lib/amd64/native_threads:
Единственный обходной путь, который я нашел, это изменение каталога перед запуском команды, это работает:
cd /opt/sqlanywhere17/lib64
sqoop eval --connect 'jdbc:sqlanywhere:Host=xxx.xx.xx.xxx:2638' --driver sap.jdbc4.sqlanywhere.IDriver --username user --password-file /tmp/pwfile --query "SELECT * from db.table"