ECS:如何删除包含许多对象的 S3 存储桶
Summary: S3 存储区有许多对象,但应删除。本文介绍如何从存储区中删除所有对象,最后删除存储区。
This article applies to
This article does not apply to
This article is not tied to any specific product.
Not all product versions are identified in this article.
Instructions
注意:此过程会清空目标存储区中的所有对象。数据无法恢复,请谨慎使用。
以下作的限制:
- 无法删除 ECS 保留期 内的对象。
- 无法删除对象锁定保留期内的对象。
- 启用文件系统的存储区需要版本 3.8.1 或更高版本。
推荐的选项:版本 3.8 或更高版本:
在 ECS 软件版本 3.8 中,戴尔引入了 简化存储区删除。现在,可以使用 REST API 删除对象和存储区,或使用以下命令删除空 存储区 S3 字符串: x-emc-headers。Dell Technologies 建议升级到 3.8。以及使用简化存储区在生命周期内删除
。通过 ECS UI 使用“简化存储区删除”(需要 3.8.1.0 或更高版本)
版本 3.8.1.x 及更高版本允许使用适当的权限从 ECS UI 中删除包含内容的存储区。浏览到存储区, 然后从下拉列表中选择删除。选择 Delete ENTIRE contents including the selected bucket 并确认。

使用 REST API 进行简化存储区删除。
请查看最新的 REST API 指南作为参考。

使用 curl 从 ECS 发送 rest API 调用的示例:
命令:
# curl -k -H "$token" -X POST https://<hostname-or-ip>:4443/object/bucket/<bucketname>/deactivate?namespace=<namespace>\&emptyBucket=true
示例:
curl -v -k -H "$token" -X POST https://10.60.x.xx:4443/object/bucket/ExampleBucketRest/deactivate?namespace=b_mathias_ns\&emptyBucket=true
要监视:

