GlusterFS 설치 가이드

1. 문서 개요

1.1. 목적

본 문서(GlusterFS 서비스팩 설치 가이드)는 전자정부 표준 프레임워크 기반의 PaaS-TA에서 제공되는 서비스팩인 GlusterFS 서비스팩을 Bosh를 이용하여 설치 하는 방법과 PaaS-TA의 SaaS 형태로 제공하는 Application 에서GlusterFS 서비스를 사용하는 방법을 기술하였다. PaaS-TA 3.5 버전부터는 Bosh2.0 기반으로 deploy를 진행하며 기존 Bosh1.0 기반으로 설치를 원할경우에는 PaaS-TA 3.1 이하 버전의 문서를 참고한다.

1.2. 범위

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

1.3. 시스템 구성도

본 문서의 설치된 시스템 구성도이다. Mysql Server, GlusterFS 서비스 브로커로 최소사항을 구성하였고 서비스 백엔드는 외부에 구성되어 있다.
  • 설치할때 cloud config에서 사용하는 VM_Tpye명과 스펙
VM_Type
스펙
minimal
1vCPU / 1GB RAM / 8GB Disk
  • 각 Instance의 Resource Pool과 스펙
구분
Resource Pool
스펙
paasta-glusterfs-broke
minimal
1vCPU / 1GB RAM / 8GB Disk
mysql
minimal
1vCPU / 1GB RAM / 8GB Disk

1.4. 참고자료

2. GlusterFS 서비스팩 설치

2.1. 설치전 준비사항

