question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Update for Advanced Demo - Web App - Single Server to Elastic Evolution - STAGE 2

See original GitHub issue

In 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

image

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:open
  • Created 3 years ago
  • Reactions:1
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
acantrilcommented, Nov 1, 2022

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.

0reactions
acantrilcommented, Nov 1, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found