형상관리 설치 가이드

1. 문서 개요

1.1 목적

본 문서(형상관리 서비스팩 설치 가이드)는 개방형 PaaS 플랫폼 고도화 및 개발자 지원 환경 기반의 Open PaaS에서 제공되는 서비스팩인 형상관리 서비스를 Bosh를 이용하여 설치하는 방법을 기술하였다. PaaS-TA 3.5 버전부터는 Bosh2.0 기반으로 deploy를 진행하며 기존 Bosh1.0 기반으로 설치를 원할경우에는 PaaS-TA 3.1 이하 버전의 문서를 참고한다.

1.2 범위

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

1.3 시스템 구성도

본 문서의 설치된 시스템 구성도입니다. 형상관리 Server, 형상관리 서비스 브로커로 최소 사항을 구성하였다.

1.4 참고 자료

2. 형상관리 서비스팩 설치

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. 형상관리 서비스 릴리즈 업로드

  • 업로드 되어 있는 릴리즈 목록을 확인한다.
  • 사용 예시
    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!
  • 형상관리 서비스 릴리즈가 업로드 되어 있지 않은 것을 확인
  • 형상관리 서비스 릴리즈 파일을 업로드한다.
  • 사용 예시
    1
    $ bosh -e micro-bosh upload-release paasta-sourcecontrol-release-1.0.tgz
    2
    Using environment '10.30.40.111' as user 'admin' (openid, bosh.admin)
    3
    4
    ######################################################## 100.00% 138.05 MiB/s 1s
    5
    Task 7827
    6
    7
    Task 7827 | 00:09:43 | Extracting release: Extracting release (00:00:03)
    8
    Task 7827 | 00:09:46 | Verifying manifest: Verifying manifest (00:00:00)
    9
    Task 7827 | 00:09:46 | Resolving package dependencies: Resolving package dependencies (00:00:00)
    10
    Task 7827 | 00:09:46 | Creating new packages: haproxy/14b0441f6d68c89612f53ce4334a65c80d601e51 (00:00:00)
    11
    Task 7827 | 00:09:46 | Creating new packages: bosh-helpers/104087b4a6a1d5ebe0e26b0b2e3dcd71a9b971e2 (00:00:00)
    12
    Task 7827 | 00:09:46 | Creating new packages: java8/88ff03b20ad2f59840fbb5f74a074ca8fdc68213 (00:00:02)
    13
    Task 7827 | 00:09:48 | Creating new packages: sourcecontrol-api/37c3b7f8c53787e1f536a68543828bb76263ef50 (00:00:02)
    14
    Task 7827 | 00:09:50 | Creating new packages: tomcat/1ff8747498f45f21b2d43d6bc50d8e53a0ddfca7 (00:00:01)
    15
    Task 7827 | 00:09:51 | Creating new packages: scm-server/8f9a9d9259ff144dc71e1131c25420d1b3fa056d (00:00:00)
    16
    Task 7827 | 00:09:51 | Creating new packages: sourcecontrol-webui/70b5fb8f8fb97d196fa48d400f3c8f87bf3a36ea (00:00:02)
    17
    Task 7827 | 00:09:53 | Creating new packages: mariadb/59a218308c6c7dcf8795b531b53aa4a1c666ce00 (00:00:23)
    18
    Task 7827 | 00:10:16 | Creating new packages: sourcecontrol-broker/c5394441a91bddd526e232a7e7a466e8c3d90e51 (00:00:01)
    19
    Task 7827 | 00:10:17 | Creating new jobs: haproxy/83a2a95d33ee96bb34e03e635b0d041ee39724c9 (00:00:00)
    20
    Task 7827 | 00:10:17 | Creating new jobs: sourcecontrol-api/bfd00eb9d00b8de2d1ff7b4cf32b393ce5add3ac (00:00:00)
    21
    Task 7827 | 00:10:17 | Creating new jobs: scm-server/5563bed2081ac657e2d857d6a4ff6a698c770175 (00:00:00)
    22
    Task 7827 | 00:10:17 | Creating new jobs: sourcecontrol-webui/da8252527b24b150daa78bc6348aef149e6f6db7 (00:00:00)
    23
    Task 7827 | 00:10:17 | Creating new jobs: mariadb/cf48ef607b7415b7ebe178f3ad2e71f66e7c80b4 (00:00:00)
    24
    Task 7827 | 00:10:17 | Creating new jobs: sourcecontrol-broker/4e9d370ef1df0c400341942b327506af0568bb99 (00:00:00)
    25
    Task 7827 | 00:10:17 | Release has been created: paasta-sourcecontrol-release/1.0 (00:00:00)
    26
    27
    Task 7827 Started Thu Sep 13 00:09:43 UTC 2018
    28
    Task 7827 Finished Thu Sep 13 00:10:17 UTC 2018
    29
    Task 7827 Duration 00:00:34
    30
    Task 7827 done
    31
    32
    Succeeded
    Copied!
  • 업로드 된 형상관리 릴리즈를 확인한다.
  • 사용 예시
    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-sourcecontrol-release 1.0 d41bda4d+
    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을 업로드를 해야 한다. (형상관리는 stemcell 3445.2 버전을 사용)

