Update for Advanced Demo - Web App - Single Server to Elastic Evolution - STAGE 2
See original GitHub issueIn section https://github.com/acantril/learn-cantrill-io-labs/blob/master/aws-elastic-wordpress-evolution/02_LABINSTRUCTIONS/STAGE2 - Automate the build using a Launch Template.md#stage-2a---create-the-launch-template
Change:
Under T2/T3 Unlimited
select Enable
for:
Under Credit specification
select Unlimited
Suggested change for section https://github.com/acantril/learn-cantrill-io-labs/blob/master/aws-elastic-wordpress-evolution/02_LABINSTRUCTIONS/STAGE2 - Automate the build using a Launch Template.md#stage-2b---add-userdata
#!/bin/bash
DBPassword=$(aws ssm get-parameters --region us-east-1 --names /A4L/Wordpress/DBPassword --with-decryption --query Parameters[0].Value | tr -d \")
DBRootPassword=$(aws ssm get-parameters --region us-east-1 --names /A4L/Wordpress/DBRootPassword --with-decryption --query Parameters[0].Value | tr -d \" | tr -d \")
DBUser=$(aws ssm get-parameters --region us-east-1 --names /A4L/Wordpress/DBUser --query Parameters[0].Value | tr -d \")
DBName=$(aws ssm get-parameters --region us-east-1 --names /A4L/Wordpress/DBName --query Parameters[0].Value | tr -d \")
DBEndpoint=$(aws ssm get-parameters --region us-east-1 --names /A4L/Wordpress/DBEndpoint --query Parameters[0].Value | tr -d \")
yum -y update
yum install -y mariadb-server httpd
amazon-linux-extras install -y lamp-mariadb10.2-php7.2 php7.2
amazon-linux-extras install -y epel
yum install -y stress
systemctl enable httpd
systemctl enable mariadb
systemctl start httpd
systemctl start mariadb
mysqladmin -u root password $DBRootPassword
cd /var/www/html
curl -sL http://wordpress.org/latest.tar.gz | tar -zxvf -
cp -frv wordpress/* .
rm -fr wordpress/ latest.tar.gz
cp ./wp-config-sample.php ./wp-config.php
sed -i -e "s/'database_name_here'/'$DBName'/g" -e "s/'username_here'/'$DBUser'/g" -e "s/'password_here'/'$DBPassword'/g" -e "s/'localhost'/'$DBEndpoint'/g" wp-config.php
usermod -a -G apache ec2-user
chown -R ec2-user:apache /var/www
chmod 2775 /var/www
find /var/www -type d -exec chmod 2775 {} \;
find /var/www -type f -exec chmod 0664 {} \;
cat <<EOF | mysql -u root --password=$DBRootPassword
CREATE DATABASE $DBName;
CREATE USER '$DBUser'@'localhost' IDENTIFIED BY '$DBPassword';
GRANT ALL ON $DBName.* TO '$DBUser'@'localhost';
FLUSH PRIVILEGES;
EOF
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:9 (6 by maintainers)
Top Results From Across the Web
Single Server to Elastic Web App Architecture Evolution - Reddit
I created this advanced demo stepping through evolving a Single-server WordPress implementation through to an elastic design using AWS ...
Read more >Adrian Cantrill в Twitter: „This advanced demo helps improve ...
This advanced demo helps improve AWS job interview skills. You'll learn how to evolve a real application architecture using AWS.
Read more >Quick start | APM User Guide [8.5] - Elastic
Step 1: Set up Fleetedit · In Kibana, go to Management > Fleet. · On the Agents tab, look for the Elastic Cloud...
Read more >Advanced Deployment Strategies | Developer Guide
Routes are intended for web (HTTP and HTTPS) traffic, so this technique is best suited for web applications. Create two copies of the...
Read more >Deploy Confluent Platform Demo Environment Using Script
cp-demo is a Docker environment and has all services running on one host. It is meant exclusively to easily demo Confluent Platform, but...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
if you want to see what the issue is try with my script connect to the instance then look at the cloud-init logs and see where the failure is. this will tell you what the issue is.
Failed to connect to database either means the database server is not running it isn’t installed or the password you chose isn’t the one i suggested and is causing issues.