ECS:多数のオブジェクトを含むS3バケットを削除する方法
Summary: S3バケットには多くのオブジェクトがありますが、削除する必要があります。この記事では、バケットからすべてのオブジェクトを削除し、最後にバケットを削除する方法について説明します。
Instructions
以下の操作の制限事項:
- ECS保存中のオブジェクトは削除できません。
- オブジェクト ロックの保存下にあるオブジェクトは削除できません。
- ファイル システムが有効なバケットには、バージョン3.8.1以降が必要です。
推奨オプション: バージョン3.8以降:
ECSソフトウェアのバージョン3.8で、Dellは簡素化されたバケット削除を導入しました。REST APIを使用してオブジェクトとバケットを削除したり、 空のバケットS3文字列を使用して削除したりできるようになりました。 x-emc-headersの詳細を確認してください。デル・テクノロジーズでは、3.8へのアップグレードを推奨しています。また、簡素化されたバケット削除を使用して、ライフサイクルを削除します。
ECS UIを使用した「簡素化されたバケット削除」の使用(3.8.1.0以降が必要)
バージョン3.8.1.x以降では、適切な権限を持つECS UIからバケットとそのコンテンツを削除できます。バケットを参照し、ドロップダウンから [Delete]を選択します。[Delete ENTIRE contents including the selected bucket]を選択して確定します。

REST APIを使用した簡素化されたバケット削除の使用。
最新の REST APIガイドを参照してください。

ECSからcurlを使用してREST APIコールを送信する例:
コマンド:
# curl -k -H "$token" -X POST https://<hostname-or-ip>:4443/object/bucket/<bucketname>/deactivate?namespace=<namespace>\&emptyBucket=true
Example:
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 -
Example:
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の詳細を確認してください。
x-emc headers 現時点では完全には機能していません。
s3curl は、GitHubのローカル インストール用に入手できます。このバージョンは、 x-emc-headers https://github.com/EMCECS/s3curl/blob/master/s3curl.pl の修正バージョン
s3curl.pl は将来のバージョンでECSコードに追加される予定で、このKBはアップデートされています。
「When(時間)」
s3curl が設定されている場合は、次の手順に進みます。データは復元できないことに注意してください。
- を使用したシンプルなバケット削除の開始
s3curlが使用するJava Runtime Environmentへのパスを定義します。
./s3curl --id=<alias> --DELETE -- http://<hostname-or-ip>:9020/<bucketname> -H "x-emc-empty-bucket:true"
Example:
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 -
Example:
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より前のコード バージョンの場合は、アップグレードして上記のオプションを使用可能にします。