Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Introduction of SQALE
Search
SHIBATA Hiroshi
March 15, 2014
0
910
Introduction of SQALE
SHIBATA Hiroshi
March 15, 2014
Tweet
Share
More Decks by SHIBATA Hiroshi
See All by SHIBATA Hiroshi
How to make faster release cycle of Ruby?
hsbt
2
5.8k
Ruby の開発を支えるエコシステム
hsbt
4
2.3k
Why is building the Ruby environment hard?
hsbt
6
7.8k
開発環境へのこだわり
hsbt
16
12k
OSS ことはじめ
hsbt
5
1.4k
GMO DevNight 05 在宅勤務開始から2ヶ月でやったこと
hsbt
2
560
Development Environment 2019
hsbt
1
350
How to become the Psychic
hsbt
0
2k
Software Development
hsbt
1
6.6k
Featured
See All Featured
Building a Modern Day E-commerce SEO Strategy
aleyda
45
8.1k
Code Review Best Practice
trishagee
72
19k
Designing Experiences People Love
moore
142
24k
Navigating Team Friction
lara
190
16k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
The Invisible Side of Design
smashingmag
302
51k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.8k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.3k
Optimizing for Happiness
mojombo
379
70k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.5k
Transcript
! Introduction of SQALE ! Hiroshi SHIBATA @hsbt WIDE Camp
Spring 2014
self
SHIBATA Hiroshi(@hsbt)
Ruby Jenkins RailsGirls tDiary
None
None
ຊࣾ ࢧࣾ
None
ϛυϧΣΞͷΞοϓάϨʔυ ࣾ։ൃج൫ͷߏங ౷ܭج൫ͷߏங +409ͷӡ༻උ HJUIVC ηΩϡϦςΟࠪ ίʔυϨϏϡʔ ςετج൫ͷߏங ΞΫηεղੳج൫ͷߏங ։ൃϓϩηε
৽ਓڭҭ ݪߘࣥච ΧϯϑΝϨϯεൃද 044։ൃ αʔόʔߏཧͷ৽ ϦʔϯελʔτΞοϓ +FOLJOT 3VCZ3BJMT 3%#.4
ϛυϧΣΞͷΞοϓάϨʔυ ࣾ։ൃج൫ͷߏங ౷ܭج൫ͷߏங +409ͷӡ༻උ HJUIVC ηΩϡϦςΟࠪ ίʔυϨϏϡʔ ςετج൫ͷߏங ΞΫηεղੳج൫ͷߏங ։ൃϓϩηε
৽ਓڭҭ ݪߘࣥච ΧϯϑΝϨϯεൃද 044։ൃ αʔόʔߏཧͷ৽ ϦʔϯελʔτΞοϓ +FOLJOT 3VCZ3BJMT 3%#.4
00:03:00
SQALE
None
None
None
Ruby on Rails AWS/LXC puppet/chef
Ruby on Rails ๛ͳϛυϧΣΞ ࣗಈςετ Open Source
AWS EC2 EBS Route53 ELB RDS αʔόʔ ӬଓԽྖҬ(Ϣʔβʔσʔλ) ϢʔβʔυϝΠϯ ϦόʔεϓϩΩγ
ڞ༗DB
AWS Amazon Linux Patched Kernel RedHat Linux ϕʔε ӡ༻ϊϋ͕͋Δ grsecurity
fork bomb restrict bind
AWS ؋ͷEC2Πϯελϯε lxc ͰϚϧνςφϯτΛ࣮ݱ Ruby ͱ PHP Λར༻Մೳ
00:06:00
1BB4ͷ࡞Γํ 4RBMFͷ߹ !IJCPNB QBQFSCPZDP
3VCZίϯςφ w /HJOY 3VCZ 3BDLΞϓϦ Λಈ͔ͤΔ-9$ڥ w 3VCZʙͷ࠷৽ύονϨϕϧΛఏڙ w TVQFSWJTPSEͰ/HJOYͱ3BDLΞϓϦΛࢹ
w 44) $SPO༻Մ w σϓϩΠ͢ΔͱCVOEMFJOTUBMM BTTFUTQSFDPNQJMFͳͲΛ ࣗಈͰߦ͍3BDLΞϓϦΛ࠶ىಈ͢Δ ఏڙத
3VCZίϯςφ w /HJOYQPSU OͰMJTUFO w TTIEQPSU OͰMJTUFO w
Oίϯςφ͝ͱʹҰҙͷ w OFUXPSLOBNFTQBDF༻͍ͯ͠ͳ͍ w ίϯςφͰ5$1QPSUͷCJOE Λ੍ݶ͢Δύονͯͨ
1)1ίϯςφ w "QBDIF QIQGQNΛಈ͔ͤΔ-9$ڥ w ܥΛఏڙ w TVQFSWJTPSEͰ"QBDIFͱQIQGQNΛࢹ w
44) $SPO༻Մ
SPPUGT w ίϯςφ༻ͷϑΝΠϧπϦʔΛSPPUGTͱݺΜͰ͍·͢ w શͯͷίϯςφͰNPVOU͢ΔσΟϨΫτϦπϦʔ
$ sudo yum --releasever=$ver --installroot=/var/rootfs/$role/ groupinstall Base SPPUGTͷߏங w 3VCZ
1)1ͦΕͧΕ༻ͷSPPUGT 㲈DISPPUڥ Λ࡞Δ ZVNJOTUBMMSPPUͰϕʔεΛ࡞Δ SVCZDIFGTPMPೖΕΔ DISPPUͯ͠DIFGTPMPͰϖνϖνͯ͠ߏங ɾ/HJOYͱ͔"QBDIFͱ͔3VCZ 1)1Λ͍Εͯ͘ w ߏங࣌ʹMYDͷςϯϓϨʔτͬͯͳ͍ w ͓खຊͱͯ͠Կࢀর͠·ͨ͠
SPPUGT w SPPUGTΛMYDTUBSUىಈ࣌ʹͱͯ͠NPVOUCJOE SP ߋʹϢʔβྖҬ  ΛNPVOUCJOE w ϢʔβྖҬҎ֎SFBEPOMZ FSSOPJT&30'4
Ϧιʔε੍ݶ w 2ίϯςφͷ$16 ϝϞϦͷϦιʔε੍ݶ w "DHSPVQDQVTFU DHSPVQNFNPSZͰجຊ௨Γ w MYDTUBSUͷઃఆϑΝΠϧʹهड़ w
ಈతʹมߋ͢Δӡ༻ ·ͩ ͍ͯ͠ͳ͍
MYDTUBSUͷࢹ w MYDTUBSUNPOJUͰࢹ MYDTUBSU͕όάͰࢭ·ͬͨ͜ͱࠓΜॴ؍ଌͯ͠ແ͍ w ͘͝ॳظʹTVQFSWJTPSEͰࢹ͕ͯͨ͠ TVQFSWJTPSEΛఀࢭ͢ΔͱMYDTUBSU͕PSQIBOFE ʹͳͬͯհͳͷͰNPOJUʹͨ͠
00:10:00
ϧʔςΟϯά w ίϯςφΛ࡞ͬͯ࣍ʹߟ͑ͳ͍ͱ͍͚ͳ͍͜ͱ w υϝΠϯཧͲ͏͢Δ w )551 44) (JU PWFS44)
ͰͲ͏ΞΫηεͤ͞Δ w ϩʔυόϥϯαϦόʔεϓϩΩγΛհͯ͠ΞΫηε͍ͤͨ͞ w )5513FWFSTF1SPYZ w 44)3FWFSTF1SPYZ
υϝΠϯཧ 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
)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ཧ) ᶃ ᶄ ᶅ ᶆ
44)ͷϧʔςΟϯά ELB SSH Router Patched OpenSSH SSH Git SFTP Git
Server File server DB (MySQL) ެ։伴ೝূ ɾϢʔβ͕ొͨ͠ެ։伴ͱর߹͢Δ ɾऩ༰͞Ε͍ͯΔίϯςφΛ͍߹ΘͤΔ SSH Git SFTP Git SFTP SSH ᶃ ᶄ ᶅ ᶆ
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ΞϓϦͷ࠶ىಈ
ಠࣗυϝΠϯ44- w 44-͝ͱʹ&-#ΛׂΓͯ w 44-ূ໌ॻΛΞοϓϩʔυͯ͠Β͍&-#ʹΞλον Redis ELB Nginx + Lua
ELB ಠࣗυϝΠϯ HTTPS +SSL HTTP
00:13:00
Feature ϩάू ࣾϓϥοτϑΥʔϜ fluentd, logplex, etc. طଘͷϗεςΟϯάͷԠ༻ ࠷৽ͷ Ruby ͱ
PHP ͷఏڙ ӬଓԽσʔλͷݟ͠
Feature গਓͰͷӡ༻ ઐ༻Πϯελϯε OSSͷੵۃత׆༻ ࣗಈԽ ϏδωεϢʔε VPS
None
00:15:00