Redis 설치 가이드

1. 문서 개요

1.1. 목적

본 문서(Redis 서비스팩 설치 가이드)는 전자정부표준프레임워크 기반의 PaaS-TA에서 제공되는 서비스팩인 Redis 서비스팩을 Bosh를 이용하여 설치하는 방법과 PaaS-TA의 SaaS 형태로 제공하는 Application에서 Redis 서비스를 사용하는 방법을 기술하였다.

1.2. 범위

설치 범위는 Redis서비스팩을 검증하기 위한 기본 설치를 기준으로 작성하였다.

1.3. 시스템 구성도

본 문서의 설치된 시스템 구성도입니다. Redis dedicated-node(2대), Redis 서비스 브로커로 최소사항을 구성하였다.
구분
스펙
paasta-redis-broker
1vCPU / 1GB RAM / 8GB Disk+4GB(영구적 Disk)
dedicated-node
1vCPU / 1GB RAM / 8GB Disk+4GB(영구적 Disk)

1.4. 참고자료

2. Redis 서비스팩 설치

2.1. 설치 전 준비 사항

본 설치 가이드는 Linux 환경에서 설치하는 것을 기준으로 하였다. 서비스팩 설치를 위해서는 먼저 BOSH CLI v2 가 설치 되어 있어야 하고 BOSH 에 로그인이 되어 있어야 한다. BOSH CLI v2 가 설치 되어 있지 않을 경우 먼저 BOSH2.0 설치 가이드 문서를 참고 하여 BOSH CLI v2를 설치를 하고 사용법을 숙지 해야 한다.
  • PaaS-TA에서 제공하는 압축된 릴리즈 파일들을 다운받는다. (PaaSTA-Deployment.zip, PaaSTA-Sample-Apps.zip, PaaSTA-Services.zip)
  • 다운로드 위치

2.2. Redis 서비스 릴리즈 업로드

  • 업로드 되어 있는 릴리즈 목록을 확인한다.
  • 사용 예시
    1
    $ bosh -e micro-bosh releases
    2
    Using environment '10.30.40.111' as user 'admin' (openid, bosh.admin)
    3
    4
    Name Version Commit Hash
    5
    binary-buildpack 1.0.21* d714741
    6
    bpm 0.9.0* c9b7136
    7
    caas-release 1.0* empty+
    8
    capi 1.62.0* 22a608c
    9
    cf-networking 2.8.0* 479f4a66
    10
    cf-smoke-tests 40.0.5* d6aaf1f
    11
    cf-syslog-drain 7.0* 71b995a
    12
    cflinuxfs2 1.227.0* 60128e1
    13
    consul 195* 67cdbcd
    14
    diego 2.13.0* b5644d9
    15
    dotnet-core-buildpack 2.1.3* 46a41cd
    16
    garden-runc 1.15.1* 75107e7+
    17
    go-buildpack 1.8.25* 40c60a0
    18
    haproxy 8.8.0* 9292573
    19
    java-buildpack 4.13* c2749d3
    20
    loggregator 103.0* 05da4e3d
    21
    loggregator-agent 2.0* 2382c90
    22
    nats 24* 30e7a82
    23
    nodejs-buildpack 1.6.28* 4cfdb7b
    24
    paas-ta-portal-release 2.0* non-git
    25
    paasta-delivery-pipeline-release 1.0* b3ee8f48+
    26
    paasta-pinpoint 2.0* 2dbb8bf3+
    27
    php-buildpack 4.3.57* efc48f3
    28
    postgres 29* 5de4d63d+
    29
    python-buildpack 1.6.18* bcc4f26
    30
    routing 0.179.0* 18155a5
    31
    ruby-buildpack 1.7.21* 9d69600
    32
    silk 2.9.0* eebed55
    33
    staticfile-buildpack 1.4.29* 8a82e63
    34
    statsd-injector 1.3.0* 39e5179
    35
    uaa 60.2* ebb5895
    36
    37
    (*) Currently deployed
    38
    (+) Uncommitted changes
    39
    40
    31 releases
    41
    42
    Succeeded
    Copied!
  • Redis 서비스 릴리즈가 업로드 되어 있지 않은 것을 확인
  • Redis 서비스 릴리즈 파일을 업로드한다.
  • 사용 예시
    1
    $ bosh -e micro-bosh upload-release paasta-redis-2.0.tgz
    2
    Using environment '10.30.40.111' as user 'admin' (openid, bosh.admin)
    3
    4
    ######################################################## 100.00% 144.14 MiB/s 2s
    5
    Task 4460
    6
    7
    Task 4460 | 04:31:41 | Extracting release: Extracting release (00:00:04)
    8
    Task 4460 | 04:31:45 | Verifying manifest: Verifying manifest (00:00:00)
    9
    Task 4460 | 04:31:45 | Resolving package dependencies: Resolving package dependencies (00:00:00)
    10
    Task 4460 | 04:31:45 | Creating new packages: gra-log-purger/f02fa5774ab54dbb1b1c3702d03cb929b85d60e6 (00:00:00)
    11
    Task 4460 | 04:31:45 | Creating new packages: cf-mysql-broker/250c6466bdaff96677e501ed5219d92ce4e61bd8 (00:00:00)
    12
    Task 4460 | 04:31:45 | Creating new packages: mysqlclient/ce95f8ac566f76b650992987d5282ee473356e43 (00:00:00)
    13
    Task 4460 | 04:31:45 | Creating new packages: acceptance-tests/1cb3ce7e20f5a8395b43fc6f0e3f2e92b0dc27bd (00:00:00)
    14
    Task 4460 | 04:31:45 | Creating new packages: galera/d15a1d2d15e5e7417278d4aa1b908566022b9623 (00:00:01)
    15
    Task 4460 | 04:31:46 | Creating new packages: galera-healthcheck/3da4dedbcd7d9f404a19e7720e226fd472002266 (00:00:00)
    16
    Task 4460 | 04:31:46 | Creating new packages: quota-enforcer/e2c4c9e7d7bbbe4bfdc0866962461b00e654cca3 (00:00:00)
    17
    Task 4460 | 04:31:46 | Creating new packages: python/4e255efa754d91b825476b57e111345f200944e1 (00:00:01)
    18
    Task 4460 | 04:31:47 | Creating new packages: ruby/ff79c965224b4160c1526bd704b3b21e4ad7c362 (00:00:00)
    19
    Task 4460 | 04:31:47 | Creating new packages: route-registrar/f3fdfb8c940e7227a96c06e413ae6827aba8eeda (00:00:00)
    20
    Task 4460 | 04:31:47 | Creating new packages: check/d6811f25e9d56428a9b942631c27c9b24f5064dc (00:00:01)
    21
    Task 4460 | 04:31:48 | Creating new packages: cli/24305e50a638ece2cace4ef4803746c0c9fe4bb0 (00:00:00)
    22
    Task 4460 | 04:31:48 | Creating new packages: mariadb/43aa3547bc5a01dd51f1501e6b93c215dd7255e9 (00:00:01)
    23
    Task 4460 | 04:31:49 | Creating new packages: openjdk-1.8.0_45/57e0ee876ea9d90f5470e3784ae1171bccee850a (00:00:02)
    24
    Task 4460 | 04:31:51 | Creating new packages: mariadb_ctrl/7658290da98e2cad209456f174d3b9fa143c87fc (00:00:01)
    25
    Task 4460 | 04:31:52 | Creating new packages: scons/11e7ad3b28b43a96de3df7aa41afddde582fcc38 (00:00:00)
    26
    Task 4460 | 04:31:52 | Creating new packages: syslog_aggregator/078da6dcb999c1e6f5398a6eb739182ccb4aba25 (00:00:00)
    27
    Task 4460 | 04:31:52 | Creating new packages: xtrabackup/2e701e7a9e4241b28052d984733de36aae152275 (00:00:01)
    28
    Task 4460 | 04:31:53 | Creating new packages: boost/3eb8bdb1abb7eff5b63c4c5bdb41c0a778925c31 (00:00:01)
    29
    Task 4460 | 04:31:54 | Creating new packages: common/ba480a46c4b2aa9484fb24ed01a8649453573e6f (00:00:00)
    30
    Task 4460 | 04:31:54 | Creating new packages: switchboard/fad565dadbb37470771801952001c7071e55a364 (00:00:01)
    31
    Task 4460 | 04:31:55 | Creating new packages: op-mysql-java-broker/3bf47851b2c0d3bea63a0c58452df58c14a15482 (00:00:01)
    32
    Task 4460 | 04:31:56 | Creating new packages: golang/f57ddbc8d55d7a0f08775bf76bb6a27dc98c7ea7 (00:00:01)
    33
    Task 4460 | 04:31:57 | Creating new jobs: cf-mysql-broker/9828ead15eabdc33b2c27fe275b463735edb115d (00:00:00)
    34
    Task 4460 | 04:31:57 | Creating new jobs: acceptance-tests/48c00c36ec5210cbdd3b125ae6a72cfdf6eaf4e2 (00:00:00)
    35
    Task 4460 | 04:31:57 | Creating new jobs: broker-deregistrar/b5f6f776d46eb1ac561ab1e8f58d8ddedb97f86e (00:00:00)
    36
    Task 4460 | 04:31:57 | Creating new jobs: proxy/7907d8759aa11dfcbbe79220dc945c96b5562ac1 (00:00:00)
    37
    Task 4460 | 04:31:57 | Creating new jobs: mysql/078561f02f2516212ed59c48e1dd45360f93871c (00:00:00)
    38
    Task 4460 | 04:31:57 | Creating new jobs: op-mysql-java-broker/6e47c9ea6fbe0867d4a476af5abf157830c03024 (00:00:00)
    39
    Task 4460 | 04:31:57 | Creating new jobs: broker-registrar/e1f5e30b87e70e916ea74ea8eb63a7b6ff6ff643 (00:00:00)
    40
    Task 4460 | 04:31:57 | Release has been created: paasta-mysql/2.0 (00:00:00)
    41
    42
    Task 4460 Started Fri Aug 31 04:31:41 UTC 2018
    43
    Task 4460 Finished Fri Aug 31 04:31:57 UTC 2018
    44
    Task 4460 Duration 00:00:16
    45
    Task 4460 done
    46
    47
    Succeeded
    Copied!
  • 업로드 된 Redis 릴리즈를 확인한다.
  • 사용 예시
    1
    $ bosh -e micro-bosh releases
    2
    Using environment '10.30.40.111' as user 'admin' (openid, bosh.admin)
    3
    4
    Name Version Commit Hash
    5
    binary-buildpack 1.0.21* d714741
    6
    bpm 0.9.0* c9b7136
    7
    caas-release 1.0* empty+
    8
    capi 1.62.0* 22a608c
    9
    cf-networking 2.8.0* 479f4a66
    10
    cf-smoke-tests 40.0.5* d6aaf1f
    11
    cf-syslog-drain 7.0* 71b995a
    12
    cflinuxfs2 1.227.0* 60128e1
    13
    consul 195* 67cdbcd
    14
    diego 2.13.0* b5644d9
    15
    dotnet-core-buildpack 2.1.3* 46a41cd
    16
    garden-runc 1.15.1* 75107e7+
    17
    go-buildpack 1.8.25* 40c60a0
    18
    haproxy 8.8.0* 9292573
    19
    java-buildpack 4.13* c2749d3
    20
    loggregator 103.0* 05da4e3d
    21
    loggregator-agent 2.0* 2382c90
    22
    nats 24* 30e7a82
    23
    nodejs-buildpack 1.6.28* 4cfdb7b
    24
    paas-ta-portal-release 2.0* non-git
    25
    paasta-delivery-pipeline-release 1.0* b3ee8f48+
    26
    paasta-redis 2.0 85e3f01e+
    27
    paasta-pinpoint 2.0* 2dbb8bf3+
    28
    php-buildpack 4.3.57* efc48f3
    29
    postgres 29* 5de4d63d+
    30
    python-buildpack 1.6.18* bcc4f26
    31
    routing 0.179.0* 18155a5
    32
    ruby-buildpack 1.7.21* 9d69600
    33
    silk 2.9.0* eebed55
    34
    staticfile-buildpack 1.4.29* 8a82e63
    35
    statsd-injector 1.3.0* 39e5179
    36
    uaa 60.2* ebb5895
    37
    38
    (*) Currently deployed
    39
    (+) Uncommitted changes
    40
    41
    32 releases
    42
    43
    Succeeded
    Copied!
  • Redis 서비스 릴리즈가 업로드 되어 있는 것을 확인
  • Deploy시 사용할 Stemcell을 확인한다.
  • 사용 예시
    1
    $ bosh -e micro-bosh stemcells
    2
    Name Version OS CPI CID
    3
    bosh-vsphere-esxi-ubuntu-trusty-go_agent 3586.26* ubuntu-trusty - sc-109fbdb0-f663-49e8-9c30-8dbdd2e5b9b9
    4
    ~ 3445.2* ubuntu-trusty - sc-025c70b5-7d6e-4ba3-a12b-7e71c33dad24
    5
    ~ 3309* ubuntu-trusty - sc-22429dba-e5cc-4469-ab3a-882091573277
    6
    7
    (*) Currently deployed
    8
    9
    3 stemcells
    10
    11
    Succeeded
    Copied!
