Configure SQL Server Always On Availability Group on Windows and Linux (Cross Platform) - Part 1

Install and configure SQL Server 2019 on both the nodes


Step #1: Install SQL Server

Install SQL Server on Windows Server
Install SQL Server 2019 on Windows Server 2016 and set mixed mode authentication.

Install SQL Server on Linux
Install SQL Server 2019 on Linux. For instructions, see Install SQL Server on Linux.


Step #2: Enable HADR and restart SQL Server

Enable HADR on Windows


Enable HADR on Linux
To enable hadr via mssql-conf from a shell prompt, issue the following command

sudo /opt/mssql/bin/mssql-conf set hadr.hadrenabled 1



Step #3: Configure hosts file on both servers

In this demo, systems are not resolve via domain so adding static entry to the host file to resolve IP address and hostname as shown below

Windows
      - Press the Windows key (previously Start menu).
      - Use the Search option and search for Notepad.
      - Right-click Notepad and select Run as administrator.
      - From Notepad, open the hosts file at: C:\Windows\System32\Drivers\etc\hosts
      - Add the line and save your changes.


Linux
      - Open up the Terminal.
      - Login with root account
      - Type vi /etc/hosts
      - Add the entries in the host file as shown below.



Step #4: Allow ports on the firewall on both the host


Open up firewall ports for TCP 1433 and 5022 on both Windows and Linux.

Linux

sudo  firewall-cmd --add-port=1433/tcp –permanent
sudo  firewall-cmd --add-port=5022/tcp –permanent
sudo firewall-cmd –reload


Windows






Refer the link below to configure SQL Server Always On Availability Group on Windows and Linux (Cross Platform)

Note: Perform these steps in order.


No comments:

Post a Comment