Slide 1

Slide 1 text

! Introduction of SQALE ! Hiroshi SHIBATA @hsbt WIDE Camp Spring 2014

Slide 2

Slide 2 text

self

Slide 3

Slide 3 text

SHIBATA Hiroshi(@hsbt)

Slide 4

Slide 4 text

Ruby Jenkins RailsGirls tDiary

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

ຊࣾ ࢧࣾ

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

ϛυϧ΢ΣΞͷΞοϓάϨʔυ ࣾ಺։ൃج൫ͷߏங ౷ܭج൫ͷߏங +409ͷӡ༻੔උ HJUIVC ηΩϡϦςΟ؂ࠪ ίʔυϨϏϡʔ ςετج൫ͷߏங ΞΫηεղੳج൫ͷߏங ։ൃϓϩηε ৽ਓڭҭ ݪߘࣥච ΧϯϑΝϨϯεൃද 044։ൃ αʔόʔߏ੒؅ཧͷ࡮৽ ϦʔϯελʔτΞοϓ +FOLJOT 3VCZ3BJMT 3%#.4

Slide 10

Slide 10 text

ϛυϧ΢ΣΞͷΞοϓάϨʔυ ࣾ಺։ൃج൫ͷߏங ౷ܭج൫ͷߏங +409ͷӡ༻੔උ HJUIVC ηΩϡϦςΟ؂ࠪ ίʔυϨϏϡʔ ςετج൫ͷߏங ΞΫηεղੳج൫ͷߏங ։ൃϓϩηε ৽ਓڭҭ ݪߘࣥච ΧϯϑΝϨϯεൃද 044։ൃ αʔόʔߏ੒؅ཧͷ࡮৽ ϦʔϯελʔτΞοϓ +FOLJOT 3VCZ3BJMT 3%#.4

Slide 11

Slide 11 text

00:03:00

Slide 12

Slide 12 text

SQALE

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

Ruby on Rails AWS/LXC puppet/chef

Slide 17

Slide 17 text

Ruby on Rails ๛෋ͳϛυϧ΢ΣΞ ࣗಈςετ Open Source

Slide 18

Slide 18 text

AWS EC2 EBS Route53 ELB RDS αʔόʔ ӬଓԽྖҬ(Ϣʔβʔσʔλ) ϢʔβʔυϝΠϯ ϦόʔεϓϩΩγ ڞ༗DB

Slide 19

Slide 19 text

AWS Amazon Linux Patched Kernel RedHat Linux ϕʔε ӡ༻ϊ΢ϋ΢͕͋Δ grsecurity fork bomb restrict bind

Slide 20

Slide 20 text

AWS ฼؋ͷEC2Πϯελϯε lxc ͰϚϧνςφϯτΛ࣮ݱ Ruby ͱ PHP Λར༻Մೳ

Slide 21

Slide 21 text

00:06:00

Slide 22

Slide 22 text

1BB4ͷ࡞Γํ 4RBMFͷ৔߹ !IJCPNB QBQFSCPZDP

Slide 23

Slide 23 text

3VCZίϯςφ w /HJOY3VCZ 3BDLΞϓϦ Λಈ͔ͤΔ-9$؀ڥ w 3VCZʙͷ࠷৽ύονϨϕϧΛఏڙ w TVQFSWJTPSEͰ/HJOYͱ3BDLΞϓϦΛ؂ࢹ w 44) $SPO࢖༻Մ w σϓϩΠ͢ΔͱCVOEMFJOTUBMM BTTFUTQSFDPNQJMFͳͲΛ ࣗಈͰߦ͍3BDLΞϓϦΛ࠶ىಈ͢Δ ஫΋ఏڙத

Slide 24

Slide 24 text

3VCZίϯςφ w /HJOY͸QPSUOͰMJTUFO w TTIE͸QPSUOͰMJTUFO w O͸ίϯςφ͝ͱʹҰҙͷ਺஋ w OFUXPSLOBNFTQBDF͸࢖༻͍ͯ͠ͳ͍ w ίϯςφ಺Ͱ5$1QPSUͷCJOE Λ੍ݶ͢Δύον౰ͯͨ

Slide 25

Slide 25 text

1)1ίϯςφ w "QBDIFQIQ—GQNΛಈ͔ͤΔ-9$؀ڥ w ܥΛఏڙ w TVQFSWJTPSEͰ"QBDIFͱQIQGQNΛ؂ࢹ w 44) $SPO࢖༻Մ

Slide 26

Slide 26 text

SPPUGT w ίϯςφ༻ͷϑΝΠϧπϦʔΛSPPUGTͱݺΜͰ͍·͢ w શͯͷίϯςφͰNPVOU͢ΔσΟϨΫτϦπϦʔ

Slide 27

Slide 27 text

$ sudo yum --releasever=$ver --installroot=/var/rootfs/$role/ groupinstall Base SPPUGTͷߏங w 3VCZ 1)1ͦΕͧΕ༻ͷSPPUGT 㲈DISPPU؀ڥ Λ࡞Δ ZVNJOTUBMMSPPUͰϕʔεΛ࡞Δ SVCZ΍DIFGTPMP΋ೖΕΔ DISPPUͯ͠DIFGTPMPͰϖνϖνͯ͠ߏங ɾ/HJOYͱ͔"QBDIFͱ͔3VCZ 1)1Λ͍Εͯ͘ w ߏங࣌ʹMYDͷςϯϓϨʔτ͸࢖ͬͯͳ͍ w ͓खຊͱͯ͠Կ౓΋ࢀর͠·ͨ͠

