Build a Load Balanced WordPress Environment
Goal: Build a WordPress environment with separate DB instance and multiple WordPress instances fronted by a load balancer.
Video: Check out the Webinar where we walk through this process https://youtu.be/3OPAoFGgYo8
This how-to is going to go through the following
- Building a NAT Gateway and Internal Network
- Build DB server
- Build Load Balancer and Front end Web Server
Building a NAT Gateway and Internal Network
- Login to the IONOS DCD at https://dcd.ionos.com
- Create your Virtual Data Center
- Reserve static IP address from the “Ip Manager” under the “Manager resources” menu
- Create your NAT Gateway by dragging the NAT gateway ICON to the grid.
- Assign the reserved IP address by selecting it from the “Public IP’s” dropdown and select the previously reserved IP address
- Drag a server instance to the dcd grid (this will only be used temporarily) and click and drag the plus sign from the server icon to the NAT Gateway in order to create the private network
- Assign an internal IP address to the NAT gateway by selecting the NAT Gateway” in the grid and then the “Gateway IPs” tab to the right, click “Add IP” and enter 192.168.10.1/24 and then “add ip”
- Click on “Provision Changes”
Create a DB server
- Drag and drop another server to the DCD grid
- Connect the server to the previously created internal network by clicking the plus sign and dragging to the NAT gateway, the new server should join the same network as the previously created temp server.
- Add HDD storage to instance and select most recent version of ubuntu as the image (from IONOS provided images)
- Copy the DB deploy cloud-init content from the Database Deploy section to the right and paste into the cloud-init user data section of the storage/image section.
- Provision changes
Create the Load Balancer and first front end WordPress server.
- Drag the server icon to DCD grid and connect to internal network by clicking the plus sign and dragging to NAT Gateway.
- Add storage to server and select IONOS images and most recent Ubuntu version
- Copy the WordPress deploy cloud-init content from the right under WordPress Deploy and paste into cloud-init user data in DCD
- Drag Load Balancer icon to DCD grid and connect one side to internal network by dragging bottom dot on icon to NAT Gateway
- Connect the external side of the Load Ba;ancer to the internet by dragging the top dot on the load balancer to the internet icon
- On the right Click the drop down on “Primary Ipv4” and select previously reserved static IP address.
- Click on “Private IP” section and click “Add IP” assign internal ip address like 192.168.10.250/24
- Click Provision
Finish Setup
- Once provisioning has completed, select the Load Balancer from the DCD grid and select “Forwarding Rules”
- Click on “Add Forwarding Rule” and enter the rule for the traffic you would like to forward. More information here https://docs.ionos.com/cloud/early-access/network-load-balancer/configure-nlb
Happy building!
Video
Copy to Clipboard
Github Repo
Copy to Clipboard
Database Deploy
Copy to Clipboard
WordPress Deploy
Copy to Clipboard