검색

9.15. Azure 클라우드 서비스로 데이터 전환

download PDF

스토리지 클래스를 사용하여 라이프사이클 구성의 일부로 데이터를 원격 클라우드 서비스로 전환하여 비용을 줄이고 관리 효율성을 개선할 수 있습니다. 전환은 단방향이며 데이터는 원격 영역에서 다시 전환할 수 없습니다. 이 기능은 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 입니다.

프로세스

  1. 액세스 키와 시크릿 키가 있는 사용자를 생성합니다.

    구문

    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": []
    }

  2. 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

  3. 버킷이 배치 규칙과 함께 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": ""
        },

  4. 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.0

  5. Azure의 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'

  6. 네임스페이스 저장소를 가리키는 MCG 버킷 클래스를 생성합니다.

    예제

    [root@host01 ~]$ noobaa bucketclass create namespace-bucketclass single aznamespace-bucket-class --resource az -n openshift-storage

  7. 클라우드로의 전환을 위한 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에서 영역 그룹 배치를 구성합니다.

  8. 부트스트랩 노드에서 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
                            }
                        }
                    }
                ]
            }
        }
    ]

  9. 클라우드 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
                            }
                        }
                    }
                ]
            }
        }
    ]
    ]

  10. 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

  11. 이전에 생성된 버킷에 대한 라이프사이클 구성 전환 정책을 생성합니다. 이 예에서 버킷은 전환 입니다.

    구문

    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"
            }
        ]
            }

  12. 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

  13. 선택 사항: 라이프사이클 구성을 가져옵니다.

    구문

     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"
                    }
                ]
            }
        ]
    }

  14. 선택 사항: 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 상태로 이동합니다.

  15. cephadm 쉘에 로그인합니다.

    예제

    [root@host 01 ~]# cephadm shell

  16. Ceph 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

  17. 소스 클러스터에서 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

  18. 데이터 전환을 확인합니다.

    예제

    [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 transition5

  19. rados 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

  20. 데이터가 전환되지 않으면 lc process 명령을 실행할 수 있습니다.

    예제

    [root@host 01 ~]# radosgw-admin lc process

    이렇게 하면 라이프사이클 프로세스가 모든 버킷 라이프사이클 정책을 시작하고 평가하게 됩니다. 그런 다음 필요한 경우 데이터 전환을 시작합니다.

검증

  1. 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"
        }
    ]

  2. 버킷의 오브젝트를 나열합니다.

    예제

    [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"
                }
            }
        ]
    }

  3. 클러스터의 오브젝트를 나열합니다.

    예제

    [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로 전환되므로 복사할 수 없습니다.

  4. 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 로 변경되었음을 확인할 수 있습니다.

Red Hat logoGithubRedditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

© 2024 Red Hat, Inc.