์•ˆ๋…•ํ•˜์„ธ์š”

๊ธˆ๋ฒˆ ํฌ์ŠคํŒ…์—์„œ๋Š” IBM Cloud Infrastructure์—์„œ ์ƒ์„ฑํ•œ ICOS(IBM Cloud Object Storage) ๋ฒ„์ผ“์— ๋‹ด๊ธด ์ž๋ฃŒ๋ฅผ ์™ธ๋ถ€์—์„œ ์ ‘๊ทผ ๊ฐ€๋Šฅํ•  ์ˆ˜ ์žˆ๋„๋ก Public-read ์„ค์ •ํ•˜๋Š” ๋ฐฉ๋ฒ•์— ๋Œ€ํ•ด์„œ ์ •๋ฆฌํ•˜์˜€์Šต๋‹ˆ๋‹ค.

๊ธˆ๋ฒˆ ํ•ธ์ฆˆ์˜จ์„ ์ง„ํ–‰ํ•˜๊ธฐ ์œ„ํ•ด์„œ๋Š”

  1. IBM Cloud ๊ณ„์ •
  2. Object Storage Credential
  3. S3 CLI

๊ฐ€ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.

 

1๋ฒˆ, 2๋ฒˆ์€ ๊ณ„์ •์ด ์žˆ์œผ๋ฉด ๋ฐ”๋กœ ์ ‘์† ๋ฐ ICOS ์ƒ์„ฑ์‹œ ์–ป์„ ์ˆ˜ ์žˆ์œผ๋ฏ€๋กœ 3๋ฒˆ ์„ค์น˜๋งŒ ์ง„ํ–‰ํ•˜์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค.
 

IBM Object Storage ์ƒ์„ฑ ๋ฐ ์ด๋ฏธ์ง€ ์—…๋กœ๋“œ

  1. https://control.softlayer.com ์— ์ ‘์†ํ•˜์—ฌ Storage > Object Storage ๋กœ ์ด๋™ํ•ฉ๋‹ˆ๋‹ค.

1
 

  1. ์šฐ์ธก ์ƒ๋‹จ์˜ Order Object Storage๋ฅผ ํด๋ฆญํ•ด Cloud Object Storage โ€“ S3 API๋ฅผ ์„ ํƒํ•˜์—ฌ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.

2
3
 

  1. ์ƒ์„ฑ๋œ S3 ํƒ€์ž…์˜ Object Storage ๋ฅผ ํด๋ฆญํ•ด ๋“ค์–ด๊ฐ€ Bucket์„ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.

4
 

  1. Access & Permissions ํƒญ์œผ๋กœ ์ด๋™ํ•ด Credential์„ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค. ์ดํ›„ S3 CLI๋ฅผ ํ†ตํ•ด ํ•ด๋‹น ์ •๋ณด๋ฅผ ๊ธฐ์ž…ํ•ด Public-read ๊ถŒํ•œ์„ ์ค„ ๋•Œ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.

5
6
 

  1. ICOS ๋ฒ„ํ‚ท์— ์ด๋ฏธ์ง€ ํŒŒ์ผ์„ ์—…๋กœ๋“œํ•ฉ๋‹ˆ๋‹ค.

 

 

CDN ์ƒ์„ฑ

  1. Network > CDN ํƒญ์—์„œ CDNํƒญ์œผ๋กœ ์ด๋™ํ•ฉ๋‹ˆ๋‹ค.. ์‹ค์ œ ๋„๋ฉ”์ธ์„ ๊ฐ€์ง€๊ณ  ๊ณ„์‹œ๋‹ค๋ฉด ํ•ด๋‹น ๋„๋ฉ”์ธ์— ๋งž๊ฒŒ CDN์„ ์ง€์ •ํ•˜์‹ค ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋‹น์žฅ์€ Object Storage Host ๊ฒฝ๋กœ๋ฅผ URL๋กœ ์‚ฌ์šฉํ•  ์˜ˆ์ •์ด๊ธฐ ๋•Œ๋ฌธ์— ๋„๋ฉ”์ธ์ด ์—†์–ด๋„ ๋ฌด๋ฐฉํ•ฉ๋‹ˆ๋‹ค.

7
 

  1. CDN ์„ ๊ตฌ๋งคํ•˜๋ฉด Akamai CDN์„ ๊ตฌ๋งคํ•˜๊ฒŒ ๋ฉ๋‹ˆ๋‹ค. ํ•ด๋‹น ๊ตฌ๋งคํ•˜์‹ค ์‹œ์— Configuration your origin ํƒญ ํ•˜๋‹จ์— Object Storage ๋ฅผ ํด๋ฆญํ•œ ๋’ค ์ •๋ณด๋ฅผ ๊ธฐ์ž…ํ•ฉ๋‹ˆ๋‹ค. Bucket Name์€ ์ž„์˜๋กœ ์„ค์ •ํ•˜๋˜, Endpoint๋Š” object storage์—์„œ ํ™•์ธํ•œ endpoint ์ •๋ณด๋ฅผ ๊ธฐ์ž…ํ•ฉ๋‹ˆ๋‹ค. ์ €๋Š” ์ดˆ๊ธฐ bucket์„ ์ƒ์„ฑํ•  ๋•Œ Cross Region โ€“ us๋ฅผ ์„ ํƒํ•ด ์ƒ์„ฑํ–ˆ๊ธฐ ๋•Œ๋ฌธ์— us-geo์ธs3-api.us-geo.objectstorage.softlayer.net๋ฅผ ์ž…๋ ฅํ•ด ์ƒ์„ฑํ•˜์˜€์Šต๋‹ˆ๋‹ค.