본 설치 가이드는 Linux 환경에서 설치하는 것을 기준으로 하였다. 서비스팩 설치를 위해서는 먼저 BOSH CLI v2 가 설치 되어 있어야 하고 BOSH 에 로그인이 되어 있어야 한다. BOSH CLI v2 가 설치 되어 있지 않을 경우 먼저 BOSH2.0 설치 가이드 문서를 참고 하여 BOSH CLI v2를 설치를 하고 사용법을 숙지 해야 한다.

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

  • 업로드 되어 있는 릴리즈 목록을 확인한다.
  • 사용 예시
    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!
  • GlusterFS 서비스 릴리즈가 업로드 되어 있지 않은 것을 확인
  • GlusterFS 서비스 릴리즈 파일을 업로드한다.
  • 사용 예시
    1
    $ bosh -e micro-bosh upload-release paasta-glusterfs-2.0.tgz
    2
    Using environment '10.30.40.111' as user 'admin' (openid, bosh.admin)
    3
    Using environment '10.30.40.111' as user 'admin' (openid, bosh.admin)
    4
    5
    ######################################################## 100.00% 144.14 MiB/s 2s
    6
    Task 4460
    7
    8
    Task 4460 | 04:31:41 | Extracting release: Extracting release (00:00:04)
    9
    Task 4460 | 04:31:45 | Verifying manifest: Verifying manifest (00:00:00)
    10
    Task 4460 | 04:31:45 | Resolving package dependencies: Resolving package dependencies (00:00:00)
    11
    Task 4460 | 04:31:45 | Creating new packages: gra-log-purger/f02fa5774ab54dbb1b1c3702d03cb929b85d60e6 (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:56 | Creating new packages: golang/f57ddbc8d55d7a0f08775bf76bb6a27dc98c7ea7 (00:00:01)
    32
    Task 4460 | 04:31:57 | Creating new jobs: acceptance-tests/48c00c36ec5210cbdd3b125ae6a72cfdf6eaf4e2 (00:00:00)
    33
    Task 4460 | 04:31:57 | Creating new jobs: broker-deregistrar/b5f6f776d46eb1ac561ab1e8f58d8ddedb97f86e (00:00:00)
    34
    Task 4460 | 04:31:57 | Creating new jobs: proxy/7907d8759aa11dfcbbe79220dc945c96b5562ac1 (00:00:00)
    35
    Task 4460 | 04:31:57 | Creating new jobs: mysql/078561f02f2516212ed59c48e1dd45360f93871c (00:00:00)
    36
    Task 4460 | 04:31:57 | Creating new jobs: broker-registrar/e1f5e30b87e70e916ea74ea8eb63a7b6ff6ff643 (00:00:00)
    37
    Task 4460 | 04:31:57 | Release has been created: paasta-mysql/2.0 (00:00:00)
    38
    39
    Task 4460 Started Fri Aug 31 04:31:41 UTC 2018
    40
    Task 4460 Finished Fri Aug 31 04:31:57 UTC 2018
    41
    Task 4460 Duration 00:00:16
    42
    Task 4460 done
    43
    44
    Succeeded
    Copied!
  • 업로드 된 GlusterFS 릴리즈를 확인한다.
  • 사용 예시
    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-glusterfs 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!
  • 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을 업로드를 해야 한다. (glusterfs 는 stemcell 3309 버전을 사용)

2.3. glusterfs 서비스 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-swift-object-service 설정 파일 내용
2
name: paasta-swift-object-service # 서비스 배포이름(필수)
3
4
releases:
5
- name: paasta-glusterfs # 서비스 릴리즈 이름(필수)
6
version: "2.0" # 서비스 릴리즈 버전(필수):latest 시 업로드된 서비스 릴리즈 최신버전
7
8
stemcells:
9
- alias: default
10
os: ((stemcell_os))
11
version: "((stemcell_version))"
12
13
update:
14
canaries: 1 # canary 인스턴스 수(필수)
15
canary_watch_time: 30000-600000 # canary 인스턴스가 수행하기 위한 대기 시간(필수)
16
max_in_flight: 1 # non-canary 인스턴스가 병렬로 update 하는 최대 개수(필수)
17
update_watch_time: 30000-600000 # non-canary 인스턴스가 수행하기 위한 대기 시간(필수)
18
19
instance_groups:
20
- name: mysql #작업 이름(필수): mysql 서버
21
azs:
22
- z5
23
instances: 1 # job 인스턴스 수(필수)
24
vm_type: ((vm_type_small)) # cloud config 에 정의한 vm_type
25
stemcell: default
26
networks:
27
- name: ((default_network_name)) # cloud config 에 정의한 network 이름
28
static_ips: # 사용할 IP addresses
29
- 10.30.107.196
30
properties:
31
admin_username: root # MySQL 어드민 계정
32
admin_password: admin # MySQL 어드민 패스워드
33
templates:
34
- name: mysql # job template 이름(필수)
35
release: paasta-glusterfs
36
37
- name: paasta-glusterfs-broker #작업 이름(필수): broker 서버
38
azs:
39
- z5
40
instances: 1 # job 인스턴스 수(필수)
41
vm_type: ((vm_type_small)) # cloud config 에 정의한 vm_type
42
stemcell: default
43
networks:
44
- name: ((default_network_name)) # cloud config 에 정의한 network 이름
45
static_ips: # 사용할 IP addresses
46
- 10.30.107.197
47
properties:
48
jdbc_ip: 10.30.107.196 # Mysql IP(필수)
49
jdbc_pwd: admin # Mysql password(필수)
50
jdbc_port: 3306 # Mysql Port
51
log_dir: paasta-glusterfs-broker # Broker Log 저장 디렉토리 명
52
log_file: paasta-glusterfs-broker # Broker Log 저장 파일 명
53
log_level: INFO # Broker Log 단계
54
glusterfs_url: 54.211.7.235 # Glusterfs 서비스 주소
55
glusterfs_tenantname: service # Glusterfs 서비스 테넌트 이름
56
glusterfs_username: swift # Glusterfs 서비스 계정 아이디
57
glusterfs_password: password # Glusterfs 서비스 암호
58
templates:
59
- name: op-glusterfs-java-broker # job template 이름(필수)
60
release: paasta-glusterfs
61
62
- name: broker-registrar #작업 이름(필수): broker-registrar
63
azs:
64
- z5
65
instances: 1 # job 인스턴스 수(필수)
66
lifecycle: errand # bosh deploy시 vm에 생성되어 설치 되지 않고 bosh errand 로실행>할때 설정, 주로 테스트 용도에 쓰임
67
vm_type: ((vm_type_small)) # cloud config 에 정의한 vm_type
68
stemcell: default
69
networks:
70
- name: ((default_network_name)) # cloud config 에 정의한 network 이름
71
properties:
72
broker:
73
host: 10.30.107.197 # Service Broker IP
74
name: glusterfs-service # Service Broker Name
75
password: cloudfoundry # Service Broker Auth Password
76
username: admin # Service Broker Auth Id
77
protocol: http # Service Broker Http Protocol
78
port: 8080 # Service Broker port
79
cf:
80
admin_password: admin # CF Paasword
81
admin_username: admin_test # CF Id
82
api_url: https://api.115.68.46.189.xip.io # CF Target Url
83
skip_ssl_validation: true # CF SSL 설정
84
templates:
85
- name: broker-registrar # job template 이름(필수)
86
release: paasta-glusterfs
87
88
- name: broker-deregistrar #작업 이름(필수): broker-deregistrar
89
azs:
90
- z5
91
instances: 1 # job 인스턴스 수(필수)
92
lifecycle: errand # bosh deploy시 vm에 생성되어 설치 되지 않고 bosh errand 로실행>할때 설정, 주로 테스트 용도에 쓰임
93
vm_type: ((vm_type_small)) # cloud config 에 정의한 vm_type
94
stemcell: default
95
networks:
96
- name: ((default_network_name)) # cloud config 에 정의한 network 이름
97
properties:
98
broker:
99
name: glusterfs-service
100
cf:
101
admin_password: admin # CF Paasword
102
admin_username: admin_test # CF Id
103
api_url: https://api.115.68.46.189.xip.io # CF Target Url
104
skip_ssl_validation: true # CF SSL 설정
105
templates:
106
- name: broker-deregistrar # job template 이름(필수)
107
release: paasta-glusterfs
Copied!
  • deploy-mysql-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-swift-object-service deploy paasta_swift_object_bosh2.0.yml \
5
-v default_network_name=service_private \
6
-v stemcell_os=ubuntu-trusty \
7
-v stemcell_version=3309 \
8
-v vm_type_small=minimal
Copied!
  • Swift Object 서비스팩을 배포한다.
  • 사용 예시
    1
    $ ./deploy-swift-object-bosh2.0.sh
    2
    Using environment '10.30.40.111' as user 'admin' (openid, bosh.admin)
    3
    4
    Using deployment 'paasta-swift-object-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-swift-object-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!
  • 배포된 swift object 서비스팩을 확인한다.
  • 사용 예시
    1
    $ bosh -e micro-bosh -d paasta-swift-object-service vms
    2
    Using environment '10.30.40.111' as user 'admin' (openid, bosh.admin)
    3
    4
    Task 6445. Done
    5
    6
    Deployment 'paasta-swift-object-service'
    7
    8
    Instance Process State AZ IPs VM CID VM Type Active
    9
    mysql/a217e0a4-a2a8-4b5e-9fb5-771ac6e6d99d running z5 10.30.107.196 vm-b02e1b45-3d13-45db-9617-360feb8ad2e2 minimal true
    10
    paasta-glusterfs-broker/c924a4e0-07ae-4371-a129-22b172e72a83 running z5 10.30.107.197 vm-b2247547-ca01-4e12-831e-286998fb36b1 minimal true
    11
    12
    2 vms
    13
    14
    Succeeded
    Copied!

2.4. GlusterFS 서비스 브로커 등록

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

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

$ $ cf service-brokers

GlusterFS 서비스 브로커를 등록한다.

$ cf create-service {서비스명} {서비스 플랜} {내 서비스명}
  • 서비스명 : p-rabbitmq로 Marketplace에서 보여지는 서비스 명칭이다.
  • 서비스플랜 : 서비스에 대한 정책으로 plans에 있는 정보 중 하나를 선택한다. RabbitMQ 서비스는 standard plan만 지원한다.
  • 내 서비스명 : 내 서비스에서 보여지는 명칭이다. 이 명칭을 기준으로 환경 설정 정보를 가져온다.
$ cf create-service-broker glusterfs-service admin cloudfoundry http://10.30.107.197:8080

등록된 GlusterFS 서비스 브로커를 확인한다.

$ cf service-brokers

접근 가능한 서비스 목록을 확인한다.

$ cf service-access
서비스 브로커 등록시 최초에는 접근을 허용하지 않는다. 따라서 access는 none으로 설정된다.

특정 조직에 해당 서비스 접근 허용을 할당하고 접근 서비스 목록을 다시 확인한다. (전체 조직)

$ cf enable-service-access glusterfs
$ cf service-access

3. GlusterFS 연동 Sample App 설명

본 Sample Web App은 PaaS-TA에 배포되며 GlusterFS의 서비스를 Provision과 Bind를 한 상태에서 사용이 가능하다.

3.1. Sample App 구조

Sample Web App은 PaaS-TA에 App으로 배포가 된다. 배포 완료 후 정상적으로 App 이 구동되면 브라우저나 curl로 해당 App에 접속 하여 GlusterFS 환경정보(서비스 연결 정보)와파일 업로드하고 확인하는 기능을 제공한다.
Sample App 구조는 다음과 같다.
이름
설명
src
Sample 소스디렉토리
manifest
PaaS-TA에 app 배포시 필요한 설정을 저장하는 파일
pom.xml
maven project 설정 파일
target
maven build시 생성되는 디렉토리(war 파일, classes 폴더 등)

PaaSTA-Sample-Apps.zip 파일 압축을 풀고 Service폴더안에 있는 GlusterFSSample Web App인 hello-spring-glusterfs를 복사한다.

$ ls -all

3.2. PaaS-TA에서 서비스 신청

Sample App에서 GlusterFS 서비스를 사용하기 위해서는 서비스 신청(Provision)을 해야 한다. *참고: 서비스 신청시 PaaS-TA에서 서비스를 신청 할 수 있는 사용자로 로그인이 되어 있어야 한다.

먼저 PaaS-TA Marketplace에서 서비스가 있는지 확인을 한다.

$ cf marketplace

Marketplace에서 원하는 서비스가 있으면 서비스 신청(Provision)을 한다.

$ cf create-service {서비스명} {서비스 플랜} {내 서비스명}
  • 서비스명 : p-rabbitmq로 Marketplace에서 보여지는 서비스 명칭이다.
  • 서비스플랜 : 서비스에 대한 정책으로 plans에 있는 정보 중 하나를 선택한다. RabbitMQ 서비스는 standard plan만 지원한다.
  • 내 서비스명 : 내 서비스에서 보여지는 명칭이다. 이 명칭을 기준으로 환경 설정 정보를 가져온다.
$ cf create-service glusterfs glusterfs-1000Mb glusterfs-service-instance

생성된 GlusterFS 서비스 인스턴스를 확인한다.

$ cf services

3.3. Sample App에 서비스 바인드 신청 및 App 확인

서비스 신청이 완료되었으면 Sample App 에서는 생성된 서비스 인스턴스를 Bind 하여 App에서 GlusterFS 서비스를 이용한다.
  • 참고: 서비스 Bind 신청시 PaaS-TA에서 서비스 Bind 신청 할 수 있는 사용자로 로그인이 되어 있어야 한다.

Sample App 디렉토리로 이동하여 manifest 파일을 확인한다.

$ cd hello-spring-glusterfs
$ vi manifest.yml ```
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 hello-spring-glusterfs //cf logs {배포된 App명}

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

$ cf bind-service hello-spring-glusterfs glusterfs-service-instance

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

$ cf restart hello-spring-glusterfs

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

curl 로 확인

$ curl --form [email protected]/../../Desert.jpg --form press=OK hello-spring-glusterfs.115.68.46.30.xip.io/swifttest

브라우에서 이미지 확인

Last modified 1yr ago