Stemcell 목록이 존재 하지 않을 경우 BOSH 설치 가이드 문서를 참고 하여 Stemcell을 업로드를 해야 한다. (redis는 stemcell 3309 버전을 사용)

2.3. Redis 서비스 Deployment 파일 수정 및 배포

BOSH Deployment manifest 는 components 요소 및 배포의 속성을 정의한 YAML 파일이다. Deployment manifest 에는 sotfware를 설치 하기 위해서 어떤 Stemcell (OS, BOSH agent) 을 사용할것이며 Release (Software packages, Config templates, Scripts) 이름과 버전, VMs 용량, Jobs params 등을 정의가 되어 있다.
deployment 파일에서 사용하는 network, vm_type 등은 cloud config 를 활용하고 해당 가이드는 Bosh2.0 가이드를 참고한다.
  • cloud config 내용 조회
  • 사용 예시
    1
    bosh -e micro-bosh cloud-config
    2
    Using environment '10.30.40.111' as user 'admin' (openid, bosh.admin)
    3
    4
    azs:
    5
    - cloud_properties:
    6
    datacenters:
    7
    - clusters:
    8
    - BD-HA:
    9
    resource_pool: CF_BOSH2_Pool
    10
    name: BD-HA
    11
    name: z1
    12
    - cloud_properties:
    13
    datacenters:
    14
    - clusters:
    15
    - BD-HA:
    16
    resource_pool: CF_BOSH2_Pool
    17
    name: BD-HA
    18
    name: z2
    19
    - cloud_properties:
    20
    datacenters:
    21
    - clusters:
    22
    - BD-HA:
    23
    resource_pool: CF_BOSH2_Pool
    24
    name: BD-HA
    25
    name: z3
    26
    - cloud_properties:
    27
    datacenters:
    28
    - clusters:
    29
    - BD-HA:
    30
    resource_pool: CF_BOSH2_Pool
    31
    name: BD-HA
    32
    name: z4
    33
    - cloud_properties:
    34
    datacenters:
    35
    - clusters:
    36
    - BD-HA:
    37
    resource_pool: CF_BOSH2_Pool
    38
    name: BD-HA
    39
    name: z5
    40
    - cloud_properties:
    41
    datacenters:
    42
    - clusters:
    43
    - BD-HA:
    44
    resource_pool: CF_BOSH2_Pool
    45
    name: BD-HA
    46
    name: z6
    47
    compilation:
    48
    az: z1
    49
    network: default
    50
    reuse_compilation_vms: true
    51
    vm_type: large
    52
    workers: 5
    53
    disk_types:
    54
    - disk_size: 1024
    55
    name: default
    56
    - disk_size: 1024
    57
    name: 1GB
    58
    - disk_size: 2048
    59
    name: 2GB
    60
    - disk_size: 4096
    61
    name: 4GB
    62
    - disk_size: 5120
    63
    name: 5GB
    64
    - disk_size: 8192
    65
    name: 8GB
    66
    - disk_size: 10240
    67
    name: 10GB
    68
    - disk_size: 20480
    69
    name: 20GB
    70
    - disk_size: 30720
    71
    name: 30GB
    72
    - disk_size: 51200
    73
    name: 50GB
    74
    - disk_size: 102400
    75
    name: 100GB
    76
    - disk_size: 1048576
    77
    name: 1TB
    78
    networks:
    79
    - name: default
    80
    subnets:
    81
    - azs:
    82
    - z1
    83
    - z2
    84
    - z3
    85
    - z4
    86
    - z5
    87
    - z6
    88
    cloud_properties:
    89
    name: Internal
    90
    dns:
    91
    - 8.8.8.8
    92
    gateway: 10.30.20.23
    93
    range: 10.30.0.0/16
    94
    reserved:
    95
    - 10.30.0.0 - 10.30.111.40
    96
    - name: public
    97
    subnets:
    98
    - azs:
    99
    - z1
    100
    - z2
    101
    - z3
    102
    - z4
    103
    - z5
    104
    - z6
    105
    cloud_properties:
    106
    name: External
    107
    dns:
    108
    - 8.8.8.8
    109
    gateway: 115.68.46.177
    110
    range: 115.68.46.176/28
    111
    reserved:
    112
    - 115.68.46.176 - 115.68.46.188
    113
    static:
    114
    - 115.68.46.189 - 115.68.46.190
    115
    type: manual
    116
    - name: service_private
    117
    subnets:
    118
    - azs:
    119
    - z1
    120
    - z2
    121
    - z3
    122
    - z4
    123
    - z5
    124
    - z6
    125
    cloud_properties:
    126
    name: Internal
    127
    dns:
    128
    - 8.8.8.8
    129
    gateway: 10.30.20.23
    130
    range: 10.30.0.0/16
    131
    reserved:
    132
    - 10.30.0.0 - 10.30.106.255
    133
    static:
    134
    - 10.30.107.1 - 10.30.107.255
    135
    - name: service_public
    136
    subnets:
    137
    - azs:
    138
    - z1
    139
    - z2
    140
    - z3
    141
    - z4
    142
    - z5
    143
    - z6
    144
    cloud_properties:
    145
    name: External
    146
    dns:
    147
    - 8.8.8.8
    148
    gateway: 115.68.47.161
    149
    range: 115.68.47.160/24
    150
    reserved:
    151
    - 115.68.47.161 - 115.68.47.174
    152
    static:
    153
    - 115.68.47.175 - 115.68.47.185
    154
    type: manual
    155
    - name: portal_service_public
    156
    subnets:
    157
    - azs:
    158
    - z1
    159
    - z2
    160
    - z3
    161
    - z4
    162
    - z5
    163
    - z6
    164
    cloud_properties:
    165
    name: External
    166
    dns:
    167
    - 8.8.8.8
    168
    gateway: 115.68.46.209
    169
    range: 115.68.46.208/28
    170
    reserved:
    171
    - 115.68.46.216 - 115.68.46.222
    172
    static:
    173
    - 115.68.46.214
    174
    type: manual
    175
    vm_extensions:
    176
    - cloud_properties:
    177
    ports:
    178
    - host: 3306
    179
    name: mysql-proxy-lb
    180
    - name: cf-router-network-properties
    181
    - name: cf-tcp-router-network-properties
    182
    - name: diego-ssh-proxy-network-properties
    183
    - name: cf-haproxy-network-properties
    184
    - cloud_properties:
    185
    disk: 51200
    186
    name: small-50GB
    187
    - cloud_properties:
    188
    disk: 102400
    189
    name: small-highmem-100GB
    190
    vm_types:
    191
    - cloud_properties:
    192
    cpu: 1
    193
    disk: 8192
    194
    ram: 1024
    195
    name: minimal
    196
    - cloud_properties:
    197
    cpu: 1
    198
    disk: 10240
    199
    ram: 2048
    200
    name: default
    201
    - cloud_properties:
    202
    cpu: 1
    203
    disk: 30720
    204
    ram: 4096
    205
    name: small
    206
    - cloud_properties:
    207
    cpu: 2
    208
    disk: 20480
    209
    ram: 4096
    210
    name: medium
    211
    - cloud_properties:
    212
    cpu: 2
    213
    disk: 20480
    214
    ram: 8192
    215
    name: medium-memory-8GB
    216
    - cloud_properties:
    217
    cpu: 4
    218
    disk: 20480
    219
    ram: 8192
    220
    name: large
    221
    - cloud_properties:
    222
    cpu: 8
    223
    disk: 20480
    224
    ram: 16384
    225
    name: xlarge
    226
    - cloud_properties:
    227
    cpu: 2
    228
    disk: 51200
    229
    ram: 4096
    230
    name: small-50GB
    231
    - cloud_properties:
    232
    cpu: 2
    233
    disk: 51200
    234
    ram: 4096
    235
    name: small-50GB-ephemeral-disk
    236
    - cloud_properties:
    237
    cpu: 4
    238
    disk: 102400
    239
    ram: 8192
    240
    name: small-100GB-ephemeral-disk
    241
    - cloud_properties:
    242
    cpu: 4
    243
    disk: 102400
    244
    ram: 8192
    245
    name: small-highmem-100GB-ephemeral-disk
    246
    - cloud_properties:
    247
    cpu: 8
    248
    disk: 20480
    249
    ram: 16384
    250
    name: small-highmem-16GB
    251
    - cloud_properties:
    252
    cpu: 1
    253
    disk: 4096
    254
    ram: 2048
    255
    name: caas_small
    256
    - cloud_properties:
    257
    cpu: 1
    258
    disk: 4096
    259
    ram: 1024
    260
    name: caas_small_api
    261
    - cloud_properties:
    262
    cpu: 1
    263
    disk: 4096
    264
    ram: 4096
    265
    name: caas_medium
    266
    - cloud_properties:
    267
    cpu: 2
    268
    disk: 8192
    269
    ram: 4096
    270
    name: service_medium
    271
    - cloud_properties:
    272
    cpu: 2
    273
    disk: 10240
    274
    ram: 2048
    275
    name: service_medium_2G
    276
    277
    Succeeded
    Copied!
  • Deployment 파일을 서버 환경에 맞게 수정한다.