2.3. 형상관리 서비스 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-sourcecontrol-service 설정 파일 내용
2
name: paasta-sourcecontrol-service # 서비스 배포이름(필수)
3
4
releases:
5
- name: paasta-sourcecontrol-release # 서비스 릴리즈 이름(필수)
6
version: "1.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-120000 # canary 인스턴스가 수행하기 위한 대기 시간(필수)
16
max_in_flight: 4 # non-canary 인스턴스가 병렬로 update 하는 최대 개수(필수)
17
update_watch_time: 30000-120000 # non-canary 인스턴스가 수행하기 위한 대기 시간(필수)
18
19
instance_groups:
20
- name: scm-server
21
azs:
22
- z5
23
instances: 1
24
persistent_disk_type: 30GB
25
vm_type: ((vm_type_small))
26
stemcell: default
27
networks:
28
- name: ((default_network_name))
29
static_ips:
30
- 10.30.107.121
31
templates:
32
- name: scm-server
33
release: paasta-sourcecontrol-release
34
35
- name: mariadb
36
azs:
37
- z5
38
instances: 1
39
persistent_disk_type: 2GB
40
vm_type: ((vm_type_small))
41
stemcell: default
42
networks:
43
- name: ((default_network_name))
44
static_ips:
45
- 10.30.107.122
46
templates:
47
- name: mariadb
48
release: paasta-sourcecontrol-release
49
50
- name: haproxy
51
azs:
52
- z5
53
instances: 1
54
persistent_disk_type: 2GB
55
vm_type: ((vm_type_small))
56
stemcell: default
57
networks:
58
- name: ((default_network_name))
59
static_ips:
60
- 10.30.107.123
61
- name: ((public_network_name))
62
static_ips:
63
- 115.68.47.175
64
templates:
65
- name: haproxy
66
release: paasta-sourcecontrol-release
67
68
- name: sourcecontrol-webui
69
azs:
70
- z5
71
instances: 1
72
persistent_disk_type: 2GB
73
vm_type: ((vm_type_small))
74
stemcell: default
75
networks:
76
- name: ((default_network_name))
77
static_ips:
78
- 10.30.107.124
79
templates:
80
- name: sourcecontrol-webui
81
release: paasta-sourcecontrol-release
82
83
- name: sourcecontrol-api
84
azs:
85
- z5
86
instances: 1
87
persistent_disk_type: 2GB
88
vm_type: ((vm_type_small))
89
stemcell: default
90
networks:
91
- name: ((default_network_name))
92
static_ips:
93
- 10.30.107.125
94
templates:
95
- name: sourcecontrol-api
96
release: paasta-sourcecontrol-release
97
98
- name: sourcecontrol-broker
99
azs:
100
- z5
101
instances: 1
102
persistent_disk_type: 2GB
103
vm_type: ((vm_type_small))
104
stemcell: default
105
networks:
106
- name: ((default_network_name))
107
static_ips:
108
- 10.30.107.126
109
templates:
110
- name: sourcecontrol-broker
111
release: paasta-sourcecontrol-release
112
113
properties:
114
spring:
115
datasource:
116
url: jdbc:mysql://10.30.107.122:31306/PAASTA_SRC_DB?autoReconnect=true&useUnicode=true&characterEncoding=utf8
117
username: sourcecontrol
118
password: '!scadmin2017'
119
databasename: "PAASTA_SRC_DB"
120
jpa:
121
database: mysql
122
123
haproxy: # sourcecontrol haproxy
124
host_ip: 10.30.107.123 # sourcecontrol haproxy host IP
125
url: 10.30.107.123 # sourcecontrol haproxy host IP
126
http_port: 8080 # sourcecontrol haproxy host port
127
128
sourcecontrol-webui: # sourcecontrol webui
129
port: 8080
130
haproxy:
131
urls:
132
- 10.30.107.124
133
java_opts: '-XX:MaxMetaspaceSize=104857K -Xss349K -Xms681574K -XX:MetaspaceSize=104857K -Xmx681574K'
134
135
sourcecontrol-api: # sourcecontrol api
136
base:
137
url: http://10.30.107.125:8082 # sourcecontrol api base url
138
port: 8082 # sourcecontrol api port
139
haproxy:
140
urls:
141
- 10.30.107.125
142
java_opts: '-XX:MaxMetaspaceSize=104857K -Xss349K -Xms681574K -XX:MetaspaceSize=104857K -Xmx681574K'
143
144
sourcecontrol-broker: # sourcecontrol broker
145
port: 8080 # sourcecontrol port
146
java_opts: '-XX:MaxMetaspaceSize=104857K -Xss349K -Xms681574K -XX:MetaspaceSize=104857K -Xmx681574K'
147
148
mariadb:
149
port: 31306
150
datasource:
151
username: root
152
password: "!paas_ta202"
153
databasename: "PAASTA_SRC_DB"
154
155
scm:
156
base:
157
url: http://10.30.107.121:8084/scm
158
port: 8084
159
haproxy:
160
urls:
161
- 10.30.107.121
162
clone:
163
url: http://115.68.47.175:8084/scm
164
dashboard:
165
url: http://115.68.47.175:8080/repositories/user/{instanceId}
166
api:
167
user: '/api/rest/users'
168
repo: '/api/rest/repositories'
169
cf:
170
uaa:
171
oauth:
172
info:
173
uri: https://uaa.115.68.46.189.xip.io/userinfo
174
token:
175
check:
176
uri: https://uaa.115.68.46.189.xip.io/check_token
177
access:
178
uri: https://uaa.115.68.46.189.xip.io/oauth/token
179
logout:
180
url: https://uaa.115.68.46.189.xip.io/logout.do
181
authorization:
182
uri: https://uaa.115.68.46.189.xip.io/oauth/authorize
183
client:
184
id: scclient
185
secret: clientsecret
186
api:
187
url: https://api.115.68.46.189.xip.io/v2/service_instances/[SUID]/permissions
Copied!
  • deploy-mysql-bosh2.0.sh 파일을 서버 환경에 맞게 수정한다.