8
 

  1. ์ƒ์„ฑ์„ ์™„๋ฃŒํ•˜๋ฉด CNAME์ด ์ž๋™์œผ๋กœ ์ƒ์„ฑ๋˜๊ณ  Origin์ด Object Storage์˜ host๋กœ ์„ค์ •๋˜์–ด ์žˆ์Œ์„ ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

9
 

 

S3 API ์„ค์น˜ ๋ฐ ์„ค์ •

  1. https://knowledgelayer.softlayer.com/procedure/connecting-cos-s3-using-s3cmd ๋ฅผ ์ฐธ๊ณ ํ•˜์—ฌ S3 CLI๋ฅผ ์„ค์น˜ํ•ฉ๋‹ˆ๋‹ค.

10
 

  1. ์•„๋ž˜ ๋ช…๋ น์–ด๋กœ ํŒจํ‚ค์ง€๋ฅผ ๋‚ด๋ ค๋ฐ›์Šต๋‹ˆ๋‹ค.
    wget -O $HOME/.s3cfg https://gist.githubusercontent.com/greyhoundforty/676814921b8f4367fba7604e622d10f3/raw/422abaeb70f1c17cd5308745c0e446b047c123e0/s3cfg

11
 

  1. ์œ„์˜ ๋ช…๋ น์–ด์—์„œ ์•Œ ์ˆ˜ ์žˆ๋“ฏ์ด ($HOME/.s3cfg) $HOME ๊ฒฝ๋กœ๋กœ ์ด๋™ํ•ด .s3cfgํŒŒ์ผ์„ ์ˆ˜์ •ํ•ฉ๋‹ˆ๋‹ค. ์ด ์•ˆ์— ์ด์ „์— ํ™•์ธํ–ˆ๋˜ ICOS Credential์„ ๋„ฃ์–ด ์ˆ˜์ •ํ•ฉ๋‹ˆ๋‹ค.
    access_key, secret_key, host_base์™€ host_bucket ๋ž€์„ ์ˆ˜์ •ํ•ฉ๋‹ˆ๋‹ค.
    : access_key = cos_access_key
    -> Access Key ID
    : host_base = cos_endpoint
    -> s3-api.us-geo.objectstorage.softlayer.net
    : host_bucket = %(bucket)s.cos_endpoint
    ->ย %(bucket)s.s3-api.us-geo.objectstorage.softlayer.net
    : secret_key = cos_secret_key
    -> Secret Access Key

์ˆ˜์ • ํ›„ s3cmd ls ๋ช…๋ น์–ด๋ฅผ ํ†ตํ•ด ๊ณ„์ • ๋‚ด ๋ฒ„ํ‚ท ๋ฆฌ์ŠคํŠธ๋ฅผ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
12
 

  1. ํ˜„์žฌ๊นŒ์ง€ ์ง„ํ–‰ํ•˜๊ณ  Object Storage์˜ Host URL๋กœ ํ•ด๋‹น ๋ฒ„ํ‚ท ๋‚ด ์ด๋ฏธ์ง€ ํŒŒ์ผ์„ ์ฐธ์กฐํ•˜๋ฉด ์ ‘๊ทผ๊ถŒํ•œ์ด ์—†์Œ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

13
 

  1. ์ด์ œ ๋ฒ„ํ‚ท์— Public-read ๊ถŒํ•œ์„ ์ฃผ๊ธฐ ์œ„ํ•ด ํ•ด๋‹น ๋ช…๋ น์–ด๋ฅผ ์ด์šฉํ•ฉ๋‹ˆ๋‹ค. ๊ธฐ๋ณธ์ ์œผ๋กœ ICOS๋Š” S3 API ๋ฅผ ์ง€์›ํ•˜๊ธฐ ๋•Œ๋ฌธ์— ๋ช…๋ น์–ด๋„ ํ•ด๋‹น Doc์„ ์ฐธ๊ณ ํ•ด ์ง„ํ–‰ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์—ฌ๊ธฐ์„œ cross-test๋Š” ์ œ๊ฐ€ ์ƒ์„ฑํ•œ ๋ฒ„ํ‚ท ์ด๋ฆ„์ž…๋‹ˆ๋‹ค.
    s3cmd setacl s3://cross-test/ –acl-public –recursive

14
 

  1. ๋‹ค์‹œ ํ•œ๋ฒˆ URL์„ ํ™•์ธํ•˜๋ฉด ์ •์ƒ์ ์œผ๋กœ ์ด๋ฏธ์ง€๊ฐ€ ๋œจ๋Š” ๊ฒƒ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

16
 

 

ํ† ๋ก  ์ฐธ๊ฐ€

์ด๋ฉ”์ผ์€ ๊ณต๊ฐœ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ํ•„์ˆ˜ ์ž…๋ ฅ์ฐฝ์€ * ๋กœ ํ‘œ์‹œ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.