英文:
spark 3 error java.lang.UnsatisfiedLinkError: no zstd-jni in java.library.path
问题
After installing Spark3 on Red Hat 7, everything seems to be running fine.
os.environ['SPARK_HOME'] = "/users/spark/spark-3.0.0-bin-hadoop3.2"
os.environ['JAVA_HOME'] = "/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.222.b10-0.el7_6.x86_64/jre"
However, when attempting a simple join with dat.join(ids_df, on=['symbol']).show(), an error occurred. Can someone assist? Many thanks.
Exception in thread "map-output-dispatcher-0" java.lang.UnsatisfiedLinkError: no zstd-jni in java.library.path
Unsupported OS/arch, cannot find /linux/amd64/libzstd-jni.so or load zstd-jni from system libraries. Please try building from source the jar or providing libzstd-jni in your system.
    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 com.github.luben.zstd.util.Native.load(Native.java:108)
    at com.github.luben.zstd.util.Native.load(Native.java:60)
    at com.github.luben.zstd.ZstdOutputStream.<clinit>(ZstdOutputStream.java:15)
    at org.apache.spark.io.ZStdCompressionCodec.compressedOutputStream(CompressionCodec.scala:224)
    at org.apache.spark.MapOutputTracker$.serializeMapStatuses(MapOutputTracker.scala:913)
    at org.apache.spark.ShuffleStatus.$anonfun$serializedMapStatus$2(MapOutputTracker.scala:210)
    at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
    at org.apache.spark.ShuffleStatus.withWriteLock(MapOutputTracker.scala:72)
    at org.apache.spark.ShuffleStatus.serializedMapStatus(MapOutputTracker.scala:207)
    at org.apache.spark.MapOutputTrackerMaster$MessageLoop.run(MapOutputTracker.scala:457)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
英文:
After install the Spark3 to redhat 7, everything seems to runs.
```
os.environ['SPARK_HOME'] = "/users/spark/spark-3.0.0-bin-hadoop3.2"
os.environ['JAVA_HOME'] ="/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.222.b10-0.el7_6.x86_64/jre"
```
a simple join     dat.join(ids_df, on=['symbol']).show()
hit this error. Any one can help? Many thanks.
    Exception in thread "map-output-dispatcher-0" java.lang.UnsatisfiedLinkError: no zstd-jni in java.library.path
    Unsupported OS/arch, cannot find /linux/amd64/libzstd-jni.so or load zstd-jni from system libraries. Please try building from source the jar or providing l                                         ibzstd-jni in your system.
        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 com.github.luben.zstd.util.Native.load(Native.java:108)
        at com.github.luben.zstd.util.Native.load(Native.java:60)
        at com.github.luben.zstd.ZstdOutputStream.<clinit>(ZstdOutputStream.java:15)
        at org.apache.spark.io.ZStdCompressionCodec.compressedOutputStream(CompressionCodec.scala:224)
        at org.apache.spark.MapOutputTracker$.serializeMapStatuses(MapOutputTracker.scala:913)
        at org.apache.spark.ShuffleStatus.$anonfun$serializedMapStatus$2(MapOutputTracker.scala:210)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
        at org.apache.spark.ShuffleStatus.withWriteLock(MapOutputTracker.scala:72)
        at org.apache.spark.ShuffleStatus.serializedMapStatus(MapOutputTracker.scala:207)
        at org.apache.spark.MapOutputTrackerMaster$MessageLoop.run(MapOutputTracker.scala:457)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
答案1
得分: 2
需要在RedHat 7上以root用户执行yum install命令来安装libzstd:
- 
对于64位系统
yum install libzstd.x86_64 - 
对于32位系统
yum install libzstd.i686 
英文:
You need to install the libzstd on RedHat 7 executing the yum install command with root user:
- 
For 64 bits systems
yum install libzstd.x86_64 - 
For 32 bits systems
yum install libzstd.i686 
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。


评论