9.14. 정책 기반 데이터 아카이브 및 S3 호환 플랫폼으로 검색
오브젝트 라이프사이클 전환 규칙을 사용하면 한 스토리지 클래스에서 다른 S3 호환 플랫폼으로 오브젝트를 전환할 수 있습니다.
Ceph Object Gateway 라이프사이클 전환 정책을 사용하여 S3 호환 플랫폼으로 데이터를 마이그레이션할 수 있습니다.
다중 사이트 구성에서 라이프사이클 전환 규칙이 첫 번째 사이트에 적용되면 동일한 스토리지 클러스터에 있는 한 데이터 풀에서 개체를 다른 데이터 풀로 전환하기 위해 두 번째 사이트에 해당 데이터 풀이 생성되고 rgw 애플리케이션을 사용하여 활성화되는 경우 두 번째 사이트에도 동일한 규칙이 적용됩니다.
9.14.1. Amazon S3 클라우드 서비스로 데이터 전환 링크 복사링크가 클립보드에 복사되었습니다!
스토리지 클래스를 사용하여 라이프사이클 구성의 일부로 데이터를 원격 클라우드 서비스로 전환하여 비용을 줄이고 관리 효율성을 개선할 수 있습니다. 전환은 단방향이며 데이터는 원격 영역에서 다시 전환할 수 없습니다. 이 기능은 Amazon(S3)과 같은 여러 클라우드 공급자로 데이터 전환을 활성화하는 것입니다.
cloud-s3 을 계층 유형으로 사용하여 데이터를 전환해야 하는 원격 클라우드 S3 오브젝트 저장소 서비스를 구성합니다. 여기에는 데이터 풀이 필요하지 않으며 zonegroup 배치 대상의 관점에서 정의됩니다.
사전 요구 사항
시작하기 전에 다음 사전 요구 사항이 있는지 확인하십시오.
- Ceph Object Gateway가 설치된 Red Hat Ceph Storage 클러스터입니다.
- 원격 클라우드 서비스에 대한 사용자 인증 정보, Amazon S3.
- Amazon S3에서 생성된 대상 경로입니다.
-
부트스트랩 노드에
s3cmd가 설치되어 있어야 합니다. - Amazon AWS는 데이터를 다운로드하도록 로컬로 구성되었습니다.
프로세스
액세스 키와 시크릿 키가 있는 사용자를 생성합니다.
구문
radosgw-admin user create --uid=USER_NAME --display-name="DISPLAY_NAME" [--access-key ACCESS_KEY --secret-key SECRET_KEY]예
[ceph: root@host01 /]# radosgw-admin user create --uid=test-user --display-name="test-user" --access-key a21e86bce636c3aa1 --secret-key cf764951f1fdde5e { "user_id": "test-user", "display_name": "test-user", "email": "", "suspended": 0, "max_buckets": 1000, "subusers": [], "keys": [ { "user": "test-user", "access_key": "a21e86bce636c3aa1", "secret_key": "cf764951f1fdde5e" } ], "swift_keys": [], "caps": [], "op_mask": "read, write, delete", "default_placement": "", "default_storage_class": "", "placement_tags": [], "bucket_quota": { "enabled": false, "check_on_raw": false, "max_size": -1, "max_size_kb": 0, "max_objects": -1 }, "user_quota": { "enabled": false, "check_on_raw": false, "max_size": -1, "max_size_kb": 0, "max_objects": -1 }, "temp_url_keys": [], "type": "rgw", "mfa_ids": [] }Red Hat Ceph Storage 8.1 이상에서 계층 유형 옵션은
cloud-s3및cloud-s3-glacier입니다.cloud-s3을 사용하려면 다음 단계로 이동합니다. 이 단계를 사용하여cloud-s3-glacier계층 유형을 추가합니다.구문
radosgw-admin zonegroup placement add --rgw-zonegroup =ZONE_GROUP_NAME \ --placement-id=PLACEMENT_ID \ --storage-class =CLOUDTIER-GLACIER \ --tier-type=cloud-s3-glacier예
[ceph: root@host01 /]# radosgw-admin zonegroup placement add --rgw-zonegroup=default \ --placement-id=default-placement \ --storage-class=CLOUDTIER-GLACIER \ --tier-type=cloud-s3-glacier [ { "key": "CLOUDTIER-GLACIER", "val": { "tier_type": "cloud-s3-glacier", "storage_class": "CLOUDTIER-GLACIER", "retain_head_object": true, "s3": { "endpoint": "http://s3.us-east-1.amazonaws.com", "access_key": "XXXXXXXXXX", "secret": "YYYYYYYYYY", "region": "us-east-1", "host_style": "path", "target_storage_class": "GLACIER", "target_path": "rgwbucket", "acl_mappings": [], "multipart_sync_threshold": 44432, "multipart_min_part_size": 44432 }, "allow_read_through": false, "read_through_restore_days": 10, "restore_storage_class": "COLDTIER", "s3-glacier": { "glacier_restore_days": 2, "glacier_restore_tier_type": "Expedited" } } } ]부트스트랩된 노드에서 계층 유형이 있는 스토리지 클래스를
cloud-s3으로 추가합니다.참고--tier-type=cloud-s3옵션을 사용하여 스토리지 클래스를 생성하면 나중에 다른 스토리지 클래스 유형으로 수정할 수 없습니다.구문
radosgw-admin zonegroup placement add --rgw-zonegroup =ZONE_GROUP_NAME \ --placement-id=PLACEMENT_ID \ --storage-class =STORAGE_CLASS_NAME \ --tier-type=cloud-s3예
[ceph: root@host01 /]# radosgw-admin zonegroup placement add --rgw-zonegroup=default \ --placement-id=default-placement \ --storage-class=CLOUDTIER \ --tier-type=cloud-s3 [ { "key": "default-placement", "val": { "name": "default-placement", "tags": [], "storage_classes": [ "CLOUDTIER", "STANDARD" ], "tier_targets": [ { "key": "CLOUDTIER", "val": { "tier_type": "cloud-s3", "storage_class": "CLOUDTIER", "retain_head_object": "false", "s3": { "endpoint": "", "access_key": "", "secret": "", "host_style": "path", "target_storage_class": "", "target_path": "", "acl_mappings": [], "multipart_sync_threshold": 33554432, "multipart_min_part_size": 33554432 } } } ] } } ]update
storage_class:참고클러스터가 다중 사이트 설정의 일부인 경우
period update --commit를 실행하여 zonegroup 변경 사항이 다중 사이트의 모든 영역으로 전파됩니다.참고access_key및secret이 숫자로 시작하지 않는지 확인합니다.필수 매개변수는 다음과 같습니다.
access_key- 특정 연결에 사용되는 원격 클라우드 S3 액세스 키입니다.
Secret- 원격 클라우드 S3 서비스의 시크릿 키입니다.
endpoint- 원격 클라우드 S3 서비스 끝점의 URL입니다.
regionAWS의 원격 클라우드 S3 서비스 리전 이름입니다.
선택적 매개변수는 다음과 같습니다.
target_path-
대상 경로가 생성되는 방법을 정의합니다. 대상 경로는 소스
bucket-name/object-name이 추가되는 접두사를 지정합니다. 지정하지 않으면 생성된 target_path가rgwx-ZONE_GROUP_NAME-STORAGE_CLASS_NAME-cloud-bucket입니다. target_storage_class- 오브젝트가 전환되는 대상 스토리지 클래스를 정의합니다. 지정하지 않으면 오브젝트가 STANDARD 스토리지 클래스로 전환됩니다.
retain_head_object클라우드로 전환된 오브젝트의 메타데이터를 유지하려면
true로 설정합니다. 전환 후 오브젝트를 삭제하려면false로 설정합니다. 기본 설정은false입니다.참고이 옵션은 현재 버전이 지정된 오브젝트에서 무시됩니다.
multipart_sync_threshold- 다중 파트 업로드를 사용하여 이 크기 이상의 오브젝트가 클라우드로 전환되도록 지정합니다.
multipart_min_part_size- 다중 파트 업로드를 사용하여 오브젝트를 전환할 때 사용할 최소 부분 크기를 지정합니다.
glacier_restore_days-
Red Hat Ceph Storage 8.1 이상에서
cloud-s3-glacier와 함께 사용하십시오. Glacier 또는 Tape 엔드포인트에서 오브젝트를 복원할 수 있는 일 수를 지정합니다. 기본 설정은1일(1일)입니다. glacier_restore_tier_typeRed Hat Ceph Storage 8.1 이상에서
cloud-s3-glacier와 함께 사용하십시오. 복원 검색 유형을 지정합니다. 옵션은Standard또는Expedited입니다. 기본 설정은Standard입니다.구문
radosgw-admin zonegroup placement modify --rgw-zonegroup ZONE_GROUP_NAME \ --placement-id PLACEMENT_ID \ --storage-class STORAGE_CLASS_NAME \ --tier-config=endpoint=AWS_ENDPOINT_URL,\ access_key=AWS_ACCESS_KEY,secret=AWS_SECRET_KEY,\ target_path="TARGET_BUCKET_ON_AWS",\ multipart_sync_threshold=44432,\ multipart_min_part_size=44432,\ retain_head_object=true region=REGION_NAME예
[ceph: root@host01 /]# radosgw-admin zonegroup placement modify --rgw-zonegroup default --placement-id default-placement \ --storage-class CLOUDTIER \ --tier-config=endpoint=http://10.0.210.010:8080,\ access_key=a21e86bce636c3aa2,secret=cf764951f1fdde5f,\ target_path="dfqe-bucket-01",\ multipart_sync_threshold=44432,\ multipart_min_part_size=44432,\ retain_head_object=true region=us-east-1 [ { "key": "default-placement", "val": { "name": "default-placement", "tags": [], "storage_classes": [ "CLOUDTIER", "STANDARD", "cold.test", "hot.test" ], "tier_targets": [ { "key": "CLOUDTIER", "val": { "tier_type": "cloud-s3", "storage_class": "CLOUDTIER", "retain_head_object": "true", "s3": { "endpoint": "http://10.0.210.010:8080", "access_key": "a21e86bce636c3aa2", "secret": "cf764951f1fdde5f", "region": "", "host_style": "path", "target_storage_class": "", "target_path": "dfqe-bucket-01", "acl_mappings": [], "multipart_sync_threshold": 44432, "multipart_min_part_size": 44432 } } } ] } } ] ]
Ceph Object Gateway를 다시 시작합니다.
구문
ceph orch restart CEPH_OBJECT_GATEWAY_SERVICE_NAME예
[ceph: root@host 01 /]# ceph orch restart rgw.rgw.1 Scheduled to restart rgw.rgw.1.host03.vkfldf on host 'host03’쉘을 종료하고 root 사용자로 부트스트랩된 노드에서 Amazon S3를 구성합니다.
예
[root@host01 ~]# s3cmd --configure Enter new values or accept defaults in brackets with Enter. Refer to user manual for detailed description of all options. Access key and Secret key are your identifiers for Amazon S3. Leave them empty for using the env variables. Access Key: a21e86bce636c3aa2 Secret Key: cf764951f1fdde5f Default Region [US]: Use "s3.amazonaws.com" for S3 Endpoint and not modify it to the target Amazon S3. S3 Endpoint [s3.amazonaws.com]: 10.0.210.78:80 Use "%(bucket)s.s3.amazonaws.com" to the target Amazon S3. "%(bucket)s" and "%(location)s" vars can be used if the target S3 system supports dns based buckets. DNS-style bucket+hostname:port template for accessing a bucket [%(bucket)s.s3.amazonaws.com]: 10.0.210.78:80 Encryption password is used to protect your files from reading by unauthorized persons while in transfer to S3 Encryption password: Path to GPG program [/usr/bin/gpg]: When using secure HTTPS protocol all communication with Amazon S3 servers is protected from 3rd party eavesdropping. This method is slower than plain HTTP, and can only be proxied with Python 2.7 or newer Use HTTPS protocol [Yes]: No On some networks all internet access must go through a HTTP proxy. Try setting it here if you can't connect to S3 directly HTTP Proxy server name: New settings: Access Key: a21e86bce636c3aa2 Secret Key: cf764951f1fdde5f Default Region: US S3 Endpoint: 10.0.210.78:80 DNS-style bucket+hostname:port template for accessing a bucket: 10.0.210.78:80 Encryption password: Path to GPG program: /usr/bin/gpg Use HTTPS protocol: False HTTP Proxy server name: HTTP Proxy server port: 0 Test access with supplied credentials? [Y/n] Y Please wait, attempting to list all buckets... Success. Your access key and secret key worked fine :-) Now verifying that encryption works... Not configured. Never mind. Save settings? [y/N] y Configuration saved to '/root/.s3cfg'S3 버킷을 생성합니다.
구문
s3cmd mb s3://NAME_OF_THE_BUCKET_FOR_S3예
[root@host01 ~]# s3cmd mb s3://awstestbucket Bucket 's3://awstestbucket/' created파일을 생성하고 모든 데이터를 입력하고 이를 S3 서비스로 이동합니다.
구문
s3cmd put FILE_NAME s3://NAME_OF_THE_BUCKET_ON_S3예
[root@host01 ~]# s3cmd put test.txt s3://awstestbucket upload: 'test.txt' -> 's3://awstestbucket/test.txt' [1 of 1] 21 of 21 100% in 1s 16.75 B/s done라이프사이클 구성 전환 정책을 생성합니다.
구문
<LifecycleConfiguration> <Rule> <ID>RULE_NAME</ID> <Filter> <Prefix></Prefix> </Filter> <Status>Enabled</Status> <Transition> <Days>DAYS</Days> <StorageClass>STORAGE_CLASS_NAME</StorageClass> </Transition> </Rule> </LifecycleConfiguration>예
[root@host01 ~]# cat lc_cloud.xml <LifecycleConfiguration> <Rule> <ID>Archive all objects</ID> <Filter> <Prefix></Prefix> </Filter> <Status>Enabled</Status> <Transition> <Days>2</Days> <StorageClass>CLOUDTIER</StorageClass> </Transition> </Rule> </LifecycleConfiguration>라이프사이클 구성 전환 정책을 설정합니다.
구문
s3cmd setlifecycle FILE_NAME s3://NAME_OF_THE_BUCKET_FOR_S3예
[root@host01 ~]# s3cmd setlifecycle lc_config.xml s3://awstestbucket s3://awstestbucket/: Lifecycle Policy updatedcephadm 쉘에로그인합니다.예
[root@host 01 ~]# cephadm shellCeph Object Gateway를 다시 시작합니다.
구문
ceph orch restart CEPH_OBJECT_GATEWAY_SERVICE_NAME예
[ceph: root@host 01 /]# ceph orch restart rgw.rgw.1 Scheduled to restart rgw.rgw.1.host03.vkfldf on host 'host03’
검증
소스 클러스터에서
radosgw-admin lc list명령을 사용하여 데이터가 S3로 이동했는지 확인합니다.예
[ceph: root@host01 /]# radosgw-admin lc list [ { "bucket": ":awstestbucket:552a3adb-39e0-40f6-8c84-00590ed70097.54639.1", "started": "Mon, 26 Sep 2022 18:32:07 GMT", "status": "COMPLETE" } ]클라우드 끝점에서 오브젝트 전환을 확인합니다.
예
[root@client ~]$ radosgw-admin bucket list [ "awstestbucket" ]버킷의 오브젝트를 나열합니다.
예
[root@host01 ~]$ aws s3api list-objects --bucket awstestbucket --endpoint=http://10.0.209.002:8080 { "Contents": [ { "Key": "awstestbucket/test", "LastModified": "2022-08-25T16:14:23.118Z", "ETag": "\"378c905939cc4459d249662dfae9fd6f\"", "Size": 29, "StorageClass": "STANDARD", "Owner": { "DisplayName": "test-user", "ID": "test-user" } } ] }S3 버킷의 콘텐츠를 나열합니다.
예
[root@host01 ~]# s3cmd ls s3://awstestbucket 2022-08-25 09:57 0 s3://awstestbucket/test.txt파일의 정보를 확인합니다.
예
[root@host01 ~]# s3cmd info s3://awstestbucket/test.txt s3://awstestbucket/test.txt (object): File size: 0 Last mod: Mon, 03 Aug 2022 09:57:49 GMT MIME type: text/plain Storage: CLOUDTIER MD5 sum: 991d2528bb41bb839d1a9ed74b710794 SSE: none Policy: none CORS: none ACL: test-user: FULL_CONTROL x-amz-meta-s3cmd-attrs: atime:1664790668/ctime:1664790668/gid:0/gname:root/md5:991d2528bb41bb839d1a9ed74b710794/mode:33188/mtime:1664790668/uid:0/uname:rootAmazon S3에서 로컬로 데이터를 다운로드합니다.
AWS를 구성합니다.
예
[client@client01 ~]$ aws configure AWS Access Key ID [****************6VVP]: AWS Secret Access Key [****************pXqy]: Default region name [us-east-1]: Default output format [json]:AWS 버킷의 콘텐츠를 나열합니다.
예
[client@client01 ~]$ aws s3 ls s3://dfqe-bucket-01/awstest PRE awstestbucket/S3에서 데이터를 다운로드합니다.
예
[client@client01 ~]$ aws s3 cp s3://dfqe-bucket-01/awstestbucket/test.txt . download: s3://dfqe-bucket-01/awstestbucket/test.txt to ./test.txt
9.14.2. Azure 클라우드 서비스로 데이터 전환 링크 복사링크가 클립보드에 복사되었습니다!
스토리지 클래스를 사용하여 라이프사이클 구성의 일부로 데이터를 원격 클라우드 서비스로 전환하여 비용을 줄이고 관리 효율성을 개선할 수 있습니다. 전환은 단방향이며 데이터는 원격 영역에서 다시 전환할 수 없습니다. 이 기능은 Azure와 같은 여러 클라우드 공급자로 데이터 전환을 활성화하는 것입니다. AWS 구성과의 주요 차이점 중 하나는 MCG(Multi-cloud Gateway)를 구성하고 MCG를 사용하여 S3 프로토콜에서 Azure Blob으로 변환해야 한다는 것입니다.
cloud-s3 을 계층 유형으로 사용하여 데이터를 전환해야 하는 원격 클라우드 S3 오브젝트 저장소 서비스를 구성합니다. 여기에는 데이터 풀이 필요하지 않으며 zonegroup 배치 대상의 관점에서 정의됩니다.
사전 요구 사항
- Ceph Object Gateway가 설치된 Red Hat Ceph Storage 클러스터입니다.
- 원격 클라우드 서비스의 사용자 인증 정보인 Azure.
- Azure는 데이터를 다운로드하기 위해 로컬로 구성되었습니다.
-
부트스트랩 노드에
s3cmd가 설치되어 있어야 합니다. -
MCG 네임스페이스의 에 대한 Azure 컨테이너를 생성합니다. 이 예에서는
mcgnamespace입니다.
프로세스
액세스 키와 시크릿 키가 있는 사용자를 생성합니다.
구문
radosgw-admin user create --uid=USER_NAME --display-name="DISPLAY_NAME" [--access-key ACCESS_KEY --secret-key SECRET_KEY]예
[ceph: root@host01 /]# radosgw-admin user create --uid=test-user --display-name="test-user" --access-key a21e86bce636c3aa1 --secret-key cf764951f1fdde5e { "user_id": "test-user", "display_name": "test-user", "email": "", "suspended": 0, "max_buckets": 1000, "subusers": [], "keys": [ { "user": "test-user", "access_key": "a21e86bce636c3aa1", "secret_key": "cf764951f1fdde5e" } ], "swift_keys": [], "caps": [], "op_mask": "read, write, delete", "default_placement": "", "default_storage_class": "", "placement_tags": [], "bucket_quota": { "enabled": false, "check_on_raw": false, "max_size": -1, "max_size_kb": 0, "max_objects": -1 }, "user_quota": { "enabled": false, "check_on_raw": false, "max_size": -1, "max_size_kb": 0, "max_objects": -1 }, "temp_url_keys": [], "type": "rgw", "mfa_ids": [] }root 사용자로 사용자 인증 정보를 사용하여 AWS CLI를 구성하고 기본 배치를 사용하여 버킷을 생성합니다.
구문
aws s3 --ca-bundle CA_PERMISSION --profile rgw --endpoint ENDPOINT_URL --region default mb s3://BUCKET_NAME예
[root@host01 ~]$ aws s3 --ca-bundle /etc/pki/ca-trust/source/anchors/myCA.pem --profile rgw --endpoint https://host02.example.com:8043 --region default mb s3://transition버킷이 배치 규칙과 함께
default-placement를 사용하고 있는지 확인합니다.예
[root@host01 ~]# radosgw-admin bucket stats --bucket transition { "bucket": "transition", "num_shards": 11, "tenant": "", "zonegroup": "b29b0e50-1301-4330-99fc-5cdcfc349acf", "placement_rule": "default-placement", "explicit_placement": { "data_pool": "", "data_extra_pool": "", "index_pool": "" },OpenShift Data Foundation(ODF)이 배포된 OpenShift Container Platform (OCP) 클러스터에 로그인합니다.
예
[root@host01 ~]$ oc project openshift-storage [root@host01 ~]$ oc get clusterversion NAME VERSION AVAILABLE PROGRESSING SINCE STATUS version 4.11.6 True False 4d1h Cluster version is 4.11.6 [root@host01 ~]$ oc get storagecluster NAME AGE PHASE EXTERNAL CREATED AT VERSION ocs-storagecluster 4d Ready 2023-06-27T15:23:01Z 4.11.0Azure의 OCP 클러스터에서 실행되는 MCG(Multi-cloud gateway) 네임스페이스 Azure 버킷을 구성합니다.
구문
noobaa namespacestore create azure-blob az --account-key='ACCOUNT_KEY' --account-name='ACCOUNT_NAME' --target-blob-container='_AZURE_CONTAINER_NAME'예
[root@host01 ~]$ noobaa namespacestore create azure-blob az --account-key='iq3+6hRtt9bQ46QfHKQ0nSm2aP+tyMzdn8dBSRW4XWrFhY+1nwfqEj4hk2q66nmD85E/o5OrrUqo+AStkKwm9w==' --account-name='transitionrgw' --target-blob-container='mcgnamespace'네임스페이스 저장소를가리키는 MCG 버킷 클래스를 생성합니다.예
[root@host01 ~]$ noobaa bucketclass create namespace-bucketclass single aznamespace-bucket-class --resource az -n openshift-storage클라우드로의 전환을 위한 OBC(오브젝트 버킷 클레임)를 생성합니다.
구문
noobaa obc create OBC_NAME --bucketclass aznamespace-bucket-class -n openshift-storage예
[root@host01 ~]$ noobaa obc create rgwobc --bucketclass aznamespace-bucket-class -n openshift-storage참고OBC에서 제공하는 인증 정보를 사용하여 Ceph Object Gateway에서 영역 그룹 배치를 구성합니다.
부트스트랩 노드에서 Azure에서 이전에 구성한 MCG의 기본 영역 그룹 내의 기본 배치에서 계층 유형을
cloud-s3으로 사용하여 스토리지 클래스를 생성합니다.참고--tier-type=cloud-s3옵션을 사용하여 스토리지 클래스를 생성하면 나중에 다른 스토리지 클래스 유형으로 수정할 수 없습니다.구문
radosgw-admin zonegroup placement add --rgw-zonegroup =ZONE_GROUP_NAME \ --placement-id=PLACEMENT_ID \ --storage-class =STORAGE_CLASS_NAME \ --tier-type=cloud-s3예
[ceph: root@host01 /]# radosgw-admin zonegroup placement add --rgw-zonegroup=default \ --placement-id=default-placement \ --storage-class=AZURE \ --tier-type=cloud-s3 [ { "key": "default-placement", "val": { "name": "default-placement", "tags": [], "storage_classes": [ "AZURE", "STANDARD" ], "tier_targets": [ { "key": "AZURE", "val": { "tier_type": "cloud-s3", "storage_class": "AZURE", "retain_head_object": "false", "s3": { "endpoint": "", "access_key": "", "secret": "", "host_style": "path", "target_storage_class": "", "target_path": "", "acl_mappings": [], "multipart_sync_threshold": 33554432, "multipart_min_part_size": 33554432 } } } ] } } ]클라우드 S3 클라우드 스토리지 클래스를 구성합니다.
구문
radosgw-admin zonegroup placement modify --rgw-zonegroup ZONE_GROUP_NAME \ --placement-id PLACEMENT_ID \ --storage-class STORAGE_CLASS_NAME \ --tier-config=endpoint=ENDPOINT_URL,\ access_key=ACCESS_KEY,secret=SECRET_KEY,\ target_path="TARGET_BUCKET_ON",\ multipart_sync_threshold=44432,\ multipart_min_part_size=44432,\ retain_head_object=true region=REGION_NAME중요retain_head_object매개변수를true로 설정하면 전환된 오브젝트를 나열할 오브젝트의 메타데이터 또는 헤드가 유지됩니다.예
[ceph: root@host01 /]# radosgw-admin zonegroup placement modify --rgw-zonegroup default --placement-id default-placement \ --storage-class AZURE \ --tier-config=endpoint="https://s3-openshift-storage.apps.ocp410.0e73azopenshift.com",\ access_key=a21e86bce636c3aa2,secret=cf764951f1fdde5f,\ target_path="dfqe-bucket-01",\ multipart_sync_threshold=44432,\ multipart_min_part_size=44432,\ retain_head_object=true region=us-east-1 [ { "key": "default-placement", "val": { "name": "default-placement", "tags": [], "storage_classes": [ "AZURE", "STANDARD", "cold.test", "hot.test" ], "tier_targets": [ { "key": "AZURE", "val": { "tier_type": "cloud-s3", "storage_class": "AZURE", "retain_head_object": "true", "s3": { "endpoint": "https://s3-openshift-storage.apps.ocp410.0e73azopenshift.com", "access_key": "a21e86bce636c3aa2", "secret": "cf764951f1fdde5f", "region": "", "host_style": "path", "target_storage_class": "", "target_path": "dfqe-bucket-01", "acl_mappings": [], "multipart_sync_threshold": 44432, "multipart_min_part_size": 44432 } } } ] } } ] ]Ceph Object Gateway를 다시 시작합니다.
구문
ceph orch restart CEPH_OBJECT_GATEWAY_SERVICE_NAME예
[ceph: root@host 01 /]# ceph orch restart client.rgw.objectgwhttps.host02.udyllp Scheduled to restart client.rgw.objectgwhttps.host02.udyllp on host 'host02이전에 생성된 버킷에 대한 라이프사이클 구성 전환 정책을 생성합니다. 이 예에서 버킷은
전환입니다.구문
cat transition.json { "Rules": [ { "Filter": { "Prefix": "" }, "Status": "Enabled", "Transitions": [ { "Days": 30, "StorageClass": "STORAGE_CLASS" } ], "ID": "TRANSITION_ID" } ] }참고30일이 지난 버킷의 모든 오브젝트는
AZURE라는 클라우드 스토리지 클래스로 전송됩니다.예
[root@host01 ~]$ cat transition.json { "Rules": [ { "Filter": { "Prefix": "" }, "Status": "Enabled", "Transitions": [ { "Days": 30, "StorageClass": "AZURE" } ], "ID": "Transition Objects in bucket to AZURE Blob after 30 days" } ] }AWS CLI를 사용하여 버킷 라이프사이클 구성을 적용합니다.
구문
aws s3api --ca-bundle CA_PERMISSION --profile rgw --endpoint ENDPOINT_URL--region default put-bucket-lifecycle-configuration --lifecycle-configuration file://BUCKET.json --bucket BUCKET_NAME예
[root@host01 ~]$ aws s3api --ca-bundle /etc/pki/ca-trust/source/anchors/myCA.pem --profile rgw --endpoint https://host02.example.com:8043 --region default put-bucket-lifecycle-configuration --lifecycle-configuration file://transition.json --bucket transition선택 사항: 라이프사이클 구성을 가져옵니다.
구문
aws s3api --ca-bundle CA_PERMISSION --profile rgw --endpoint ENDPOINT_URL--region default get-bucket-lifecycle-configuration --lifecycle-configuration file://BUCKET.json --bucket BUCKET_NAME예
[root@host01 ~]$ aws s3api --ca-bundle /etc/pki/ca-trust/source/anchors/myCA.pem --profile rgw --endpoint https://host02.example.com:8043 --region default get-bucket-lifecycle-configuration --bucket transition { "Rules": [ { "ID": "Transition Objects in bucket to AZURE Blob after 30 days", "Prefix": "", "Status": "Enabled", "Transitions": [ { "Days": 30, "StorageClass": "AZURE" } ] } ] }선택 사항:
radosgw-admin lc list명령을 사용하여 라이프사이클 구성을 가져옵니다.예
[root@host 01 ~]# radosgw-admin lc list [ { "bucket": ":transition:d9c4f708-5598-4c44-9d36-849552a08c4d.169377.1", "started": "Thu, 01 Jan 1970 00:00:00 GMT", "status": "UNINITIAL" } ]참고UNINITAL상태는 라이프사이클 구성이 처리되지 않음을 나타냅니다. 전환 프로세스가 완료된 후COMPLETED상태로 이동합니다.cephadm 쉘에로그인합니다.예
[root@host 01 ~]# cephadm shellCeph Object Gateway 데몬을 다시 시작합니다.
구문
ceph orch daemon CEPH_OBJECT_GATEWAY_DAEMON_NAME예
[ceph: root@host 01 /]# ceph orch daemon restart rgw.objectgwhttps.host02.udyllp [ceph: root@host 01 /]# ceph orch daemon restart rgw.objectgw.host02.afwvyq [ceph: root@host 01 /]# ceph orch daemon restart rgw.objectgw.host05.ucpsrr소스 클러스터에서 Azure로 데이터를 마이그레이션합니다.
예
[root@host 01 ~]# for i in 1 2 3 4 5 do aws s3 --ca-bundle /etc/pki/ca-trust/source/anchors/myCA.pem --profile rgw --endpoint https://host02.example.com:8043 --region default cp /etc/hosts s3://transition/transition$i done데이터 전환을 확인합니다.
예
[root@host 01 ~]# aws s3 --ca-bundle /etc/pki/ca-trust/source/anchors/myCA.pem --profile rgw --endpoint https://host02.example.com:8043 --region default ls s3://transition 2023-06-30 10:24:01 3847 transition1 2023-06-30 10:24:04 3847 transition2 2023-06-30 10:24:07 3847 transition3 2023-06-30 10:24:09 3847 transition4 2023-06-30 10:24:13 3847 transition5rados ls명령을 사용하여 데이터가 Azure로 이동했는지 확인합니다.예
[root@host 01 ~]# rados ls -p default.rgw.buckets.data | grep transition d9c4f708-5598-4c44-9d36-849552a08c4d.169377.1_transition1 d9c4f708-5598-4c44-9d36-849552a08c4d.169377.1_transition4 d9c4f708-5598-4c44-9d36-849552a08c4d.169377.1_transition2 d9c4f708-5598-4c44-9d36-849552a08c4d.169377.1_transition3 d9c4f708-5598-4c44-9d36-849552a08c4d.169377.1_transition5데이터가 전환되지 않으면
lc process명령을 실행할 수 있습니다.예
[root@host 01 ~]# radosgw-admin lc process이렇게 하면 라이프사이클 프로세스가 모든 버킷 라이프사이클 정책을 시작하고 평가하게 됩니다. 그런 다음 필요한 경우 데이터 전환을 시작합니다.
검증
radosgw-admin lc list명령을 실행하여 전환 완료를 확인합니다.예
[root@host 01 ~]# radosgw-admin lc list [ { "bucket": ":transition:d9c4f708-5598-4c44-9d36-849552a08c4d.170017.5", "started": "Mon, 30 Jun 2023-06-30 16:52:56 GMT", "status": "COMPLETE" } ]버킷의 오브젝트를 나열합니다.
예
[root@host01 ~]$ aws s3api list-objects --bucket awstestbucket --endpoint=http://10.0.209.002:8080 { "Contents": [ { "Key": "awstestbucket/test", "LastModified": "2023-06-25T16:14:23.118Z", "ETag": "\"378c905939cc4459d249662dfae9fd6f\"", "Size": 29, "StorageClass": "STANDARD", "Owner": { "DisplayName": "test-user", "ID": "test-user" } } ] }클러스터의 오브젝트를 나열합니다.
예
[root@host01 ~]$ aws s3 --ca-bundle /etc/pki/ca-trust/source/anchors/myCA.pem --profile rgw --endpoint https://host02.example.com:8043 --region default ls s3://transition 2023-06-30 17:52:56 0 transition1 2023-06-30 17:51:59 0 transition2 2023-06-30 17:51:59 0 transition3 2023-06-30 17:51:58 0 transition4 2023-06-30 17:51:59 0 transition5개체는 크기가
0입니다. 개체를 나열할 수 있지만 Azure로 전환되므로 복사할 수 없습니다.S3 API를 사용하여 오브젝트의 헤드를 확인합니다.
예
[root@host01 ~]$ aws s3api --ca-bundle /etc/pki/ca-trust/source/anchors/myCA.pem --profile rgw --endpoint https://host02.example.com:8043 --region default head-object --key transition1 --bucket transition { "AcceptRanges": "bytes", "LastModified": "2023-06-31T16:52:56+00:00", "ContentLength": 0, "ETag": "\"46ecb42fd0def0e42f85922d62d06766\"", "ContentType": "binary/octet-stream", "Metadata": {}, "StorageClass": "CLOUDTIER" }스토리지 클래스가
STANDARD에서CLOUDTIER로 변경되었음을 확인할 수 있습니다.
9.14.3. S3 클라우드 계층 스토리지에서 오브젝트 복원 링크 복사링크가 클립보드에 복사되었습니다!
전환된 오브젝트에서 S3 Restore API를 사용하여 클라우드에서 오브젝트를 다시 Ceph Object Gateway 클러스터로 복원할 수 있습니다.
-
Red Hat Ceph Storage 8.0의 경우 개체가 STANDARD 스토리지 클래스로 복원됩니다. 그러나 임시 오브젝트의 경우
x-amz-storage-class는 원래 클라우드 계층 스토리지 클래스를 반환합니다. - Red Hat Ceph Storage 8.1 이상의 경우 기본적으로 개체가 STANDARD 스토리지 클래스로 복원됩니다. 그러나 오브젝트를 복원해야 하는 스토리지 클래스를 구성할 수 있습니다.
null 버전의 오브젝트가 최신 버전이 아닌 경우 restore-object 요청을 발행할 때 'version-id null'을 지정하지 마십시오. 예를 들어 object1이라는 오브젝트가 testbucket1이라는 버킷에 업로드되고 클라우드로 전환된 다음 복원되었다고 가정합니다. 나중에 testbucket1에서 버전링이 활성화되고 새 버전의 object1이 업로드됩니다. 이 시점에서 원본(null) 버전이 더 이상 최신 버전이 아닙니다. 이 경우 object1을 복원할 때 restore-object 명령에서 --version-id null 매개변수를 생략해야 합니다.
사전 요구 사항
S3 클라우드 계층 스토리지에서 오브젝트를 복원하기 전에 다음 사전 요구 사항을 충족하는지 확인합니다.
- Amazon S3에서 생성된 대상 경로입니다.
-
클라우드 서비스에서 복원할 수 있도록 cloudtier storage-class를 구성하는 동안
retain_head_object를true로 설정해야 합니다. -
부트스트랩 노드에
s3cmd가 설치되어 있어야 합니다. -
복원 기능이 제대로 작동하려면
클라우드 계층스토리지 클래스에 제공된 사용자 인증 정보가 유효한 상태로 유지됩니다. -
Red Hat Ceph Storage 8.1 이상
cloud-s3-glacier계층 유형의 경우glacier_restore_days및glacier_restore_tier_type옵션이 올바르게 설정되어 있는지 확인합니다. 자세한 내용은 Amazon S3 클라우드 서비스로 데이터 전송을 참조하십시오.
프로세스
다음 절차 중 하나를 사용하여 오브젝트를 복원합니다.
S3
restore-object명령을 사용하여 클라우드 전환 오브젝트를 복원합니다.참고읽기를 통해 복원된 오브젝트 복사본은 임시이며read_through_restore_days기간 동안만 유지됩니다.구문
tier-type = cloud-s3 tier-config = aws s3api restore-object --bucket <value> --key <value> [--version-id <value>] --restore-request (structure) { { "Days": integer, } }예
tier-type = cloud-s3 tier-config = aws s3api restore-object --bucket my-glacier-bucket --key doc1.rtf [--version-id 3sL4kqtJlcpXroDTDmJ+rmSpXd3dIbrHY+MTRCxf3vjVBH40Nr8X8gdRQBpUMLUo] --restore-request { { "Days": 10, } }읽기
-처리 기능을 사용하여 전환된 오브젝트를 복원 및 읽습니다.다음 매개변수가 설정되어 있는지 확인합니다.
-
"Allow_read_through”: “enable" “read_through_restore_days”: 10구문
tier-type = cloud-s3 tier-config = { "access_key": <access>, "secret": <secret>, "endpoint": <endpoint>, "region": <region>, "host_style": <path | virtual>, "acls": [ { "type": <id | email | uri>, "source_id": <source_id>, "dest_id": <dest_id> } ... ], "target_path": <target_path>, "target_storage_class": <target-storage-class>, "multipart_sync_threshold": {object_size}, "multipart_min_part_size": {part_size}, "retain_head_object": <true | false>, “Allow_read_through”: “enable | disable”, “read_through_restore_days”: integer }cloud-s3계층 유형 복원 예tier-type = cloud-s3 tier-config = { "access_key": a21e86bce636c3aa2, "secret": cf764951f1fdde5f, "endpoint": http://10.0.210.010:8080 “, "region": “”, "host_style": “path”, "acls": [ { "type": “id”, "source_id": “”, "dest_id": “” } ... ], "target_path": dfqe-bucket-01, "target_storage_class": “”, "multipart_sync_threshold": 44432, "multipart_min_part_size": 44432, "retain_head_object": “true”, “Allow_read_through”: “enable”, “read_through_restore_days”: 10 }cloud-s3-glaciertier-type 복원 예tier-type = cloud-s3-glacier tier-config = { "access_key": a21e86bce636c3aa2, "secret": cf764951f1fdde5f, "endpoint": http://s3.us-east-1.amazonaws.com “, "region": “us-east-1”, "host_style": “path”, "acls": [ { "type": “id”, "source_id": “”, "dest_id": “” } ... ], "target_path": rgwbucket, "target_storage_class": “GLACIER”, "multipart_sync_threshold": 44432, "multipart_min_part_size": 44432, "retain_head_object": “true”, “Allow_read_through”: “enable”, “read_through_restore_days”: 10 "restore_storage_class": "COLDTIER", "s3-glacier": { "glacier_restore_days": 2, "glacier_restore_tier_type": "Expedited" }
-
확인
지정된 매개변수로 S3 헤드 오브젝트 요청을 실행하여 복원 상태를 확인합니다.
S3 헤드 오브젝트 요청을 사용하여 복원 상태를 확인합니다.
예
[root@host01 ~]$ aws s3api --ca-bundle
/etc/pki/ca-trust/source/anchors/myCA.pem --profile rgw
--endpoint https://host02.example.com:8043 --region default head-object
--key transition1 --bucket transition