Task 05. Split Wordpress components into different servers.
Some time have passed and online magazine having his readers and fans. People like to read and comment articles, everything is good. One day you realised that database eats more and more resources while application remain with same loading. Paul suggested you to split database and wordpress itself into different servers, so that components don’t consume each others resources.
Task
- Repository: Fork repository for task05 and clone forked repo.
- Provision Wordpress : Setup Wordpress using Ansible and Vagrant, but this time there would be two VMs:
database
, where MySQL is runningwordpress
, where nginx and php is running, it should point in configuration indatabase
VM.
- Open ports: Make sure that port 3306 on
database
is open for application inwordpress
vm. - Source code: Create pull request to repository that you forked, so that you can get comments on your code.
- Think yourself: While it’s easy to copy something from the internet, I would recommend writing roles and tasks writing from scratch, or reuse from previous task. In that case you would learn more.
Additional tasks if you feel that it was too easy.
- Check out Wordpress files structure. Where does it store plugins, themes, uploaded pictures. You will need this in future tasks.
Tips:
- Vagrant allows you manipulating Virtual Machines. Check out Useful links for more info. Feel free to google.
- You don’t need to modify
Vagrantfile
to make it work properly. But you can experiment and change any settings that you want. - Changing WordPress settings much easier using
wp-cli
tool. - Ansible allows to group tasks in to the roles.
Recommended soft:
Useful links:
FAQ
- N/A