AWS ES 使用curl请求失败

  • 问题来源:使用curl工具向ES Endpoint发送请求时提示{"Message":"User: anonymous is not authorized to perform: es:ESHttpPut"}
    • 请求内容如下
    curl -XPUT es_endpoint/domain_name/_doc/1 -d '{"director": "Burton, Tim", "genre": ["Comedy","Sci-Fi"], "year": 1996, "actor": ["Jack Nicholson","Pierce Brosnan","Sarah Jessica Parker"], "title": "Mars Attacks!"}' -H 'Content-Type: application/json'
    
  • 解决方案:在access访问权限中允许当前IP访问,因为curl是直接发送请求的,不会获取到当前登陆的IAM信息
  • 获取当前机器公网IP方法:获取公网IP
  • 参考文献:User: anonymous is not authorized错误解决方案
发布了258 篇原创文章 · 获赞 332 · 访问量 13万+

猜你喜欢

转载自blog.csdn.net/qq_34829447/article/details/92612880
AWS