【发布时间】:2020-04-08 00:32:05
【问题描述】:
我正在尝试使用 Livy Batch API 来调用我的 Spark 应用程序。
curl -X POST -d '{"file": "file:///path to file/SampleSparkProject-0.0.2-SNAPSHOT.jar","className": "App","args": ["abc"],"jars": [],"driverMemory": "16g","executorMemory": "8g","executorCores": 2,"numExecutors": 2,"queue": "default","name": "Livy_sample_prog"}' -H "Content-Type: application/json" http://serverip:8998/batches/
POST/batches 失败并出现以下错误:
"Warning: Local jar /path to file/SampleSparkProject-0.0.2-SNAPSHOT.jar does not exist, skipping.",
"java.lang.ClassNotFoundException: App",
以下是我目前尝试过的各种方法
1.上传jar到HDFS
curl -X POST -d '{"file": "hdfs://path to file/SampleSparkProject-0.0.2-SNAPSHOT.jar","className": "App","args": ["abc"],"jars": [],"driverMemory": "16g","executorMemory": "8g","executorCores": 2,"numExecutors": 2,"queue": "default","name": "Livy_sample_prog"}' -H "Content-Type: application/json" http://serverip:8998/batches/
例外:
"Warning: Skip remote jar hdfs://path to file/SampleSparkProject-0.0.2-SNAPSHOT.jar.",
"java.lang.ClassNotFoundException: App"
2.添加 livy.file.local-dir-whitelist 作为包含 jar 文件的目录
3.将文件:///更改为本地:/
我已多次验证文件是否存在,并且每种情况下提供的路径都是有效的。
我现在别无选择。请帮助寻找解决方案。
谢谢!!
【问题讨论】:
-
使用 Scala,让您的生活更轻松。
标签: apache-spark livy