Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Introduction of SQALE
Search
SHIBATA Hiroshi
March 15, 2014
0
840
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.2k
Ruby の開発を支えるエコシステム
hsbt
4
2.1k
Why is building the Ruby environment hard?
hsbt
6
6.8k
開発環境へのこだわり
hsbt
15
12k
OSS ことはじめ
hsbt
5
1.3k
GMO DevNight 05 在宅勤務開始から2ヶ月でやったこと
hsbt
2
480
Development Environment 2019
hsbt
1
310
How to become the Psychic
hsbt
0
1.9k
Software Development
hsbt
1
6.4k
Featured
See All Featured
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
47
2.1k
Producing Creativity
orderedlist
PRO
341
39k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
506
140k
Keith and Marios Guide to Fast Websites
keithpitt
409
22k
Faster Mobile Websites
deanohume
305
30k
Measuring & Analyzing Core Web Vitals
bluesmoon
4
120
Rails Girls Zürich Keynote
gr2m
94
13k
VelocityConf: Rendering Performance Case Studies
addyosmani
325
24k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
860
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2.1k
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