Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
[日本語]How to use Amazon RDS with AMIMOTO AMI Wor...
Search
Amimoto - Flexible Cloud WordPress Hosting
March 25, 2016
How-to & DIY
2.7k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
[日本語]How to use Amazon RDS with AMIMOTO AMI WordPress
AMIMOTOでRDSを利用する方法
Amimoto - Flexible Cloud WordPress Hosting
March 25, 2016
More Decks by Amimoto - Flexible Cloud WordPress Hosting
See All by Amimoto - Flexible Cloud WordPress Hosting
[日本語] AMIMOTO-AMI Lineup
amimoto
0
190
EdgeCase - A speaker series by J2 Design
amimoto
0
380
Progress the system operation drastically with Cloud Automator — AMIMOTO side—
amimoto
0
210
[東京]Cloud_Automatorで攻めのシステム運用 AMIMOTO スタック編
amimoto
0
920
AMIMOTO Design Pattern + Server-less Architecture
amimoto
0
530
WooCommerce with Elasticsearch
amimoto
1
490
[日本語] WooCommerce with Elasticsearch
amimoto
0
270
Amazon CloudFront with AWS Certificate Manager
amimoto
0
240
WordPress with CloudFront + AMAZON RDS + S3
amimoto
1
730
Other Decks in How-to & DIY
See All in How-to & DIY
ときメモは 運営が30年かけて “実プレイ”していた
mzryuka
0
160
JAWS-UG/AWSコミュニティ アップデート (JAWS-UG函館支部)
awsjcpm
3
190
JAWS-UG/AWS Community Update 彩の国埼玉支部1周年記念
awsjcpm
1
180
ROSAというLLM使ったROSエージェントをおもちゃに実装してみた話
takeofuture
0
330
放っておくと怖い睡眠負債について/fjordbootcamp-251122
yuukago
3
380
エッジで動くNode-REDを作る実験 #noderedjp #noderedcon
n0bisuke2
0
670
JAWS-UG 福岡 KYUSYU QUEST - AWSコミュニティ支援のいまむかし
awsjcpm
0
160
お前も同人作家にならないか? 技術系同人誌制作入門
arkw
3
150
M5StickS3触ってXiaoZhiAI触ってみた #にぼし香 #iotlt
n0bisuke2
0
320
キャリア科目では教えてくれない、就活を生き抜く法則
logica0419
2
320
How to Stylus 20251031
hareyakayuruyaka
0
190
EXPO 2025 大屋根リングをぐるっと周回! 【GPSマルチユニット×ソラカメ実験】
scbc1167
0
160
Featured
See All Featured
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
2
2.2k
A Modern Web Designer's Workflow
chriscoyier
699
190k
Into the Great Unknown - MozCon
thekraken
41
2.7k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.3k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Bash Introduction
62gerente
615
220k
What does AI have to do with Human Rights?
axbom
PRO
1
2.4k
Design in an AI World
tapps
1
340
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
350
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
530
Rebuilding a faster, lazier Slack
samanthasiow
85
9.7k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Transcript
@Amimoto_Ami amimoto-ami.com AMIMOTO (HHVM) + AMAZON RDS
AMAZON RDS ͱ
εέʔϥϒϧ ར༻Մೳͳ6ͭͷDB Τϯδϯ ϦϨʔγϣφϧσʔλϕʔε ༰қͳઃఆͱӡ༻
ϝϦοτ •εέʔϧՄೳͳ CPUɼIOPSɼετϨʔδ •ࣗಈ·ͨҙͷόοΫΞοϓ͕ εφοϓγϣοτ͔ΒՄೳ • ϚϧνΞϕΠϥϏϦςΟκʔϯͷσϓϩΠ • ϓϥΠϚϦͷোൃੜ࣌ʹ ଈ࠲ʹηΧϯμϦΓସ͑Մೳ
σϝϦοτ • DB ͷγΣϧΞΫηε͕Ͱ͖ͳ͍ • Ϣʔβݖݶʹ੍͕͋Δ • MySQL ͰͷϨϓϦέʔγϣϯ͕ແޮ •
ि4࣌ؒͷϝϯςφϯεΟϯυදࣔ • ࢭΊΒΕͳ͍ RDS Πϯελϯε
RDS DBΛ Ҡߦ͠Α͏
RDS ͷͳ͍ΞʔΩςΫνϟ
RDS ͷ͋ΔΞʔΩςΫνϟ
AWS ίϯιʔϧ ϩάΠϯ
MySQL Λ Amazon RDS ʹ࡞
σʔλϕʔεΤϯδϯͷબ
σʔλϕʔεΤϯδϯͷબ
σʔλϕʔεͷ֤छઃఆ
σʔλϕʔεͷৄࡉઃఆ
σʔλϕʔεͷ࡞
࡞͞Εͨ σʔλϕʔε
SSH ͰΠϯελϯεϩάΠϯ
EC2 Λ RDS ଓ͠·͢ 1. SSH Ͱαʔόଓ͠·͢: $ ssh
-i /Users/USERNAME/Desktop/example.pem ec2-user@instance_ip or domain 2. ࣍ͷίϚϯυΛ࣮ߦͯ͠ MySQL ଓ͍ͯͩ͘͠͞: $ mysql -h {endpoint} -P 3306 -u {mymasteruser} -p
{endpoint} AWS Management Console ͷ RDS ใͰ֬ೝͰ͖·͢ {mymasteruser} ͱ
ύεϫʔυ RDS ࡞࣌ʹࢦఆͨ͠ͷΛೖྗ͍ͯͩ͘͠͞
σʔλϕʔεͷϚΠάϨʔγϣϯ wp-cli Ͱ MySQL ͔ΒσʔλΛΤΫεϙʔτ͠·͢: $ wp --path=/path/to/wordpress db
export /path/to/wordpress WordPress ͷΠϯετʔϧσΟϨΫτϦΛࢦఆ͍ͯͩ͘͠͞ɻ AMIMOTO AMI Ͱ௨ৗ /var/www/vhosts/{instance_id} ͱͳ͍ͬͯ·͢ɻ
σʔλϕʔεͷϚΠάϨʔγϣϯ ΤΫεϙʔτͨ͠σʔλΛ RDS Πϯϙʔτ͠·͢: $ mysql -h {endpoint} -P
3306 -u {mymasteruser} -p {databasename} < dump.sql {endpoint} AWS Management Console ͷ RDS ใͰ֬ೝͰ͖·͢ɻ {mymasteruser} ͱ {databasename} RDS ࡞࣌ʹࢦఆͨ͠ͷΛೖྗ͍ͯͩ͘͠͞
wp-config.php ͷฤू // ** MySQL settings - You can get
this info from your web host ** // $db_data = false; if ( file_exists('/opt/aws/cloud_formation.json') ) { $db_data = json_decode(file_get_contents('/opt/aws/ cloud_formation.json'), true); if ( isset($db_data['rds']) ) { $db_data = $db_data['rds']; $db_data['host'] = $db_data['endpoint'] . ':' . $db_data['port']; } } if ( !$db_data ) { $db_data = array( 'database' => 'RDS_DATABASE_NAME_HERE', 'username' => 'RDS_USER_NAME_HERE', 'password' => 'RDS_PASSWORD_HERE', 'host' => 'RDS_ENDPOINT_HERE', ); }
wp-config.php ͷฤू RDS_DATABASE_NAME_HERE: σʔϕʔεͷৄࡉઃఆͰઃఆࡁΈͷσʔλϕʔε໊ RDS_USER_NAME_HERE: σʔλϕʔεͷ֤छઃఆͰઃఆࡁΈͷϢʔβ໊ RDS_PASSWORD_HERE: σʔλϕʔεͷ֤छઃఆͰઃఆࡁΈͷύεϫʔυ RDS_ENDPOINT_HERE: RDS
ͷΤϯυϙΠϯτ wp-config.php ্ͷઃఆΛೖΕͨ͋ͱ WordPress ʹଓͰ͖Δ͔͔͘Μ͍ͯͩ͘͠͞ɻ
AMIMOTO AMI ͷ MySQL ΛࢭΊΔ MySQL Λ RDS Ҡಈͤ͞Δͱ AMIMOTO
AMI ͷ MySQL ϓϩηε͕ෆཁʹͳΓ·͢ɻ ઃఆϑΝΠϧΛฤूͯ͠ MySQL ϓϩηεΛऴ͍ྃͤͯͩ͘͞͞ɻ AMIMOTO AMI ͰϛυϧΣΞͷઃఆ /opt/local/amimoto.json ʹ͋Δ chef-solo Λ͍ͬͯ·͢ɻ
AMIMOTO AMI ͷ MySQL ΛࢭΊΔ MySQL Λ RDS Ҡಈͤ͞Δͱ AMIMOTO
AMI ͷ MySQL ϓϩηε͕ෆཁʹͳΓ·͢ɻ ઃఆϑΝΠϧΛฤूͯ͠ MySQL ϓϩηεΛऴ͍ྃͤͯͩ͘͞͞ɻ AMIMOTO AMI ͰϛυϧΣΞͷઃఆ /opt/local/amimoto.json ʹ͋Δ chef-solo Λ͍ͬͯ·͢ɻ MySQL Λఀࢭͤ͞ΔʹϑΝΠϧΛ࣍ͷΑ͏ʹॻ͖͍͑ͯͩ͘͞: { "nginx" : { "config" : { "user" : "nginx", "group" : "nginx" } }, "php" : { "config" : { "user" : "nginx", "group" : "nginx" } }, "mysql" : { "enabled" : false }, "phpfpm" : { "enabled" : true }, "run_list" : [ "recipe[amimoto]" ] }
AMIMOTO AMI ͷ MySQL ΛࢭΊΔ AMIMOTO AMI HHVM ൛ͷ߹ҎԼͷΑ͏ʹมߋ͍ͯͩ͘͠͞: {
"nginx" : { "config" : { "user" : "nginx", "group" : "nginx" } }, "php" : { "config" : { "user" : "nginx", "group" : "nginx" } }, "mysql" : { "enabled" : false }, "hhvm" : { "enabled" : true }, "run_list" : [ "recipe[amimoto]" ] }
AMIMOTO AMI ͷ MySQL ΛࢭΊΔ ࠷ޙʹ࣍ͷίϚϯυΛ࣮ߦ͍ͯͩ͘͠͞: $ sudo /opt/local/proviosion
$ mysql stop service
ja.amimoto-ami.com/slack ࣭͓͝ड͚͍ͨ͠·͢:
@Amimoto_Ami amimoto-ami.com THANK YOU! AMIMOTO (HHVM) + AMAZON RDS