yarn的rest api 提交时出现的错误及解决方案
环境配置
基于ambari 2.7 安装的hdp集群
hadoop 3.1.1
yarn 3.1.1
spark2 2.3.2
通过yarn rest方式,提交application
curl -X POST http://localhost:8088/ws/v1/cluster/apps/new-application
持续返回
{“RemoteException”:{“exception”:“AuthorizationException”,“message”:“Unable to obtain user name, user not authenticated”,“javaClassName”:“org.apache.hadoop.security.authorize.AuthorizationException”}}
后修改提交参数
curl -H “Content-Type: application/json” -X POST http://localhost:8088/ws/v1/cluster/apps/new-application?user.name=spark
返回数据
{
“application-id”: “application_1548076717000_0010”,
“maximum-resource-capability”: {
“memory”: 77824,
“vCores”: 19,
“resourceInformations”: {
“resourceInformation”: [
{
“maximumAllocation”: 9223372036854775807,
“minimumAllocation”: 0,
“name”: “memory-mb”,
“resourceType”: “COUNTABLE”,
“units”: “Mi”,
“value”: 77824
},
{
“maximumAllocation”: 9223372036854775807,
“minimumAllocation”: 0,
“name”: “vcores”,
“resourceType”: “COUNTABLE”,
“units”: “”,
“value”: 19
}
]
}
}
}
- 数据已脱敏,测试过程中可能会有差异。