1
# paasta-redis-service 설정 파일 내용
2
3
name: paasta-redis-service # 서비스 배포이름(필수)
4
5
releases:
6
- name: paasta-redis #서비스 릴리즈 이름(필수)
7
version: "2.0" #서비스 릴리즈 버전(필수): latest 시 업로드된 서비스 릴리즈 최신버전
8
9
stemcells:
10
- alias: default
11
os: ((stemcell_os))
12
version: "((stemcell_version))"
13
14
update:
15
canaries: 1 # canary 인스턴스 수(필수)
16
canary_watch_time: 30000-180000 # canary 인스턴스가 수행하기 위한 대기 시간(필수)
17
max_in_flight: 6 # non-canary 인스턴스가 병렬로 update 하는 최대 개수(필수)
18
update_watch_time: 30000-180000 # non-canary 인스턴스가 수행하기 위한 대기 시간(필수)
19
20
instance_groups:
21
- name: paasta-redis-broker
22
azs:
23
- z5
24
instances: 1
25
vm_type: ((vm_type_small))
26
stemcell: default
27
persistent_disk_type: 4GB
28
update:
29
max_in_flight: 1
30
serial: true
31
networks:
32
- name: ((default_network_name))
33
static_ips:
34
- 10.30.107.171
35
properties:
36
nats: # paas-ta nats 정보
37
machines:
38
- 10.30.112.2
39
password: "((nats_password))"
40
port: 4222
41
user: nats
42
templates:
43
- name: cf-redis-broker
44
release: paasta-redis
45
- name: syslog-configurator
46
release: paasta-redis
47
48
- name: dedicated-node
49
azs:
50
- z5
51
instances: 3
52
vm_type: ((vm_type_small))
53
stemcell: default
54
persistent_disk_type: 4GB
55
update:
56
max_in_flight: 1
57
serial: true
58
networks:
59
- name: ((default_network_name))
60
static_ips:
61
- 10.30.107.172
62
- 10.30.107.173
63
- 10.30.107.174
64
templates:
65
- name: dedicated-node
66
release: paasta-redis
67
- name: syslog-configurator
68
release: paasta-redis
69
70
- name: broker-registrar
71
azs:
72
- z5
73
instances: 1
74
lifecycle: errand
75
vm_type: ((vm_type_small))
76
stemcell: default
77
networks:
78
- name: ((default_network_name))
79
properties:
80
broker:
81
host: 10.30.107.171
82
name: paasta-redis-service
83
password: admin
84
username: admin
85
templates:
86
- name: broker-registrar
87
release: paasta-redis
88
89
- name: broker-deregistrar
90
azs:
91
- z5
92
instances: 1
93
lifecycle: errand
94
vm_type: ((vm_type_small))
95
stemcell: default
96
networks:
97
- name: ((default_network_name))
98
properties:
99
broker:
100
host: 10.30.107.171
101
name: paasta-redis-service
102
password: admin
103
username: admin
104
templates:
105
- name: broker-deregistrar
106
release: paasta-redis
107
108
- name: smoke-tests
109
azs:
110
- z5
111
instances: 1
112
lifecycle: errand
113
vm_type: ((vm_type_small))
114
stemcell: default
115
networks:
116
- name: ((default_network_name))
117
templates:
118
- name: smoke-tests
119
release: paasta-redis
120
121
meta:
122
apps_domain: 115.68.46.189.xip.io
123
broker: # broker 정보 : 디폴트 포트 12350
124
host: paasta-redis-broker.115.68.46.189.xip.io
125
name: redis
126
password: admin
127
username: admin
128
cf: # paas-ta 정보
129
admin_password: admin
130
admin_username: admin_test
131
api_url: https://api.115.68.46.189.xip.io
132
apps_domain: 115.68.46.189.xip.io
133
skip_ssl_validation: false
134
system_domain: 115.68.46.189.xip.io
135
deployment_name: paasta-redis-service
136
director_uuid: 484eb672-5b91-4c0d-bb16-bad80f0f3e61 # uuid 정보 bosh status
137
external_domain: 115.68.46.189.xip.io
138
nats: # nats 정보
139
machines:
140
- 10.30.112.2
141
password: "((nats_password))"
142
port: 4222
143
user: nats
144
redis:
145
bg_save_command: yetanotherrandomstring
146
broker: # broker 정보
147
dedicated_vm_plan_id: 48b35349-d3de-4e19-bc4a-66996ae07766
148
name: redis
149
service_id: 7aba7e52-f61b-4263-9de1-14e9d11fb67d
150
shared_vm_plan_id: 78bf886c-bc50-4f31-a03c-cb786a158286
151
subdomain: paasta-redis-broker
152
config_command: configalias
153
dedicated_plan:
154
instance_count: 3 # 전용노드 수
155
save_command: anotherrandomstring
156
shared_plan:
157
instance_limit: 10 # 공유 노드 수
158
max_memory: 262144000
159
release_name: paasta-redis
160
route_name: paasta-redis-broker
161
service_name: redis
162
syslog_aggregator: null
163
164
properties:
165
broker: # broker 정보
166
host: paasta-redis-broker.115.68.46.189.xip.io
167
name: redis
168
password: admin
169
username: admin
170
cf: # paas-ta 정보
171
admin_password: admin
172
admin_username: admin_test
173
api_url: https://api.115.68.46.189.xip.io
174
apps_domain: 115.68.46.189.xip.io
175
skip_ssl_validation: false
176
system_domain: 115.68.46.189.xip.io
177
redis:
178
agent:
179
backend_port: 54321
180
bg_save_command: yetanotherrandomstring
181
broker:
182
auth:
183
password: admin
184
username: admin
185
backend_host: 10.30.107.171
186
backend_port: 12345
187
dedicated_nodes:
188
- 10.30.107.172
189
- 10.30.107.173
190
- 10.30.107.174
191
dedicated_vm_plan_id: 48b35349-d3de-4e19-bc4a-66996ae07766
192
enable_service_access: true
193
host: 10.30.107.171
194
name: redis
195
network: default
196
route_name: paasta-redis-broker
197
service_id: 7aba7e52-f61b-4263-9de1-14e9d11fb67d
198
service_instance_limit: 20 # 최대 서비스 인스턴스 개수
199
service_name: redis
200
shared_vm_plan_id: 78bf886c-bc50-4f31-a03c-cb786a158286
201
subdomain: redis-broker
202
config_command: configalias
203
host: 10.30.107.171
204
maxmemory: 262144000
205
save_command: anotherrandomstring
206
syslog_aggregator: null
Copied!
  • deploy-redis-bosh2.0.sh 파일을 서버 환경에 맞게 수정한다.
