How to create a 2-tier architecture with DNS balancer
Multi-Cloud Orchestrator allows users to create multi-tier infrastructures on the Cloud. Specifically, 2-tier architecture is a client–server architecture in which presentation is physically separated from application processing and data management. It provides a more robust, more secure solution than a monolithic infrastructure, without increasing operative costs in a high percentage respecting other multi-tier architectures. DNS-balance enables a multi-tier architecture to have more than one of each tier replicated ensuring high availability, high reliability and increased disponibility capabilities from the operative point of view.
Leveraging Chef cookbooks, we can create a DNS-balanced 2-tier architecture using Multi-Cloud Orchestrator and a cookbook.
- Upload your service cookbook
- Configure templates for your architecture
- Create servers for your architecture
- Configure DNS load balancer for front-end
- Configure DNS for back-end
- Additional resources
- Have a cookbook with recipes for both front-end and back-end parts of your architecture, or two cookbooks, each one with one of the sides of your infrastructure.
- Have a DNS domain created.
- Front-end servers need to be neither in the same region nor in the same cloud provider, so you can have the same front-end service running on different regions and cloud providers to ensure high availability.
- Back-end server can be on a different region and cloud provider than the front-end servers.
- You can create a server array for the front-end part of your 2-tier architecture instead of having to create multiple servers one by one. The steps to create a server array are explained in How to create a server array
- On this example we will use a cookbook with recipes for both front-end and back-end sides.
Upload your service cookbook
- Go to Blueprint -> Cookbooks.
- Press the "Add cookbook" button.
- Press the "Upload cookbook" button. A modal window will appear to select the cookbook file you want to upload. After you press on "Accept" button, the cookbook will appear in the cookbook list.
Configure templates for your architecture
- Go to Blueprint -> Templates.
- Press the "Add template" button.
- Provide all mandatory fields, select Generic Image * as Ubuntu 20.04 Focal Fossa x86_64. Then press the "Add template" button.
- Wait until the template is in "Ready" state.
- Click on your template name and go to the "Cookbooks" tab.
- On Cookbook list, press the "Edit" button.
- On Cookbook list, press the "Add cookbook" button and select the cookbook you uploaded. On Run list, press the "Add recipe" and select the recipe for the front-end part of the infrastructure.
- Press the "Update template" button, and wait for the template to be on "Ready" state.
- For the back-end template, follow these steps to create a template, but on Run List, select the recipe for the back-end part of your infrastructure.
Create servers for your architecture
- Go to Compute -> Servers.
- Press the "Add server" button and press "Add server"
- Provide all mandatory fields, select Template * as the template for the front-end side of your infrastructure, and press the "Add server" button.
- Press the action menu and select Boot
- Wait until record is in "Operational" state.
- Repeat these steps to create more servers for your front-end part of the infrastructure, changing the names of the servers.
- Repeat these steps to create a back-end server for your infrastructure, selecting the template for the back-end side on the Add Server popup.
Configure DNS load balancer for front-end
- Go to Network -> DNS.
- Click on your DNS domain.
- Go to the "Records" tab.
- Press the "Add domain record" button and press "A".
- Provide all mandatory fields, select Content Type * as Server, and then select a front-end server you want to include in your DNS load balancer on Server * field. Then press the "Add record" button.
- Wait until record is in "Applied" state.
- Repeat these steps for all the servers you want to include on your DNS load balancer, assigning the same name to all records and selecting a different server from your pool of front-end servers each time.
Configure DNS for back-end
- Press "Add domain record" button and press "A".
- Enter a name, one different to the name assigned to your front-end servers, in the Name * field, select Content Type * as Server, and then select the back-end server on Server * field. Then press the "Add record" button.
- Wait until record is in "Applied" state.
- Configure your front-end servers to communicate with your back-end server using the record name and domain name you created; typically, by adapting a cookbook attribute. The steps to adapt a cookbook attribute are explained in How to configure a cookbook