apache-spark - Livy Batch API - 无法获取 jar
问题描述
我正在尝试使用 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.将文件:///更改为本地:/
我已经多次验证文件是否存在,并且每种情况下提供的路径都是有效的。
我现在没有选择了。请帮助找到解决方案。
谢谢!!
解决方案
我能够将这项工作作为纱线集群的主人。
这是我使用的 --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"
}
}
推荐阅读
- hadoop - Hive 终端在使用 INSERT 命令插入数据时挂起
- javascript - 将@click 附加到数组元素
- joomla - 从 3.8.3 升级到 3.8.7 后站点无法访问
- java - Java 在 DefaultTableModel 上创建侦听器
- ruby-on-rails - 如何在rails应用程序中使用id获取redis数据
- django - ManyToManyField 在 shell 上工作但不在服务器上
- json - getOffice365ActivationsUserDetail 图形 API 返回 UnknownTenantId
- sql - SQL - 跨 2 行匹配数据
- .htaccess - 如何去除主页的多次重定向?
- wordpress - Wordpress 自定义帖子类型将我重定向到帖子