1
#!/bin/bash
2
# stemcell 버전은 3309 버전으로 사용하시고 https://github.com/PaaS-TA/Guide-2.0-Linguine-/blob/master/Download_Page.md 에서 다운받아 쓰십시요.
3
4
bosh -e micro-bosh -d paasta-redis-service deploy paasta_redis_bosh2.0.yml \
5
-v default_network_name=service_private \
6
-v stemcell_os=ubuntu-trusty \
7
-v stemcell_version=3309 \
8
-v nats_password=fxaqRErYZ1TD8296u9HdMg8ol8dJ0G \
9
-v vm_type_small=minimal
Copied!
  • Redis 서비스팩을 배포한다.
  • 사용 예시
    1
    $ ./deploy-redis-bosh2.0.sh
    2
    Using environment '10.30.40.111' as user 'admin' (openid, bosh.admin)
    3
    4
    Using deployment 'paasta-redis-service'
    5
    6
    + azs:
    7
    + - cloud_properties:
    8
    + datacenters:
    9
    + - clusters:
    10
    + - BD-HA:
    11
    + resource_pool: CF_BOSH2_Pool
    12
    + name: BD-HA
    13
    + name: z1
    14
    + - cloud_properties:
    15
    + datacenters:
    16
    + - clusters:
    17
    + - BD-HA:
    18
    + resource_pool: CF_BOSH2_Pool
    19
    + name: BD-HA
    20
    + name: z2
    21
    + - cloud_properties:
    22
    + datacenters:
    23
    + - clusters:
    24
    + - BD-HA:
    25
    + resource_pool: CF_BOSH2_Pool
    26
    + name: BD-HA
    27
    + name: z3
    28
    + - cloud_properties:
    29
    + datacenters:
    30
    + - clusters:
    31
    + - BD-HA:
    32
    + resource_pool: CF_BOSH2_Pool
    33
    + name: BD-HA
    34
    + name: z4
    35
    + - cloud_properties:
    36
    + datacenters:
    37
    + - clusters:
    38
    + - BD-HA:
    39
    + resource_pool: CF_BOSH2_Pool
    40
    + name: BD-HA
    41
    + name: z5
    42
    + - cloud_properties:
    43
    + datacenters:
    44
    + - clusters:
    45
    + - BD-HA:
    46
    + resource_pool: CF_BOSH2_Pool
    47
    + name: BD-HA
    48
    + name: z6
    49
    50
    + vm_types:
    51
    + - cloud_properties:
    52
    + cpu: 1
    53
    + disk: 8192
    54
    + ram: 1024
    55
    + name: minimal
    56
    + - cloud_properties:
    57
    + cpu: 1
    58
    + disk: 10240
    59
    + ram: 2048
    60
    + name: default
    61
    + - cloud_properties:
    62
    + cpu: 1
    63
    + disk: 30720
    64
    + ram: 4096
    65
    + name: small
    66
    + - cloud_properties:
    67
    + cpu: 2
    68
    + disk: 20480
    69
    + ram: 4096
    70
    + name: medium
    71
    + - cloud_properties:
    72
    + cpu: 2
    73
    + disk: 20480
    74
    + ram: 8192
    75
    + name: medium-memory-8GB
    76
    + - cloud_properties:
    77
    + cpu: 4
    78
    + disk: 20480
    79
    + ram: 8192
    80
    + name: large
    81
    + - cloud_properties:
    82
    + cpu: 8
    83
    + disk: 20480
    84
    + ram: 16384
    85
    + name: xlarge
    86
    + - cloud_properties:
    87
    + cpu: 2
    88
    + disk: 51200
    89
    + ram: 4096
    90
    + name: small-50GB
    91
    + - cloud_properties:
    92
    + cpu: 2
    93
    + disk: 51200
    94
    + ram: 4096
    95
    + name: small-50GB-ephemeral-disk
    96
    + - cloud_properties:
    97
    + cpu: 4
    98
    + disk: 102400
    99
    + ram: 8192
    100
    + name: small-100GB-ephemeral-disk
    101
    + - cloud_properties:
    102
    + cpu: 4
    103
    + disk: 102400
    104
    + ram: 8192
    105
    + name: small-highmem-100GB-ephemeral-disk
    106
    + - cloud_properties:
    107
    + cpu: 8
    108
    + disk: 20480
    109
    + ram: 16384
    110
    + name: small-highmem-16GB
    111
    + - cloud_properties:
    112
    + cpu: 1
    113
    + disk: 4096
    114
    + ram: 2048
    115
    + name: caas_small
    116
    + - cloud_properties:
    117
    + cpu: 1
    118
    + disk: 4096
    119
    + ram: 1024
    120
    + name: caas_small_api
    121
    + - cloud_properties:
    122
    + cpu: 1
    123
    + disk: 4096
    124
    + ram: 4096
    125
    + name: caas_medium
    126
    + - cloud_properties:
    127
    + cpu: 2
    128
    + disk: 8192
    129
    + ram: 4096
    130
    + name: service_medium
    131
    + - cloud_properties:
    132
    + cpu: 2
    133
    + disk: 10240
    134
    + ram: 2048
    135
    + name: service_medium_2G
    136
    137
    + vm_extensions:
    138
    + - cloud_properties:
    139
    + ports:
    140
    + - host: 3306
    141
    + name: mysql-proxy-lb
    142
    + - name: cf-router-network-properties
    143
    + - name: cf-tcp-router-network-properties
    144
    + - name: diego-ssh-proxy-network-properties
    145
    + - name: cf-haproxy-network-properties
    146
    + - cloud_properties:
    147
    + disk: 51200
    148
    + name: small-50GB
    149
    + - cloud_properties:
    150
    + disk: 102400
    151
    + name: small-highmem-100GB
    152
    153
    + compilation:
    154
    + az: z1
    155
    + network: default
    156
    + reuse_compilation_vms: true
    157
    + vm_type: large
    158
    + workers: 5
    159
    160
    + networks:
    161
    + - name: default
    162
    + subnets:
    163
    + - azs:
    164
    + - z1
    165
    + - z2
    166
    + - z3
    167
    + - z4
    168
    + - z5
    169
    + - z6
    170
    + cloud_properties:
    171
    + name: Internal
    172
    + dns:
    173
    + - 8.8.8.8
    174
    + gateway: 10.30.20.23
    175
    + range: 10.30.0.0/16
    176
    + reserved:
    177
    + - 10.30.0.0 - 10.30.111.40
    178
    + - name: public
    179
    + subnets:
    180
    + - azs:
    181
    + - z1
    182
    + - z2
    183
    + - z3
    184
    + - z4
    185
    + - z5
    186
    + - z6
    187
    + cloud_properties:
    188
    + name: External
    189
    + dns:
    190
    + - 8.8.8.8
    191
    + gateway: 115.68.46.177
    192
    + range: 115.68.46.176/28
    193
    + reserved:
    194
    + - 115.68.46.176 - 115.68.46.188
    195
    + static:
    196
    + - 115.68.46.189 - 115.68.46.190
    197
    + type: manual
    198
    + - name: service_private
    199
    + subnets:
    200
    + - azs:
    201
    + - z1
    202
    + - z2
    203
    + - z3
    204
    + - z4
    205
    + - z5
    206
    + - z6
    207
    + cloud_properties:
    208
    + name: Internal
    209
    + dns:
    210
    + - 8.8.8.8
    211
    + gateway: 10.30.20.23
    212
    + range: 10.30.0.0/16
    213
    + reserved:
    214
    + - 10.30.0.0 - 10.30.106.255
    215
    + static:
    216
    + - 10.30.107.1 - 10.30.107.255
    217
    + - name: service_public
    218
    + subnets:
    219
    + - azs:
    220
    + - z1
    221
    + - z2
    222
    + - z3
    223
    + - z4
    224
    + - z5
    225
    + - z6
    226
    + cloud_properties:
    227
    + name: External
    228
    + dns:
    229
    + - 8.8.8.8
    230
    + gateway: 115.68.47.161
    231
    + range: 115.68.47.160/24
    232
    + reserved:
    233
    + - 115.68.47.161 - 115.68.47.174
    234
    + static:
    235
    + - 115.68.47.175 - 115.68.47.185
    236
    + type: manual
    237
    + - name: portal_service_public
    238
    + subnets:
    239
    + - azs:
    240
    + - z1
    241
    + - z2
    242
    + - z3
    243
    + - z4
    244
    + - z5
    245
    + - z6
    246
    + cloud_properties:
    247
    + name: External
    248
    + dns:
    249
    + - 8.8.8.8
    250
    + gateway: 115.68.46.209
    251
    + range: 115.68.46.208/28
    252
    + reserved:
    253
    + - 115.68.46.216 - 115.68.46.222
    254
    + static:
    255
    + - 115.68.46.214
    256
    + type: manual
    257
    258
    + disk_types:
    259
    + - disk_size: 1024
    260
    + name: default
    261
    + - disk_size: 1024
    262
    + name: 1GB
    263
    + - disk_size: 2048
    264
    + name: 2GB
    265
    + - disk_size: 4096
    266
    + name: 4GB
    267
    + - disk_size: 5120
    268
    + name: 5GB
    269
    + - disk_size: 8192
    270
    + name: 8GB
    271
    + - disk_size: 10240
    272
    + name: 10GB
    273
    + - disk_size: 20480
    274
    + name: 20GB
    275
    + - disk_size: 30720
    276
    + name: 30GB
    277
    + - disk_size: 51200
    278
    + name: 50GB
    279
    + - disk_size: 102400
    280
    + name: 100GB
    281
    + - disk_size: 1048576
    282
    + name: 1TB
    283
    284
    + stemcells:
    285
    + - alias: default
    286
    + os: ubuntu-trusty
    287
    + version: '3309'
    288
    289
    + releases:
    290
    + - name: paasta-mysql
    291
    + version: '2.0'
    292
    293
    + update:
    294
    + canaries: 1
    295
    + canary_watch_time: 30000-600000
    296
    + max_in_flight: 1
    297
    + update_watch_time: 30000-600000
    298
    299
    + instance_groups:
    300
    + - azs:
    301
    + - z5
    302
    + instances: 3
    303
    + name: mysql
    304
    + networks:
    305
    + - name: service_private
    306
    + static_ips:
    307
    + - 10.30.107.166
    308
    + - 10.30.107.165
    309
    + - 10.30.107.164
    310
    + persistent_disk_type: 8GB
    311
    + properties:
    312
    + admin_password: "<redacted>"
    313
    + character_set_server: "<redacted>"
    314
    + cluster_ips:
    315
    + - "<redacted>"
    316
    + - "<redacted>"
    317
    + - "<redacted>"
    318
    + collation_server: "<redacted>"
    319
    + network_name: "<redacted>"
    320
    + seeded_databases: "<redacted>"
    321
    + syslog_aggregator: "<redacted>"
    322
    + release: paasta-mysql
    323
    + stemcell: default
    324
    + template: mysql
    325
    + vm_type: minimal
    326
    + - azs:
    327
    + - z5
    328
    + instances: 1
    329
    + name: proxy
    330
    + networks:
    331
    + - name: service_private
    332
    + static_ips:
    333
    + - 10.30.107.168
    334
    + properties:
    335
    + cluster_ips:
    336
    + - "<redacted>"
    337
    + - "<redacted>"
    338
    + - "<redacted>"
    339
    + external_host: "<redacted>"
    340
    + nats:
    341
    + machines:
    342
    + - "<redacted>"
    343
    + password: "<redacted>"
    344
    + port: "<redacted>"
    345
    + user: "<redacted>"
    346
    + network_name: "<redacted>"
    347
    + proxy:
    348
    + api_force_https: "<redacted>"
    349
    + api_password: "<redacted>"
    350
    + api_username: "<redacted>"
    351
    + syslog_aggregator: "<redacted>"
    352
    + release: paasta-mysql
    353
    + stemcell: default
    354
    + template: proxy
    355
    + vm_type: minimal
    356
    + - azs:
    357
    + - z5
    358
    + instances: 1
    359
    + name: paasta-mysql-java-broker
    360
    + networks:
    361
    + - name: service_private
    362
    + static_ips:
    363
    + - 10.30.107.167
    364
    + properties:
    365
    + jdbc_ip: "<redacted>"
    366
    + jdbc_port: "<redacted>"
    367
    + jdbc_pwd: "<redacted>"
    368
    + log_dir: "<redacted>"
    369
    + log_file: "<redacted>"
    370
    + log_level: "<redacted>"
    371
    + release: paasta-mysql
    372
    + stemcell: default
    373
    + template: op-mysql-java-broker
    374
    + vm_type: minimal
    375
    + - azs:
    376
    + - z5
    377
    + instances: 1
    378
    + lifecycle: errand
    379
    + name: broker-registrar
    380
    + networks:
    381
    + - name: service_private
    382
    + properties:
    383
    + broker:
    384
    + host: "<redacted>"
    385
    + name: "<redacted>"
    386
    + password: "<redacted>"
    387
    + port: "<redacted>"
    388
    + protocol: "<redacted>"
    389
    + username: "<redacted>"
    390
    + cf:
    391
    + admin_password: "<redacted>"
    392
    + admin_username: "<redacted>"
    393
    + api_url: "<redacted>"
    394
    + skip_ssl_validation: "<redacted>"
    395
    + release: paasta-mysql
    396
    + stemcell: default
    397
    + template: broker-registrar
    398
    + vm_type: minimal
    399
    + - azs:
    400
    + - z5
    401
    + instances: 1
    402
    + lifecycle: errand
    403
    + name: broker-deregistrar
    404
    + networks:
    405
    + - name: service_private
    406
    + properties:
    407
    + broker:
    408
    + name: "<redacted>"
    409
    + cf:
    410
    + admin_password: "<redacted>"
    411
    + admin_username: "<redacted>"
    412
    + api_url: "<redacted>"
    413
    + skip_ssl_validation: "<redacted>"
    414
    + release: paasta-mysql
    415
    + stemcell: default
    416
    + template: broker-deregistrar
    417
    + vm_type: minimal
    418
    419
    + meta:
    420
    + apps_domain: 115.68.46.189.xip.io
    421
    + environment:
    422
    + external_domain: 115.68.46.189.xip.io
    423
    + nats:
    424
    + machines:
    425
    + - 10.30.112.2
    426
    + password: fxaqRErYZ1TD8296u9HdMg8ol8dJ0G
    427
    + port: 4222
    428
    + user: nats
    429
    + syslog_aggregator:
    430
    431
    + name: paasta-mysql-service
    432
    433
    Continue? [yN]: y
    434
    435
    Task 4506
    436
    437
    Task 4506 | 06:04:10 | Preparing deployment: Preparing deployment (00:00:01)
    438
    Task 4506 | 06:04:12 | Preparing package compilation: Finding packages to compile (00:00:00)
    439
    Task 4506 | 06:04:12 | Compiling packages: cli/24305e50a638ece2cace4ef4803746c0c9fe4bb0
    440
    Task 4506 | 06:04:12 | Compiling packages: openjdk-1.8.0_45/57e0ee876ea9d90f5470e3784ae1171bccee850a
    441
    Task 4506 | 06:04:12 | Compiling packages: op-mysql-java-broker/3bf47851b2c0d3bea63a0c58452df58c14a15482
    442
    Task 4506 | 06:04:12 | Compiling packages: syslog_aggregator/078da6dcb999c1e6f5398a6eb739182ccb4aba25
    443
    Task 4506 | 06:04:12 | Compiling packages: common/ba480a46c4b2aa9484fb24ed01a8649453573e6f
    444
    Task 4506 | 06:06:53 | Compiling packages: syslog_aggregator/078da6dcb999c1e6f5398a6eb739182ccb4aba25 (00:02:41)
    445
    Task 4506 | 06:06:53 | Compiling packages: golang/f57ddbc8d55d7a0f08775bf76bb6a27dc98c7ea7
    446
    Task 4506 | 06:06:55 | Compiling packages: common/ba480a46c4b2aa9484fb24ed01a8649453573e6f (00:02:43)
    447
    Task 4506 | 06:06:55 | Compiling packages: python/4e255efa754d91b825476b57e111345f200944e1
    448
    Task 4506 | 06:06:55 | Compiling packages: cli/24305e50a638ece2cace4ef4803746c0c9fe4bb0 (00:02:43)
    449
    Task 4506 | 06:06:55 | Compiling packages: check/d6811f25e9d56428a9b942631c27c9b24f5064dc
    450
    Task 4506 | 06:07:05 | Compiling packages: op-mysql-java-broker/3bf47851b2c0d3bea63a0c58452df58c14a15482 (00:02:53)
    451
    Task 4506 | 06:07:05 | Compiling packages: boost/3eb8bdb1abb7eff5b63c4c5bdb41c0a778925c31
    452
    Task 4506 | 06:07:10 | Compiling packages: openjdk-1.8.0_45/57e0ee876ea9d90f5470e3784ae1171bccee850a (00:02:58)
    453
    Task 4506 | 06:07:53 | Compiling packages: golang/f57ddbc8d55d7a0f08775bf76bb6a27dc98c7ea7 (00:01:00)
    454
    Task 4506 | 06:07:53 | Compiling packages: switchboard/fad565dadbb37470771801952001c7071e55a364
    455
    Task 4506 | 06:07:53 | Compiling packages: route-registrar/f3fdfb8c940e7227a96c06e413ae6827aba8eeda
    456
    Task 4506 | 06:07:55 | Compiling packages: check/d6811f25e9d56428a9b942631c27c9b24f5064dc (00:01:00)
    457
    Task 4506 | 06:07:55 | Compiling packages: gra-log-purger/f02fa5774ab54dbb1b1c3702d03cb929b85d60e6
    458
    Task 4506 | 06:08:30 | Compiling packages: route-registrar/f3fdfb8c940e7227a96c06e413ae6827aba8eeda (00:00:37)
    459
    Task 4506 | 06:08:30 | Compiling packages: galera-healthcheck/3da4dedbcd7d9f404a19e7720e226fd472002266
    460
    Task 4506 | 06:08:31 | Compiling packages: gra-log-purger/f02fa5774ab54dbb1b1c3702d03cb929b85d60e6 (00:00:36)
    461
    Task 4506 | 06:08:31 | Compiling packages: mariadb_ctrl/7658290da98e2cad209456f174d3b9fa143c87fc
    462
    Task 4506 | 06:08:32 | Compiling packages: switchboard/fad565dadbb37470771801952001c7071e55a364 (00:00:39)
    463
    Task 4506 | 06:08:58 | Compiling packages: galera-healthcheck/3da4dedbcd7d9f404a19e7720e226fd472002266 (00:00:28)
    464
    Task 4506 | 06:08:59 | Compiling packages: mariadb_ctrl/7658290da98e2cad209456f174d3b9fa143c87fc (00:00:28)
    465
    Task 4506 | 06:09:42 | Compiling packages: boost/3eb8bdb1abb7eff5b63c4c5bdb41c0a778925c31 (00:02:37)
    466
    Task 4506 | 06:11:27 | Compiling packages: python/4e255efa754d91b825476b57e111345f200944e1 (00:04:32)
    467
    Task 4506 | 06:11:27 | Compiling packages: scons/11e7ad3b28b43a96de3df7aa41afddde582fcc38 (00:00:22)
    468
    Task 4506 | 06:11:49 | Compiling packages: galera/d15a1d2d15e5e7417278d4aa1b908566022b9623 (00:13:18)
    469
    Task 4506 | 06:25:07 | Compiling packages: mariadb/43aa3547bc5a01dd51f1501e6b93c215dd7255e9 (00:18:49)
    470
    Task 4506 | 06:43:56 | Compiling packages: xtrabackup/2e701e7a9e4241b28052d984733de36aae152275 (00:10:26)
    471
    Task 4506 | 06:55:22 | Creating missing vms: mysql/ea075ae6-6326-478b-a1ba-7fbb0b5b0bf5 (0)
    472
    Task 4506 | 06:55:22 | Creating missing vms: mysql/e8c52bf2-cd48-45d0-9553-f6367942a634 (2)
    473
    Task 4506 | 06:55:22 | Creating missing vms: proxy/023edddd-418e-46e4-8d40-db452c694e16 (0)
    474
    Task 4506 | 06:55:22 | Creating missing vms: mysql/8a830154-25b6-432a-ad39-9ff09d015760 (1)
    475
    Task 4506 | 06:55:22 | Creating missing vms: paasta-mysql-java-broker/bb5676ca-efba-48fc-bc11-f464d0ae9c78 (0)
    476
    Task 4506 | 06:57:18 | Creating missing vms: mysql/ea075ae6-6326-478b-a1ba-7fbb0b5b0bf5 (0) (00:01:56)
    477
    Task 4506 | 06:57:23 | Creating missing vms: proxy/023edddd-418e-46e4-8d40-db452c694e16 (0) (00:02:01)
    478
    Task 4506 | 06:57:23 | Creating missing vms: mysql/e8c52bf2-cd48-45d0-9553-f6367942a634 (2) (00:02:01)
    479
    Task 4506 | 06:57:23 | Creating missing vms: paasta-mysql-java-broker/bb5676ca-efba-48fc-bc11-f464d0ae9c78 (0) (00:02:01)
    480
    Task 4506 | 06:57:23 | Creating missing vms: mysql/8a830154-25b6-432a-ad39-9ff09d015760 (1) (00:02:01)
    481
    Task 4506 | 06:57:24 | Updating instance mysql: mysql/ea075ae6-6326-478b-a1ba-7fbb0b5b0bf5 (0) (canary) (00:02:32)
    482
    Task 4506 | 06:59:56 | Updating instance mysql: mysql/8a830154-25b6-432a-ad39-9ff09d015760 (1) (00:03:03)
    483
    Task 4506 | 07:02:59 | Updating instance mysql: mysql/e8c52bf2-cd48-45d0-9553-f6367942a634 (2) (00:03:04)
    484
    Task 4506 | 07:06:03 | Updating instance proxy: proxy/023edddd-418e-46e4-8d40-db452c694e16 (0) (canary) (00:01:01)
    485
    Task 4506 | 07:07:04 | Updating instance paasta-mysql-java-broker: paasta-mysql-java-broker/bb5676ca-efba-48fc-bc11-f464d0ae9c78 (0) (canary) (00:01:02)
    486
    487
    Task 4506 Started Fri Aug 31 06:04:10 UTC 2018
    488
    Task 4506 Finished Fri Aug 31 07:08:06 UTC 2018
    489
    Task 4506 Duration 01:03:56
    490
    Task 4506 done
    491
    492
    Succeeded
    Copied!
  • 배포된 Redis 서비스팩을 확인한다.
  • 사용 예시
    1
    $bosh -e micro-bosh -d paasta-redis-service vms
    2
    Using environment '10.30.40.111' as user 'admin' (openid, bosh.admin)
    3
    4
    Task 8105. Done
    5
    6
    Deployment 'paasta-redis-service'
    7
    8
    Instance Process State AZ IPs VM CID VM Type Active
    9
    dedicated-node/609c24b3-7a05-4060-b6c3-e6af2c93dd01 running z5 10.30.107.174 vm-49ab7b30-dcc7-44c7-ba95-3fe450744a61 minimal true
    10
    dedicated-node/7790fa96-7830-4e5a-ad1b-e9f3962b1002 running z5 10.30.107.173 vm-c0d3ae90-3315-4840-80e5-c671107c5719 minimal true
    11
    dedicated-node/831598c5-48eb-4654-b2cc-df03a0f7a1db running z5 10.30.107.172 vm-6cc60d6d-9a3a-41c0-a2eb-ee9919256fe4 minimal true
    12
    paasta-redis-broker/7031a6f9-2f7a-4080-8bad-5753bfce1acf running z5 10.30.107.171 vm-c124e2b1-e06a-452b-bd85-a75fc1dee4aa minimal true
    13
    14
    4 vms
    15
    16
    Succeeded
    Copied!