命令:
# curl -k -H "$token" -X GET https://<hostname-or-ip>:4443/object/bucket/<bucketname>/empty-bucket-status?namespace=<namespace> |xmllint --format -
示例:
Started:
mathias@client:/usr/share/s3curl$ curl -k -H "$token" -X GET https://10.60.x.xx:4443/object/bucket/ExampleBucketRest/empty-bucket-status?namespace=b_mathias_ns |xmllint --format -
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<empty_bucket_status>
<status>PENDING</status>
<created>1707411798889</created>
<last_updated>1707411798889</last_updated>
<entries_deleted>0</entries_deleted>
<failed_to_delete_due_to_retention>0</failed_to_delete_due_to_retention>
<failed_to_delete_due_to_permission>0</failed_to_delete_due_to_permission>
<failed_to_delete_due_to_dangling xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
<failed_to_delete_due_to_other>0</failed_to_delete_due_to_other>
<message xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
</empty_bucket_status>
Running:
mathias@client:/usr/share/s3curl$ curl -k -H "$token" -X GET https://10.60.x.xx:4443/object/bucket/ExampleBucketRest/empty-bucket-status?namespace=b_mathias_ns |xmllint --format -
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 629 100 629 0 0 2431 0 --:--:-- --:--:-- --:--:-- 2437
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<empty_bucket_status>
<status>IN_PROGRESS</status>
<created>1707411798889</created>
<last_updated>1707411828897</last_updated>
<entries_deleted>1337</entries_deleted>
<failed_to_delete_due_to_retention>0</failed_to_delete_due_to_retention>
<failed_to_delete_due_to_permission>0</failed_to_delete_due_to_permission>
<failed_to_delete_due_to_dangling xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
<failed_to_delete_due_to_other>0</failed_to_delete_due_to_other>
<message xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
</empty_bucket_status>
Completed:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<error>
<code>1004</code>
<description>Request parameter cannot be found</description>
<details>Unable to find entity with the given id ExampleBucketRest</details>
<retryable>false</retryable>
</error>
以上错误在意料之中,因为找不到存储区。
使用 S3 进行简化存储区删除:
- 有关更多详细信息,请参阅最新的数据访问指南。
- 请参阅 v3.8 数据访问指南。
使用此选项对存储区进行寻址的最快方法是 s3curl。
注意:s3curl 已安装在 ECS 节点上,但不应将其用于此作。而
x-emc headers 目前尚未完全发挥作用。
s3curl 在 GitHub 上可用于本地安装。此版本用于包括 x-emc-headers https://github.com/EMCECS/s3curl/blob/master/s3curl.pl 修改后的版本
s3curl.pl 计划在未来的版本中添加到 ECS 代码中,此知识库文章已更新。
下载
s3curl 配置完成后,继续执行以下步骤。请记住,数据无法恢复!
- 使用 启动简化存储区删除
s3curl:
命令:
./s3curl --id=<alias> --DELETE -- http://<hostname-or-ip>:9020/<bucketname> -H "x-emc-empty-bucket:true"
示例:
mathias@client:/usr/share/s3curl$ ./s3curl.pl --id=b_mathias_iam --DELETE -- http://10.60.x.xx:9020/ExampleBucket -H "x-emc-empty-bucket:true"
监视存储区删除:
./s3curl.pl --id=<alias> http://<hostname-or-ip>:9020/<bucketname>?empty-bucket-status |xmllint --format -
示例:
mathias@client:/usr/share/s3curl$ ./s3curl.pl --id=b_mathias_iam -- http://10.60.x.xx:9020/ExampleBucket?empty-bucket-status |xmllint --format -
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 474 100 474 0 0 3128 0 --:--:-- --:--:-- --:--:-- 3139
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<EmptyBucketStatus xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<Status>PENDING</Status>
<Created>2024-02-08T16:21:53.849Z</Created>
<LastUpdated>2024-02-08T16:21:53.849Z</LastUpdated>
<EntriesDeleted>0</EntriesDeleted>
<FailedToDeleteDueToRetention>0</FailedToDeleteDueToRetention>
<FailedToDeleteDueToPermission>0</FailedToDeleteDueToPermission>
<FailedToDeleteDueToOther>0</FailedToDeleteDueToOther>
Running:
mathias@client:/usr/share/s3curl$ ./s3curl.pl --id=b_mathias_iam -- http://10.60.x.xx:9020/ExampleBucket?empty-bucket-status |xmllint --format -
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 478 100 478 0 0 3883 0 --:--:-- --:--:-- --:--:-- 3886
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<EmptyBucketStatus xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<Status>IN_PROGRESS</Status>
<Created>2024-02-08T16:21:53.849Z</Created>
<LastUpdated>2024-02-08T16:22:23.899Z</LastUpdated>
<EntriesDeleted>1304</EntriesDeleted>
<FailedToDeleteDueToRetention>0</FailedToDeleteDueToRetention>
<FailedToDeleteDueToPermission>0</FailedToDeleteDueToPermission>
<FailedToDeleteDueToOther>0</FailedToDeleteDueToOther>
</EmptyBucketStatus>
Completed:
mathias@client:/usr/share/s3curl$ ./s3curl.pl --id=b_mathias_iam -- http://10.60.x.xx:9020/ExampleBucket?empty-bucket-status |xmllint --format -
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 180 0 180 0 0 1300 0 --:--:-- --:--:-- --:--:-- 1304
<?xml version="1.0"?>
<Error>
<Code>NoSuchBucket</Code>
<Message>The specified bucket does not exist</Message>
<Resource>ExampleBucket</Resource>
<RequestId>0a3c0812:18d77e3a715:2d7:1f33</RequestId>
</Error>
对于 3.8 之前的代码版本,请升级以获得上述选项的可用性。
Affected Products
ECS ApplianceProducts
ECS ApplianceArticle Properties
Article Number: 000014767
Article Type: How To
Last Modified: 21 Aug 2025
Version: 8
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.