SQL Server2019 configuration always on high availability graphic steps

Preparation

First, you need to prepare the failover cluster on Windows Server. For the steps, please refer to the previous article.

https://blog.csdn.net/u012869793/article/details/127560270?spm=1001.2014.3001.5501

Then install SqlServer on the server, and I installed 2019 here.

text

Check Enable Always ON Availability Group and restart the service.
insert image description here
Then add a database to the database on the master server and prepare a little test data.
insert image description here
In Always On High Availability, right-click, select New Availability Group, and enter a name SQLAG. Then click Next.

insert image description here
A full backup is required here.
insert image description here
Then let's back up the database first, and cancel the window for creating a new availability group. Then right click on the database, select Tasks, Backup. Take a full backup of the database.

insert image description here
After the backup is complete, copy the backup file to the slave server, and open SQL Server to restore the database.
insert image description here
There is one thing to note here, select the option , remember to select the recovery state
RESTORE WITH NORECOVERY, and then restore the database.
insert image description here
After restoring the database, the database should remain in the restoring state.
insert image description here
Then we proceed to create a new availability group. The prerequisites are met here, check the database that needs to be synchronized. Then click Next.
insert image description here
Here you need to connect to the database on another server to join the copy, choose to add a copy.
insert image description here
Enter the host name or IP address, user name, and password of another server to connect. Note that the TCP and IP of the corresponding server and the proxy service need to be enabled.
insert image description here
After configuration, the copy page is set as shown in the figure below, and
insert image description here
the endpoint page is set as shown in the figure below, and the domain name can be changed to IP. Then click Next and
insert image description here
this prompt may pop up.
insert image description here
This is because the SQL Server service was changed by me to the administrator account for logging in to Windows Server. Click Yes.
insert image description here

Here we choose to connect only, and then click Next.

Because there is already a database being restored on the replica server, there is no need to select a complete database and log backup. If there is no database on the replica server, you can select this option and enter a shared file address to restore the database.
insert image description here
Then go directly to the next step, next step, and then click Finish.
insert image description here
Wait for the configuration to complete.
insert image description here

Normally, it should be completed in the end, as shown in the figure below.
insert image description here
But if it fails in the end, click on the error and find the following error. It may be a problem with the login account of the SqlServer service or a problem with the firewall.
insert image description here
The firewall settings are as follows. In the inbound rules, add ports 1433 and 5022 to the newly created rules.
insert image description here
insert image description here
For the login problem of the SQL Server service, first enter the database software to open it, find the administrator account, and check all the permissions.
insert image description here

Then change the account of the SqlServer service to the administrator account and password of the current computer, save and restart the service.
insert image description here
After the above configuration is complete, follow the steps below to add a listener.
insert image description here

insert image description here

testing phase

In the main library, create a new table, add test data, go back to the slave library, query, and find that the data has been synchronized.
insert image description here

Guess you like

Origin blog.csdn.net/u012869793/article/details/127578293