2.4. Redis 서비스 브로커 등록

Redis 서비스팩 배포가 완료 되었으면 Application에서 서비스 팩을 사용하기 위해서 먼저 Redis 서비스 브로커를 등록해 주어야 한다. 서비스 브로커 등록시에는 PaaS-TA에서 서비스 브로커를 등록할 수 있는 사용자로 로그인하여야 한다

서비스 브로커 목록을 확인한다.

$ cf service-brokers
``` Getting service brokers as admin...
name url paasta-pinpoint-broker http://10.30.70.82:8080
1
##### Redis 서비스 브로커를 등록한다.
2
>`$ cf create-service-broker {서비스팩 이름} {서비스팩 사용자ID} {서비스팩 사용자비밀번호} http://{서비스팩 URL(IP)}`
3
4
**서비스팩 이름** : 서비스 팩 관리를 위해 PaaS-TA에서 보여지는 명칭이다. 서비스 Marketplace에서는 각각의 API 서비스 명이 보여지니 여기서 명칭은 서비스팩 리스트의 명칭이다.<br>
5
**서비스팩 사용자ID** / 비밀번호 : 서비스팩에 접근할 수 있는 사용자 ID입니다. 서비스팩도 하나의 API 서버이기 때문에 아무나 접근을 허용할 수 없어 접근이 가능한 ID/비밀번호를 입력한다.<br>
6
**서비스팩 URL** : 서비스팩이 제공하는 API를 사용할 수 있는 URL을 입력한다.
7
8
>`$ cf create-service-broker redis-service-broker admin admin http://10.30.107.171:12350`
Copied!
Creating service broker paasta-redis-brokeras admin... OK
1
##### 등록된 Redis 서비스 브로커를 확인한다.
2
3
>`$ cf service-brokers`
Copied!
Getting service brokers as admin...
name url paasta-pinpoint-broker http://10.30.70.82:8080 paasta-redis-broker http://10.30.60.71:12350
1
##### 접근 가능한 서비스 목록을 확인한다.
2
3
>`$ cf service-access`
Copied!
Getting service access as admin... broker: paasta-redis-broker service plan access orgs redis shared-vm none redis dedicated-vm none
broker: paasta-pinpoint-broker service plan access orgs Pinpoint Pinpoint_standard none
1
서비스 브로커 등록시 최초에는 접근을 허용하지 않는다. 따라서 access는 none으로 설정된다.
2
3
4
##### 특정 조직에 해당 서비스 접근 허용을 할당하고 접근 서비스 목록을 다시 확인한다. (전체 조직)
5
6
>`$ cf enable-service-access redis` <br>
7
>`$ ccf service-access`
Copied!
Getting service access as admin... broker: paasta-redis-broker service plan access orgs redis shared-vm all redis dedicated-vm all
broker: paasta-pinpoint-broker service plan access orgs Pinpoint Pinpoint_standard none
1
# 3. Redis연동 Sample App 설명
2
본 Sample App은 PaaS-TA에 배포되며 Redis의 서비스를 Provision과 Bind를 한 상태에서 사용이 가능하다.
3
4
### 3.1. Sample App 구조
5
Sample App은 PaaS-TA에 App으로 배포가 된다. 배포 완료 후 정상적으로 App이 구동되면 curl 명령어로 배포된 도메인 정보를 이용하여 Redis에 특정 key 에 값을 저장/조회/삭제를 한다.
6
7
Sample App 구조는 다음과 같다.
8
<table>
9
<tr>
10
<td>이름</td>
11
<td>설명</td>
12
</tr>
13
<tr>
14
<td>lib</td>
15
<td>Sample 소스디렉토리</td>
16
</tr>
17
<tr>
18
<td>manifest.yml</td>
19
<td>PaaS-TA에 app 배포시 필요한 설정을 저장하는 파일</td>
20
</tr>
21
<tr>
22
<td>Gemfile</td>
23
<td>Sample App 구동시 필요한 ruby gem 설정 파일</td>
24
</tr>
25
<tr>
26
<td>config.ru</td>
27
<td>Sample App 구동 파일</td>
28
</tr>
29
</table>
30
31
32
##### PaaSTA-Sample-Apps.zip 파일의 압축을 풀고 Service 폴더 안에 있는 Redis Sample Web App인 redis-example-app을 복사한다.
33
34
>`$ ls -all`
35
36
> ![redis_image_02]
37
38
<br>
39
40
### 3.2. PaaS-TA에서 서비스 신청
41
Sample App에서 Redis 서비스를 사용하기 위해서는 서비스 신청(Provision)을 해야 한다.
42
*참고: 서비스 신청시 PaaS-TA에서 서비스를 신청 할 수 있는 사용자로 로그인이 되어 있어야 한다.
43
44
##### 먼저 PaaS-TA Marketplace에서 서비스가 있는지 확인을 한다.
45
46
>`$ cf marketplace`
47
48
> ![redis_image_03]
49
50
<br>
51
52
##### Marketplace에서 원하는 서비스가 있으면 서비스 신청(Provision)을 한다.
53
54
>`$ cf create-service {서비스명} {서비스 플랜} {내 서비스명}`
55
- **서비스명** : p-rabbitmq로 Marketplace에서 보여지는 서비스 명칭이다.
56
- **서비스플랜** : 서비스에 대한 정책으로 plans에 있는 정보 중 하나를 선택한다. RabbitMQ 서비스는 standard plan만 지원한다.
57
- **내 서비스명** : 내 서비스에서 보여지는 명칭이다. 이 명칭을 기준으로 환경 설정 정보를 가져온다.
58
59
60
>`$ cf create-service redis shared-vm redis-service-instance`
61
62
>![redis_image_04]
63
64
<br>
65
66
##### 생성된 Redis 서비스 인스턴스를 확인한다.
67
68
>`$ cf services`
69
70
> ![redis_image_05]
71
72
<br>
73
74
### 3.3. Sample App에 서비스 바인드 신청 및 App 확인
75
서비스 신청이 완료되었으면 Sample App 에서는 생성된 서비스 인스턴스를 Bind 하여 App에서 Redis 서비스를 이용한다.
76
*참고: 서비스 Bind 신청시 PaaS-TA에서 서비스 Bind신청 할 수 있는 사용자로 로그인이 되어 있어야 한다.
77
78
79
##### Sample App 디렉토리로 이동하여 manifest 파일을 확인한다.
80
81
>`$ cd redis-example-app`
82
83
>`$ vi manifest.yml`
Copied!
applications:
  • name: hello- spring-glustefs # 배포할 App 이름
    memory: 512M # 배포시 메모리 사이즈
    instances: 1 # 배포 인스턴스 수
    path: target/hello-spring-glusterfs.war # 배포하는 App 파일 PATH
    ```

--no-start 옵션으로 App을 배포한다.

  • -no-start: App 배포시 구동은 하지 않는다.
$ cf push --no-start

배포된 Sample App을 확인하고 로그를 수행한다.

$ cf apps
$ cf logs redis-example-app

Sample App에서 생성한 서비스 인스턴스 바인드 신청을 한다.

$ cf bind-service redis-example-app redis-service-instancep

바인드를 적용하기 위해서 App을 재기동한다.

$ cf restart redis-example-app

App이 정상적으로 Redis 서비스를 사용하는지 확인한다.

curl 로 확인

$ export APP=redis-example-app.controller.open-paas.com
$ curl -X PUT $APP/foo -d 'data=bar