MySQL Group Replication: Difference between revisions

From The Opensource Knowledgebase
Jump to navigation Jump to search
mNo edit summary
Line 39: Line 39:
=Introduction=
=Introduction=
This article explains how to create a MySQL8.0 HA cluster using group replication and MySQL router. It is important to note that I am using an Ubuntu 20.04 LTS server edition as the LXC host OS and have created 4 Ubuntu 20.04 containers in it and installed MySQL 8.0 from the repositories. The containers have private IPs and they are not reachable on public network. A reverse proxy is setup on the LXC host server so that application setup on the containers are accessible on port 443 or port 80. Setting up reverse proxy can be found here.
This article explains how to create a MySQL8.0 HA cluster using group replication and MySQL router. It is important to note that I am using an Ubuntu 20.04 LTS server edition as the LXC host OS and have created 4 Ubuntu 20.04 containers in it and installed MySQL 8.0 from the repositories. The containers have private IPs and they are not reachable on public network. A reverse proxy is setup on the LXC host server so that application setup on the containers are accessible on port 443 or port 80. Setting up reverse proxy can be found here.
=Basic preparation=
Container details are mentioned below. Host entries have been made into respective servers so that the servers can be reach every other server using a hostname instead of an IP.
* Container 1:


=Preparing MySQL Servers=
=Preparing MySQL Servers=

Revision as of 06:41, 9 June 2020

LXC Host Details
hostname: infrabase1
Network: 10.1.65.0/24
IP Address : 10.1.65.9
Subnet Mask: 255.255.255.0
Gateway: 10.1.65.1
DNS: 8.8.8.8
Reverse Proxy setup: Nginx


Server OS: Ubuntu 20.04
Edition: LTS, server 
sudo user: kedar

FTP Client: Filezilla
ssh client: terminal, reminna
Text editors: sublime-text

User PC Details
PC type: Desktop
OS: Ubuntu Desktop
IP Address: 10.1.65.173
sudo user:kedar 

LXC Containers
- db1 (MySQL8.0)
- db2 (MySQL8.0)
- db3 (MySQL8.0)
- db4 (MySQL8.0)
- web1 (MySQL Router+Apache)

Introduction

This article explains how to create a MySQL8.0 HA cluster using group replication and MySQL router. It is important to note that I am using an Ubuntu 20.04 LTS server edition as the LXC host OS and have created 4 Ubuntu 20.04 containers in it and installed MySQL 8.0 from the repositories. The containers have private IPs and they are not reachable on public network. A reverse proxy is setup on the LXC host server so that application setup on the containers are accessible on port 443 or port 80. Setting up reverse proxy can be found here.

Basic preparation

Container details are mentioned below. Host entries have been made into respective servers so that the servers can be reach every other server using a hostname instead of an IP.

  • Container 1:



Preparing MySQL Servers

Setting up MySQL Shell

Preparing App Server

Important Commands

Closing