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
[日本語]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
180
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
910
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
230
WordPress with CloudFront + AMAZON RDS + S3
amimoto
1
720
Other Decks in How-to & DIY
See All in How-to & DIY
なぜJAWS-UGはこんなにも活発なのか?
awsjcpm
1
250
献立を支える技術
godan
1
110
多摩ニュータウンを、 味わう
aokiplayer
2
720
AWS Summit Japan 2025 個人的参加レポート
midnight480
0
460
MustをWillに変える技術 〜アイドル・郁田はるきが"すべき"の壁を超えるまで〜
subroh0508
1
2k
파이썬 토룡신점 운영후기
lqez
0
560
JAWS-UG/AWS Community Update - 2026/6/13 JAWS-UG TOHOKU 仙台
awsjcpm
0
1.2k
AWS Community Builders Update - JAWS-UG Tokyo and Sainokuni
awsjcpm
3
290
ドローンをAWSで制御してみた
nagi900
0
170
How to Stylus 20251031
hareyakayuruyaka
0
160
Azure PortalのQoLを上げてたら Big Techに怒られた
horihiro
2
610
大学内にファブスペースをつくってみた #sapporo3dp / Making HIU Fab
yumulab
1
190
Featured
See All Featured
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
200
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
270
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
400
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
430
Being A Developer After 40
akosma
91
590k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
400
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
460
30 Presentation Tips
portentint
PRO
1
360
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
370
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.7k
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