【问题标题】:Livy Batch API - not able to get the jarLivy Batch API - 无法获取 jar
【发布时间】: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


【解决方案1】:

我能够将这项工作作为纱线集群作为纱线的主人。

这是我使用的 --data

{
    "file": "local:/path/to/file/SampleSparkProject-0.0.2-SNAPSHOT.jar",
    "proxyUser": "nrsapp",
    "className": "App",
    "args": [
        "abc"
    ],
    "name": "Livy_sample_prog",
    "conf": {
        "spark.master": "yarn-cluster",
        "spark.deployMode": "client"
    }
}

【讨论】:

    猜你喜欢
    • 2017-02-15
    • 2020-05-03
    • 1970-01-01
    • 1970-01-01
    • 2021-08-17
    • 1970-01-01
    • 2021-08-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多