Slide 28

Slide 28 text

SPPUGT w SPPUGTΛMYDTUBSUىಈ࣌ʹͱͯ͠NPVOUCJOE SP ߋʹϢʔβྖҬ ΛNPVOUCJOE w ϢʔβྖҬҎ֎͸SFBEPOMZ FSSOPJT&30'4

Slide 29

Slide 29 text

Ϧιʔε੍ݶ w 2ίϯςφͷ$16 ϝϞϦͷϦιʔε੍ݶ͸ w "DHSPVQDQVTFU DHSPVQNFNPSZͰجຊ௨Γ w MYDTUBSUͷઃఆϑΝΠϧʹهड़ w ಈతʹมߋ͢Δӡ༻͸ ·ͩ ͍ͯ͠ͳ͍

Slide 30

Slide 30 text

MYDTUBSUͷ؂ࢹ w MYDTUBSU͸NPOJUͰ؂ࢹ MYDTUBSU͕όάͰࢭ·ͬͨ͜ͱ͸ࠓΜॴ؍ଌͯ͠ແ͍ w ͘͝ॳظʹTVQFSWJTPSEͰ؂ࢹ͕ͯͨ͠ TVQFSWJTPSEΛఀࢭ͢ΔͱMYDTUBSU͕PSQIBOFE ʹͳͬͯ໽հͳͷͰNPOJUʹͨ͠

Slide 31

Slide 31 text

00:10:00

Slide 32

Slide 32 text

ϧʔςΟϯά w ίϯςφΛ࡞ͬͯ࣍ʹߟ͑ͳ͍ͱ͍͚ͳ͍͜ͱ w υϝΠϯ؅ཧͲ͏͢Δ w )551 44) (JU PWFS44) ͰͲ͏ΞΫηεͤ͞Δ w ϩʔυόϥϯα΍ϦόʔεϓϩΩγΛհͯ͠ΞΫηε͍ͤͨ͞ w )5513FWFSTF1SPYZ w 44)3FWFSTF1SPYZ

Slide 33

Slide 33 text

υϝΠϯ؅ཧ w 3PVUFͰTRBMFKQυϝΠϯΛ؅ཧ w $/".&Λ&-#ʹ޲͚͍ͯΔ w w ίϯςφ࡞੒ഁغͷλΠϛϯάͰ3PVUFͷ"1*Λୟ͘ ELB Proxy CNAME: ruby-hiboma.sqale.jp ruby-hiboma.sqale.jp. 0 IN CNAME proxy-lb001-******.ap-northeast-1.elb.amazonaws.com. Route53 HTTP DNS

Slide 34

Slide 34 text

)551ͷಈతϧʔςΟϯά Redis ELB Nginx + Lua CNAME: ruby-hiboma.sqale.jp Hostϔομ (CNAME) ಺෦ϗετ ruby-hiboma.sqale.jp users001.sqale.lan:8000 php-sushi.sqale.jp users002.sqale.lan:8100 users001.sqale.lan:8001 Hostϔομ(CNAME) Λ Redis ʹ౤͛ͯ ಺෦ϗετʹม׵ CNAME Λ ELB ʹ޲͚ͯΔ (Route53؅ཧ) ᶃ ᶄ ᶅ ᶆ

Slide 35

Slide 35 text

44)ͷϧʔςΟϯά ELB SSH Router Patched OpenSSH SSH Git SFTP Git Server File server DB (MySQL) ެ։伴ೝূ ɾϢʔβ͕ొ࿥ͨ͠ެ։伴ͱর߹͢Δ ɾऩ༰͞Ε͍ͯΔίϯςφΛ໰͍߹ΘͤΔ SSH Git SFTP Git SFTP SSH ᶃ ᶄ ᶅ ᶆ

Slide 36

Slide 36 text

HJUQVTIͷϧʔςΟϯά ELB SSH Router Patched OpenSSH git push Build Server Git Server DB (MySQL) ... ... ᶃ ᶄ ᶅ ᶆ bundle install assets:precompile etc ... git ͷ hook εΫϦϓτ ͰΩϡʔʹjob௥Ճ git clone rsync RackΞϓϦͷ࠶ىಈ

Slide 37

Slide 37 text

ಠࣗυϝΠϯ44- w 44-͝ͱʹ&-#ΛׂΓ౰ͯ w 44-ূ໌ॻΛΞοϓϩʔυͯ͠΋Β͍&-#ʹΞλον Redis ELB Nginx + Lua ELB ಠࣗυϝΠϯ HTTPS +SSL HTTP

Slide 38

Slide 38 text

00:13:00

Slide 39

Slide 39 text

Feature ϩάू໿ ࣾ಺ϓϥοτϑΥʔϜ fluentd, logplex, etc. طଘͷϗεςΟϯά΁ͷԠ༻ ࠷৽ͷ Ruby ͱ PHP ͷఏڙ ӬଓԽσʔλͷݟ௚͠

Slide 40

Slide 40 text

Feature গਓ਺Ͱͷӡ༻ ઐ༻Πϯελϯε OSSͷੵۃత׆༻ ࣗಈԽ ϏδωεϢʔε VPS

Slide 41

Slide 41 text

No content

Slide 42

Slide 42 text

00:15:00