Ncloud Simple RabbitMQ 서비스 연동
    • PDF

    Ncloud Simple RabbitMQ 서비스 연동

    • PDF

    Article Summary

    VPC 환경에서 이용 가능합니다.

    참고

    Ncloud Simple RabbitMQ는 수도권 리전에서만 사용 가능합니다.

    Ncloud Simple RabbitMQ 생성 파라미터

    서버 인스턴스 목록

    서버 스펙서버 코드
    [Standard] vCPU 2, Mem 8GB, [SSD]Disk 50GBSVR.VRMQ.MQND.STAND.C002.M008.NET.SSD.B050.G002
    [Standard] vCPU 4, Mem 16GB, [SSD]Disk 50GBSVR.VRMQ.MQND.STAND.C004.M016.NET.SSD.B050.G002
    [Standard] vCPU 8, Mem 32GB, [SSD]Disk 50GBSVR.VRMQ.MQND.STAND.C008.M032.NET.SSD.B050.G002
    [High CPU] vCPU 2, Mem 4GB, [SSD]Disk 50GBSVR.VRMQ.MQND.HICPU.C002.M004.NET.SSD.B050.G002
    [High CPU] vCPU 4, Mem 8GB, [SSD]Disk 50GBSVR.VRMQ.MQND.HICPU.C004.M008.NET.SSD.B050.G002
    [High CPU] vCPU 8, Mem 16GB, [SSD]Disk 50GBSVR.VRMQ.MQND.HICPU.C008.M016.NET.SSD.B050.G002

    서비스 생성 파라미터

    파라미터명필수 여부타입제약 사항
    clusterNameYesString최소 3글자, 최대 20글자
    serverInstanceProductCodeYesString서버 인스턴스 목록에 기재된 서버 코드
    serverSubnetNoYesInteger
    loadBalancerSubnetNoYesInteger
    ipTypeCodeYesStringloadBalancerSubnetNo에 해당하는 타입 (Public or Private)
    rabbitmqVersionYesString3.8.23
    rmqDefaultUserYesString최소 4글자, 최대 16글자
    rmqDefaultPassYesString최소 4글자, 최대 16글자

    Ncloud Simple RabbitMQ 생성 예제

    서비스 생성

    cf create-service 서비스 플랜 {서비스명} -c 설정 명령으로 마켓플레이스의 서비스를 생성해 주십시오.

    cf create-service rabbitmq 2 rabbitmq-sample -c '{
      "clusterName":"mq-test",
      "serverInstanceProductCode":"SVR.VRMQ.MQND.STAND.C002.M008.NET.SSD.B050.G002",
      "serverSubnetNo":100,
      "loadBalancerSubnetNo":101,
      "ipTypeCode":"Private",
      "rabbitmqVersion":"3.8.23",
      "rmqDefaultUser":"****",
      "rmqDefaultPass":"****"
    }'
    
    Creating service instance rabbitmq-sample in org system / space system-space as admin...
        
    Create in progress. Use 'cf services' or 'cf service rabbitmq-sample' to check operation status.
    OK
    
    참고
    • Input Parameter를 json파일로 저장하여 cf create-service rabbitmq 2 rabbitmq-sample -c rabbitmq.json도 가능합니다.
    • 입력할 수 있는 변수는 위 Ncloud Simple RabbitMQ 생성 파라미터에서 확인할 수 있습니다.
    • 예제 파라미터에서 사용자명과 비밀번호는 마스킹 처리돼있으므로, 위 입력 가능한 변수를 참고해 올바른 값을 넣어주십시오.
    주의

    서비스 생성에 실패했을 경우, failed 메시지가 발생하며 서비스가 정상적으로 동작하지 않습니다.
    서비스 삭제 후, 재생성 해주십시오.

    서비스 상태 확인

    cf service 서비스명 명령으로 서비스 상태를 확인해 주십시오.

    • status에 서비스 상태(create in progress)가 표시됩니다.
    cf service rabbitmq-sample
    
    Showing info of service rabbitmq-sample in org system / space system-space as admin...
    
    name:            rabbitmq-sample
    guid:            e8c2653e-5458-42ae-99b3-5fdb15e3f22b
    type:            managed
    broker:          ncp-service-broker
    offering:        rabbitmq
    plan:            2
    tags:
    offering tags:   amqp, rabbitmq
    description:     A RabbitMQ service, managed by NaverCloudPlatform.
    documentation:   https://guide-gov.ncloud-docs.com/release-20240222/docs/vpc-rabbitmq-rabbitmq-1
    dashboard url:
    
    Showing status of last operation:
       status:    create in progress
       message:
       started:   2022-08-08T07:19:24Z
       updated:   2022-08-08T07:19:24Z
    
    Showing bound apps:
       There are no bound apps for this service instance.
    
    Showing sharing info:
       This service instance is not currently being shared.
    
       The "service_instance_sharing" feature flag is disabled for this Cloud Foundry platform.
       Service instance sharing is disabled for this service offering.
    
    Showing upgrade status:
       Upgrades are not supported by this broker.
    

    Ncloud Simple RabbitMQ 인스턴스 생성이 완료되면 서비스 상태가 생성성공(create succeeded)으로 변경됩니다.

    cf service rabbitmq-sample
    
    Showing info of service rabbitmq-sample in org system / space system-space as admin...
    
    name:            rabbitmq-sample
    guid:            e8c2653e-5458-42ae-99b3-5fdb15e3f22b
    type:            managed
    broker:          ncp-service-broker
    offering:        rabbitmq
    plan:            2
    tags:
    offering tags:   amqp, rabbitmq
    description:     A RabbitMQ service, managed by NaverCloudPlatform.
    documentation:   https://guide-gov.ncloud-docs.com/release-20240222/docs/vpc-rabbitmq-rabbitmq-1
    dashboard url:
    
    Showing status of last operation:
       status:    create succeeded
       message:
       started:   2022-08-08T07:28:35Z
       updated:   2022-08-08T07:28:35Z
    
    Showing bound apps:
       There are no bound apps for this service instance.
    
    Showing sharing info:
       This service instance is not currently being shared.
    
       The "service_instance_sharing" feature flag is disabled for this Cloud Foundry platform.
       Service instance sharing is disabled for this service offering.
    
    Showing upgrade status:
       Upgrades are not supported by this broker.
    

    서비스 Bind

    1. cf bind-service 애플리케이션 서비스명 명령으로 애플리케이션에 rabbitmq 서비스를 바인드해 주십시오.
    참고

    이 명령어를 사용하려면 파스타 애플리케이션이 배포되어 있어야 합니다.
    예제에서 사용된 test-node-app은 여기를 클릭해 확인할 수 있습니다.

    cf bind-service test-node-app rabbitmq-sample
    
    Binding service instance rabbitmq-sample to app test-node-app in org system / space system-space as admin...
    OK
    
    TIP: Use 'cf restage test-node-app' to ensure your env variable changes take effect
    
    1. cf env 애플리케이션 명령을 실행하여 VCAP_SERVICES에 rabbitmq 서비스가 추가된 것을 확인 할 수 있습니다.
    cf env test-node-app
    
    Getting env variables for app test-node-app in org system / space system-space as admin...
    System-Provided:
    VCAP_SERVICES: {
      "rabbitmq": [
        {
          "binding_guid": "ed82e64e-b694-422b-b01e-8dd530ef0ce2",
          "binding_name": null,
          "credentials": {
            "host": "test.kr.vrmq-gov.naverncp.com",
            "mgmtUrl": "http://console.gov-ncloud.com/vrmq/public/mgmt/0/",
            "password": "****",
            "port": "5672",
            "uri": "amqp://****:****@test.kr.vrmq-gov.naverncp.com:5672",
            "username": "****"
          },
          "instance_guid": "e8c2653e-5458-42ae-99b3-5fdb15e3f22b",
          "instance_name": "rabbitmq-sample",
          "label": "rabbitmq",
          "name": "rabbitmq-sample",
          "plan": "2",
          "provider": null,
          "syslog_drain_url": null,
          "tags": [
            "amqp",
            "rabbitmq"
          ],
          "volume_mounts": []
        }
      ]
    }
    
    
    VCAP_APPLICATION: {
      "application_id": "e57cb333-029d-4a54-882c-d6d8faedef75",
      "application_name": "test-node-app",
      "application_uris": [
        "test-node-app.apps.test.com"
      ],
      "cf_api": "https://api.test.com",
      "limits": {
        "fds": 16384
      },
      "name": "test-node-app",
      "organization_id": "b72fc30b-7d52-4f64-b70d-df6016bc8b30",
      "organization_name": "system",
      "space_id": "baa42a6d-15bb-41c7-9161-0488e5158b71",
      "space_name": "system-space",
      "uris": [
        "test-node-app.apps.test.com"
      ],
      "users": null
    }
    
    
    No user-provided env variables have been set
    
    No running env variables have been set
    
    No staging env variables have been set
    
    1. 애플리케이션의 환경변수를 변경해 주십시오.
    cf set-env test-node-app BOUND_AT $(date +%s)
    
    Setting env variable BOUND_AT for app test-node-app in org system / space system-space as admin...
    OK
      
    TIP: Use 'cf restage test-node-app' to ensure your env variable changes take effect.
    
    주의

    애플리케이션의 환경변수를 변경하지 않고 restage를 수행할 시, StagingTimeExpired 에러가 발생할 수 있습니다.

    1. cf restage 애플리케이션 명령으로 추가된 ENV로 애플리케이션을 다시 기동해 주십시오.
    cf restage test-node-app
    
    Instances starting...
    Instances starting...
    Instances starting...
    Instances starting...
    
    name:                test-node-app
    requested state:     started
    isolation segment:   placeholder
    routes:              test-node-app.apps.test.com
    last uploaded:       Mon 08 Aug 16:30:17 KST 2022
    stack:
    buildpacks:
    isolation segment:   placeholder
    
    type:           web
    sidecars:
    instances:      1/1
    memory usage:   1024M
         state     since                  cpu    memory   disk     details
    #0   running   2022-08-08T07:31:06Z   0.0%   0 of 0   0 of 0
    
    type:           test-node-app
    sidecars:
    instances:      0/0
    memory usage:   1024M
    There are no running instances of this process.
    

    서비스 Unbind

    cf unbind-service 애플리케이션 서비스명 명령으로 애플리케이션에 rabbitmq 서비스를 언바인드해 주십시오.

    cf unbind-service test-node-app rabbitmq-sample
    
    Unbinding app test-node-app from service rabbitmq-sample in org system / space system-space as admin...
    OK
    

    서비스 삭제

    cf delete-service 서비스명 명령으로 서비스를 삭제해 주십시오.

    cf delete-service rabbitmq-sample -f
    
    Deleting service instance rabbitmq-sample in org system / space system-space as admin...
    
    Service instance rabbitmq-sample deleted.
    OK
    

    이 문서가 도움이 되었습니까?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.