1
#!/bin/bash
2
# stemcell 버전은 3445.2 버전으로 사용하시고 https://github.com/PaaS-TA/Guide-2.0-Linguine-/blob/master/Download_Page.md 에서 다운받아 쓰십시요.
3
# vsphere 인 경우 에는 use-public-network-vsphere.yml 사용하여 public ip를 설정 하고 그 이외의 IaaS는 use-public-network.yml 사용한다.
4
5
bosh -e micro-bosh -d paasta-sourcecontrol-service deploy paasta_sourcecontrol_bosh2.0.yml \
6
-o use-public-network-vsphere.yml \
7
-v default_network_name=service_private \
8
-v public_network_name=service_public \
9
-v stemcell_os=ubuntu-trusty \
10
-v stemcell_version=3445.2 \
11
-v vm_type_small=minimal
Copied!
  • 형상관리 서비스팩을 배포한다.
  • 사용 예시
    1
    $ ./deploy-sourcecontrol-bosh2.0.sh
    2
    Using environment '10.30.40.111' as user 'admin' (openid, bosh.admin)
    3
    4
    Using deployment 'paasta-sourcecontrol-service'
    5
    6
    + stemcells:
    7
    + - alias: default
    8
    + os: ubuntu-trusty
    9
    + version: '3445.2'
    10
    11
    + releases:
    12
    + - name: paasta-sourcecontrol-release
    13
    + version: '1.0'
    14
    15
    + update:
    16
    + canaries: 1
    17
    + canary_watch_time: 30000-120000
    18
    + max_in_flight: 4
    19
    + update_watch_time: 30000-120000
    20
    21
    + instance_groups:
    22
    + - azs:
    23
    + - z5
    24
    + instances: 1
    25
    + name: scm-server
    26
    + networks:
    27
    + - name: service_private
    28
    + static_ips:
    29
    + - 10.30.107.121
    30
    + persistent_disk_type: 30GB
    31
    + stemcell: default
    32
    + templates:
    33
    + - name: scm-server
    34
    + release: paasta-sourcecontrol-release
    35
    + vm_type: minimal
    36
    + - azs:
    37
    + - z5
    38
    + instances: 1
    39
    + name: mariadb
    40
    + networks:
    41
    + - name: service_private
    42
    + static_ips:
    43
    + - 10.30.107.122
    44
    + persistent_disk_type: 2GB
    45
    + stemcell: default
    46
    + templates:
    47
    + - name: mariadb
    48
    + release: paasta-sourcecontrol-release
    49
    + vm_type: minimal
    50
    + - azs:
    51
    + - z5
    52
    + instances: 1
    53
    + name: haproxy
    54
    + networks:
    55
    + - name: service_private
    56
    + static_ips:
    57
    + - 10.30.107.123
    58
    + - default:
    59
    + - dns
    60
    + - gateway
    61
    + name: service_public
    62
    + static_ips:
    63
    + - 115.68.47.179
    64
    + persistent_disk_type: 2GB
    65
    + stemcell: default
    66
    + templates:
    67
    + - name: haproxy
    68
    + release: paasta-sourcecontrol-release
    69
    + vm_type: minimal
    70
    + - azs:
    71
    + - z5
    72
    + instances: 1
    73
    + name: sourcecontrol-webui
    74
    + networks:
    75
    + - name: service_private
    76
    + static_ips:
    77
    + - 10.30.107.124
    78
    + persistent_disk_type: 2GB
    79
    + stemcell: default
    80
    + templates:
    81
    + - name: sourcecontrol-webui
    82
    + release: paasta-sourcecontrol-release
    83
    + vm_type: minimal
    84
    + - azs:
    85
    + - z5
    86
    + instances: 1
    87
    + name: sourcecontrol-api
    88
    + networks:
    89
    + - name: service_private
    90
    + static_ips:
    91
    + - 10.30.107.125
    92
    + persistent_disk_type: 2GB
    93
    + stemcell: default
    94
    + templates:
    95
    + - name: sourcecontrol-api
    96
    + release: paasta-sourcecontrol-release
    97
    + vm_type: minimal
    98
    + - azs:
    99
    + - z5
    100
    + instances: 1
    101
    + name: sourcecontrol-broker
    102
    + networks:
    103
    + - name: service_private
    104
    + static_ips:
    105
    + - 10.30.107.126
    106
    + persistent_disk_type: 2GB
    107
    + stemcell: default
    108
    + templates:
    109
    + - name: sourcecontrol-broker
    110
    + release: paasta-sourcecontrol-release
    111
    + vm_type: minimal
    112
    113
    + name: paasta-sourcecontrol-service
    114
    115
    + properties:
    116
    + api:
    117
    + repo: "<redacted>"
    118
    + user: "<redacted>"
    119
    + cf:
    120
    + api:
    121
    + url: "<redacted>"
    122
    + uaa:
    123
    + oauth:
    124
    + authorization:
    125
    + uri: "<redacted>"
    126
    + client:
    127
    + id: "<redacted>"
    128
    + secret: "<redacted>"
    129
    + info:
    130
    + uri: "<redacted>"
    131
    + logout:
    132
    + url: "<redacted>"
    133
    + token:
    134
    + access:
    135
    + uri: "<redacted>"
    136
    + check:
    137
    + uri: "<redacted>"
    138
    + dashboard:
    139
    + url: "<redacted>"
    140
    + haproxy:
    141
    + host_ip: "<redacted>"
    142
    + http_port: "<redacted>"
    143
    + url: "<redacted>"
    144
    + mariadb:
    145
    + datasource:
    146
    + databasename: "<redacted>"
    147
    + password: "<redacted>"
    148
    + username: "<redacted>"
    149
    + port: "<redacted>"
    150
    + scm:
    151
    + base:
    152
    + port: "<redacted>"
    153
    + url: "<redacted>"
    154
    + clone:
    155
    + url: "<redacted>"
    156
    + haproxy:
    157
    + urls:
    158
    + - "<redacted>"
    159
    + sourcecontrol-api:
    160
    + base:
    161
    + url: "<redacted>"
    162
    + haproxy:
    163
    + urls:
    164
    + - "<redacted>"
    165
    + java_opts: "<redacted>"
    166
    + port: "<redacted>"
    167
    + sourcecontrol-broker:
    168
    + java_opts: "<redacted>"
    169
    + port: "<redacted>"
    170
    + sourcecontrol-webui:
    171
    + haproxy:
    172
    + urls:
    173
    + - "<redacted>"
    174
    + java_opts: "<redacted>"
    175
    + port: "<redacted>"
    176
    + spring:
    177
    + datasource:
    178
    + databasename: "<redacted>"
    179
    + password: "<redacted>"
    180
    + url: "<redacted>"
    181
    + username: "<redacted>"
    182
    + jpa:
    183
    + database: "<redacted>"
    184
    185
    Continue? [yN]: y
    186
    187
    ask 7838
    188
    189
    Task 7838 | 00:18:22 | Preparing deployment: Preparing deployment (00:00:02)
    190
    Task 7838 | 00:18:25 | Preparing package compilation: Finding packages to compile (00:00:00)
    191
    Task 7838 | 00:18:25 | Compiling packages: sourcecontrol-broker/c5394441a91bddd526e232a7e7a466e8c3d90e51
    192
    Task 7838 | 00:18:25 | Compiling packages: sourcecontrol-api/37c3b7f8c53787e1f536a68543828bb76263ef50
    193
    Task 7838 | 00:18:25 | Compiling packages: sourcecontrol-webui/70b5fb8f8fb97d196fa48d400f3c8f87bf3a36ea
    194
    Task 7838 | 00:18:25 | Compiling packages: tomcat/1ff8747498f45f21b2d43d6bc50d8e53a0ddfca7
    195
    Task 7838 | 00:18:25 | Compiling packages: haproxy/14b0441f6d68c89612f53ce4334a65c80d601e51
    196
    Task 7838 | 00:21:13 | Compiling packages: tomcat/1ff8747498f45f21b2d43d6bc50d8e53a0ddfca7 (00:02:48)
    197
    Task 7838 | 00:21:13 | Compiling packages: mariadb/59a218308c6c7dcf8795b531b53aa4a1c666ce00
    198
    Task 7838 | 00:21:21 | Compiling packages: sourcecontrol-broker/c5394441a91bddd526e232a7e7a466e8c3d90e51 (00:02:56)
    199
    Task 7838 | 00:21:21 | Compiling packages: java8/88ff03b20ad2f59840fbb5f74a074ca8fdc68213
    200
    Task 7838 | 00:21:21 | Compiling packages: sourcecontrol-webui/70b5fb8f8fb97d196fa48d400f3c8f87bf3a36ea (00:02:56)
    201
    Task 7838 | 00:21:21 | Compiling packages: scm-server/8f9a9d9259ff144dc71e1131c25420d1b3fa056d
    202
    Task 7838 | 00:21:30 | Compiling packages: sourcecontrol-api/37c3b7f8c53787e1f536a68543828bb76263ef50 (00:03:05)
    203
    Task 7838 | 00:21:59 | Compiling packages: scm-server/8f9a9d9259ff144dc71e1131c25420d1b3fa056d (00:00:38)
    204
    Task 7838 | 00:22:05 | Compiling packages: haproxy/14b0441f6d68c89612f53ce4334a65c80d601e51 (00:03:40)
    205
    Task 7838 | 00:22:12 | Compiling packages: java8/88ff03b20ad2f59840fbb5f74a074ca8fdc68213 (00:00:51)
    206
    Task 7838 | 00:22:32 | Compiling packages: mariadb/59a218308c6c7dcf8795b531b53aa4a1c666ce00 (00:01:19)
    207
    Task 7838 | 00:23:33 | Creating missing vms: scm-server/6e23addc-33c7-4bb0-af95-d66420f15c06 (0)
    208
    Task 7838 | 00:23:33 | Creating missing vms: mariadb/90ea7861-57ed-43f7-853d-25712a67ba2a (0)
    209
    Task 7838 | 00:23:33 | Creating missing vms: haproxy/878b393c-d817-4e71-8fe5-553ddf87d362 (0)
    210
    Task 7838 | 00:23:33 | Creating missing vms: sourcecontrol-webui/840278e2-e1a2-4a30-b904-68538c7cd06f (0)
    211
    Task 7838 | 00:23:33 | Creating missing vms: sourcecontrol-broker/ec83edb5-130f-4a91-9ac1-20fb622ed0a2 (0)
    212
    Task 7838 | 00:23:33 | Creating missing vms: sourcecontrol-api/3ecb90fa-2211-4df6-82bb-5c91ed9a4310 (0)
    213
    Task 7838 | 00:25:38 | Creating missing vms: haproxy/878b393c-d817-4e71-8fe5-553ddf87d362 (0) (00:02:05)
    214
    Task 7838 | 00:25:40 | Creating missing vms: mariadb/90ea7861-57ed-43f7-853d-25712a67ba2a (0) (00:02:07)
    215
    Task 7838 | 00:25:49 | Creating missing vms: sourcecontrol-api/3ecb90fa-2211-4df6-82bb-5c91ed9a4310 (0) (00:02:16)
    216
    Task 7838 | 00:25:52 | Creating missing vms: scm-server/6e23addc-33c7-4bb0-af95-d66420f15c06 (0) (00:02:19)
    217
    Task 7838 | 00:25:52 | Creating missing vms: sourcecontrol-webui/840278e2-e1a2-4a30-b904-68538c7cd06f (0) (00:02:19)
    218
    Task 7838 | 00:25:52 | Creating missing vms: sourcecontrol-broker/ec83edb5-130f-4a91-9ac1-20fb622ed0a2 (0) (00:02:19)
    219
    Task 7838 | 00:25:53 | Updating instance scm-server: scm-server/6e23addc-33c7-4bb0-af95-d66420f15c06 (0) (canary) (00:02:39)
    220
    Task 7838 | 00:28:32 | Updating instance mariadb: mariadb/90ea7861-57ed-43f7-853d-25712a67ba2a (0) (canary) (00:02:53)
    221
    Task 7838 | 00:31:25 | Updating instance haproxy: haproxy/878b393c-d817-4e71-8fe5-553ddf87d362 (0) (canary) (00:02:06)
    222
    Task 7838 | 00:33:31 | Updating instance sourcecontrol-webui: sourcecontrol-webui/840278e2-e1a2-4a30-b904-68538c7cd06f (0) (canary) (00:02:08)
    223
    Task 7838 | 00:35:39 | Updating instance sourcecontrol-api: sourcecontrol-api/3ecb90fa-2211-4df6-82bb-5c91ed9a4310 (0) (canary) (00:02:08)
    224
    Task 7838 | 00:37:47 | Updating instance sourcecontrol-broker: sourcecontrol-broker/ec83edb5-130f-4a91-9ac1-20fb622ed0a2 (0) (canary) (00:02:10)
    225
    226
    Task 7838 Started Thu Sep 13 00:18:22 UTC 2018
    227
    Task 7838 Finished Thu Sep 13 00:39:57 UTC 2018
    228
    Task 7838 Duration 00:21:35
    229
    Task 7838 done
    230
    231
    Succeeded
    Copied!
  • 배포된 형상관리 서비스팩을 확인한다.
  • 사용 예시
    1
    $bosh -e micro-bosh -d paasta-sourcecontrol-service vms
    2
    Using environment '10.30.40.111' as user 'admin' (openid, bosh.admin)
    3
    4
    Task 7847. Done
    5
    6
    Deployment 'paasta-sourcecontrol-service'
    7
    8
    Instance Process State AZ IPs VM CID VM Type Active
    9
    haproxy/878b393c-d817-4e71-8fe5-553ddf87d362 running z5 115.68.47.179 vm-cc4c774d-9857-4b3a-9ffc-5f836098eb4e minimal true
    10
    10.30.107.123
    11
    mariadb/90ea7861-57ed-43f7-853d-25712a67ba2a running z5 10.30.107.122 vm-6952fb76-b4d6-4f53-86cb-b0517a76f0d0 minimal true
    12
    scm-server/6e23addc-33c7-4bb0-af95-d66420f15c06 running z5 10.30.107.121 vm-08eb6dd3-04ae-435c-9558-9b78286b730c minimal true
    13
    sourcecontrol-api/3ecb90fa-2211-4df6-82bb-5c91ed9a4310 running z5 10.30.107.125 vm-ee4daa28-3e10-4409-9d6f-ce566d54e8a5 minimal true
    14
    sourcecontrol-broker/ec83edb5-130f-4a91-9ac1-20fb622ed0a2 running z5 10.30.107.126 vm-23d1a9fc-30d2-4a0f-8631-df8807fc8612 minimal true
    15
    sourcecontrol-webui/840278e2-e1a2-4a30-b904-68538c7cd06f running z5 10.30.107.124 vm-0f7300dd-63b5-4399-b1fd-35aeccffac5c minimal true
    16
    17
    6 vms
    18
    19
    Succeeded
    Copied!

