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
830
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.7k
開発環境へのこだわり
hsbt
15
12k
OSS ことはじめ
hsbt
5
1.3k
GMO DevNight 05 在宅勤務開始から2ヶ月でやったこと
hsbt
2
470
Development Environment 2019
hsbt
1
300
How to become the Psychic
hsbt
0
1.8k
Software Development
hsbt
1
6.4k
Featured
See All Featured
Side Projects
sachag
452
42k
Building Adaptive Systems
keathley
38
2.2k
Build The Right Thing And Hit Your Dates
maggiecrowley
32
2.4k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
6.9k
Done Done
chrislema
181
16k
Mobile First: as difficult as doing things right
swwweet
222
8.9k
GitHub's CSS Performance
jonrohan
1030
460k
Producing Creativity
orderedlist
PRO
341
39k
GraphQLの誤解/rethinking-graphql
sonatard
66
9.9k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
10 Git Anti Patterns You Should be Aware of
lemiorhan
653
59k
What's new in Ruby 2.0
geeforr
342
31k
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