amazon-web-services - 无法使用 RIOFS 在 EC2 上挂载 S3 - HTTP 错误:400(错误请求)
问题描述
我正在尝试使用 RIOFS 在 AWS EC2 实例上安装 S3 存储桶。我不成功。
这是日志
12:47:53 [main] (main main.c:753) Using config file: /home/ubuntu/.config/riofs/riofs.conf.xml
12:47:53 [con] (http_connection_init http_connection.c:79) [con: 0x561ff22c2be0] Connecting to s3.amazonaws.com:80
12:47:53 [con] (http_connection_make_request http_connection.c:814) [con: 0x561ff22c2be0] GET /csv-test/?acl bucket: csv-test, host: s3.amazonaws.com, out_len: 0
12:47:53 [con] (http_connection_on_response_cb http_connection.c:464) [con: 0x561ff22c2be0] Got HTTP response from server! (160msec)
12:47:53 [con] (http_connection_on_response_cb http_connection.c:544) [con: 0x561ff22c2be0] New URL: csv-test.s3.amazonaws.com
12:47:53 [con] (http_connection_init http_connection.c:79) [con: 0x561ff22c2be0] Connecting to csv-test.s3.amazonaws.com:80
12:47:53 [con] (http_connection_on_close http_connection.c:196) [con: 0x561ff22c2be0] Connection closed !
12:47:53 [con] (http_connection_make_request http_connection.c:814) [con: 0x561ff22c2be0] GET /?acl bucket: csv-test, host: csv-test.s3.amazonaws.com, out_len: 0
12:47:53 [con] (http_connection_on_close http_connection.c:196) [con: 0x561ff22c2be0] Connection closed !
12:47:53 [con] (http_connection_on_response_cb http_connection.c:464) [con: 0x561ff22c2be0] Got HTTP response from server! (9msec)
12:47:53 [con] (http_connection_on_response_cb http_connection.c:591) [con: 0x561ff22c2be0] Server returned HTTP error: 400 (Bad Request). AWS message: The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256.
12:47:53 [con] (http_connection_on_response_cb http_connection.c:602) [con: 0x561ff22c2be0] Server returned HTTP error: 400 (Bad Request)! Retry ID: 1 of 20
有没有办法启用AWS4-HMAC-SHA256
在 RIOFS 连接中的使用。我在法兰克福eu-central-1
和伦敦都在尝试这个,eu-west-2
但在这两个地区都没有成功。
我也尝试使用 s3fs 并以无法访问存储桶错误结束,但无法获得详细的日志,如 riofs 指出实际错误。
解决方案
AWS4-HMAC-SHA256 是签名版本 4,只有少数地区支持它。我对法兰克福 eu-central-1 和伦敦 eu-west-2 进行了测试。这两个区域都不起作用。它仅适用于 US-EAST-1 N. Virginia 地区。
我可以在 EC2 上成功挂载在 us-east-1 上创建的 S3 存储桶。
推荐阅读
- html - 从 RoR 控制器中的 html 获取数据的问题
- python - 视图中的返回语句应该结束还是中间?
- android - Android片段:我使用xml定义提示或文本:当我想动态更新文本或提示时,新文本重叠
- swift - observable.observeOn() 和公共资源的并发问题
- azure-devops - Azure DevOps 管道:取消队列中的多个挂起作业
- python - 为什么我们需要 Huggingface Transformers 的 BERT 预训练模型中的 init_weight 函数?
- php - MySQL 销售数据库一致性:排队事务?
- python - IntelliJ 中的“移动”重构不适用于输入
- asp.net-core-webapi - 未为内部服务器错误响应 ASP.NET Core 3.1 设置 CORS 标头
- c - 无法让我的程序打印“用法:./caesar”