2.4. 형상관리 서비스 브로커 등록

형상관리 서비스팩 배포가 완료되었으면 Application에서 서비스 팩을 사용하기 위해서 먼저 형상관리 서비스 브로커를 등록해 주어야 한다. 서비스 브로커 등록 시 개방형 클라우드 플랫폼에서 서비스 브로커를 등록할 수 있는 사용자로 로그인이 되어있어야 한다.

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

$ cf service-brokers
``` Getting service brokers as admin...
name url cubrid-service-broker http://10.30.60.22:8080 delivery-pipline http://paas-ta-delivery-pipline-broker.115.68.46.187.xip.io glusterfs-service http://10.30.120.197:8080 mysql-service-broker http://10.30.40.195:8080 paasta-redis-broker http://10.30.60.71:12350
1
##### 형상관리 서비스 브로커를 등록한다.
2
3
>`$ cf create-service-broker {서비스팩 이름}{서비스팩 사용자ID}{서비스팩 사용자비밀번호} http://{서비스팩 URL}`
4
5
**서비스팩 이름** : 서비스 팩 관리를 위해 PaaS-TA에서 보여지는 명칭이다. 서비스 Marketplace에서는 각각의 API 서비스 명이 보여지니 여기서 명칭은 서비스팩 리스트의 명칭이다.<br>
6
**서비스팩 사용자ID** / 비밀번호 : 서비스팩에 접근할 수 있는 사용자 ID입니다. 서비스팩도 하나의 API 서버이기 때문에 아무나 접근을 허용할 수 없어 접근이 가능한 ID/비밀번호를 입력한다.<br>
7
**서비스팩 URL** : 서비스팩이 제공하는 API를 사용할 수 있는 URL을 입력한다.
8
9
>`$ cf create-service-broker p-paasta-sourcecontrol admin cloudfoundry http://10.30.107.126`
Copied!
inception-new:~/bosh-space/paasta-sourcecontrol-releases/deployment$ cf service-brokers Getting service brokers as admin...
name url cubrid-service-broker http://10.30.60.22:8080 delivery-pipline http://paas-ta-delivery-pipline-broker.115.68.46.187.xip.io glusterfs-service http://10.30.120.197:8080 mysql-service-broker http://10.30.40.195:8080 paasta-redis-broker http://10.30.60.71:12350 paasta-sourcecontrol-broker http://10.30.130.137 rabbitmq
1
- 접근 가능한 서비스 목록을 확인한다.
2
3
>`$ cf service-access`
4
5
- 서비스 브로커 생성 시 디폴트로 접근을 허용하지 않는다.
6
7
- 특정 조직에 해당 서비스 접근 허용을 할당하고 접근 서비스 목록을 다시 확인한다. (전체 조직)
8
9
>`$ cf enable-service-access p-paasta-sourcecontrol` <br>
10
>`$ cf service-access`
Copied!
broker : paasta-sourcecontrol-broker service plan access orgs p-paasta-sourcecontrol Default all
1
- 서비스 브로커 등록 시 최초에는 접근을 허용하지 않는다. 따라서 access는 none으로 설정된다.
2
3
### 2.5. 형상관리 UAA Client Id 등록
4
UAA 포털 계정 등록 절차에 대한 순서를 확인한다.
5
6
**haproxy IPs**:8080 입력 후 루트 도메인을 입력한다.**haproxy IPs**의 주소는 **실제 대시보드 URL**이다. URL 정보 다중 입력 시 ","(comma)를 사용하여 추가한다.
7
>`$ http://115.68.47.179:8080/repositories/user/323900a4-8333-4122-91c3-00d384466ed9`
8
9
##### *haproxy IPs 확인*
10
>`$ bosh -e micro-bosh -d paasta-sourcecontrol-service vms`
Copied!
Deployment 'paasta-sourcecontrol-service'
Instance Process State AZ IPs VM CID VM Type Active haproxy/878b393c-d817-4e71-8fe5-553ddf87d362 running z5 115.68.47.179 vm-cc4c774d-9857-4b3a-9ffc-5f836098eb4e minimal true 10.30.107.123 mariadb/90ea7861-57ed-43f7-853d-25712a67ba2a running z5 10.30.107.122 vm-6952fb76-b4d6-4f53-86cb-b0517a76f0d0 minimal true scm-server/6e23addc-33c7-4bb0-af95-d66420f15c06 running z5 10.30.107.121 vm-08eb6dd3-04ae-435c-9558-9b78286b730c minimal true sourcecontrol-api/3ecb90fa-2211-4df6-82bb-5c91ed9a4310 running z5 10.30.107.125 vm-ee4daa28-3e10-4409-9d6f-ce566d54e8a5 minimal true sourcecontrol-broker/ec83edb5-130f-4a91-9ac1-20fb622ed0a2 running z5 10.30.107.126 vm-23d1a9fc-30d2-4a0f-8631-df8807fc8612 minimal true sourcecontrol-webui/840278e2-e1a2-4a30-b904-68538c7cd06f running z5 10.30.107.124 vm-0f7300dd-63b5-4399-b1fd-35aeccffac5c minimal true
6 vms
1
##### 특정 조직에 해당 서비스 접근 허용을 할당하고 접근 서비스 목록을 다시 확인한다. (전체 조직)
2
>`$ uaac target`
Copied!
Target : https://uaa.115.68.46.186.xip.io Context : admin, from client admin
1
##### URL을 변경하고 싶을 경우 [uaac target https://uaa.115.68.46.186.xip.io] 과 같이 입력하여 변경 가능합니다. (uaac target [URL])
2
3
##### 로그인을 한다.
4
>`$ uaac token client gett`
Copied!
계정 : admin 비밀번호 : password
1
Copied!
Client ID : admin Client secret : *
Successfully fetched token via client credentials grant. Target : https://uaa.115.68.46.186.xip.io Context : admin, from client admin
1
##### SC포탈 계정 생성을 한다.
2
>`$ uaac client add pipeclient -s clientsecret --redirect_uri "[URL]" /
3
--scope "cloud_controller_service_permissions.read , openid , cloud_controller.read , cloud_controller.write , cloud_controller.admin" /
4
--authorized_grant_types "authorization_code , client_credentials , refresh_token" /
5
--authorities="uaa.resource" /
6
--autoapprove="openid , cloud_controller_service_permissions.read""`
Copied!
$ uaac client add scclient -s clientsecret --redirect_uri "http://115.68.47.179:8080 http://115.68.47.179:8080/repositories http://115.68.47.179:8080/repositories/user" --scope "cloud_controller_service_permissions.read , openid , cloud_controller.read , cloud_controller.write , cloud_controller.admin" --authorized_grant_types "authorization_code , client_credentials , refresh_token" --authorities="uaa.resource" --autoapprove="openid , cloud_controller_service_permissions.read
```