Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

SQL Server Alwayson build five: Alwayson configuration

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Enable Alwayson

Right-click in Sql Server Configuration Manager on SQL01 and SQL02 servers and select Properties for SQL Server service

In the AlwaysOn High Availability tab, you can see that Windows failover cluster name is the previously created sqlalwayson cluster. Check Enable AlwaysOn Availability Groups.

Restart the sqlserver service

two。 Create a test database

CREATE DATABASE [Always_test_1]

CONTAINMENT = NONE

ON PRIMARY

(NAME = UNLIMITED, FILENAME = NumbC:\ sql01\ Always_test_1.mdf', SIZE = 3072KB, MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB)

LOG ON

(NAME = NumberAlwaystesting 1 percent logarithmic, FILENAME = NationC:\ sql01\ Always_test_1_log.ldf', SIZE = 1024KB, MAXSIZE = 2048GB, FILEGROWTH = 10%)

GO configuration AlwaysOn High Availability

Click New Availability Group Wizard...

Availability group name:SQL_AG

Check whether the database meets the conditions for configuring AG here

BACKUP DATABASE Always_test_1 to disk='c:\ sql01\ Always_test_1_full.bak'

When you are done, click Refresh

Check the box and click Next

Click Add Replica... The connection sql02,sql01/sql02 check option and configuration are as above, and Endpoints defaults (if it is multiple network cards, it needs to be configured as a specific IP)

Select Full to automatically synchronize data (to select Join only, you need to restore sql01's Always_test_1 full and log backup in sql02, and the restore option is norecovery), and configure the arbitration folder as the transfer path.

Verification failed. You need to create a directory on sql02 where C:\ sql01 recovers data. Click Re-run Validation after creation.

After the connection sql01,sql02,Alwayson is configured successfully, it is as follows

Create Availability Group Listener

Listener DNS Name:sqllistener

Port:1433

Network Mode:Static IP

IP Address:192.168.0.111

Use sqllistener to connect as follows

Verify configuration

After the configuration is completed, the AD Computers of DC is as follows

DNS is as follows

Failover Cluster Manager is as follows

Failover test

Simulated downtime. After sql01 shuts down, SQL01 displays down status (with a down arrow), and Primary automatically transfers to sql02, as shown below.

After sql01 is rebooted, Secondary is restored, as follows

After sql02 shuts down, Primary is automatically transferred to sql01, as follows

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report