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

How to install an always on cluster

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

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces "how to install always on cluster". In daily operation, I believe many people have doubts about how to install always on cluster. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "how to install always on cluster". Next, please follow the editor to study!

Preparatory work

1. Four virtual machines with windows server 2008 R2 system installed, configured as follows:

CPU: 1 core

MEMORY: 2GB

DISK: 40GB (not partitioned)

NetAdapter: 2 yuan

2. Network card settings:

Local connection: public network IP (since the virtual machine itself is in the private network segment, 192.168.1.2-192.168.1.255, we regard the current private network as the public IP of the public network).

PC01:192.168.1.241 (domain host)

PC02:192.168.1.242 (Cluster Master Node)

PC03:192.168.1.243 (Cluster Secondary Node)

PC04:192.168.1.244 (Cluster Secondary Node)

Local connection 2: IP in the domain. Here it is set to 192.168.10.1

PC01:192.168.10.1 (domain host)

PC02:192.168.10.2 (Cluster Master Node)

PC03:192.168.10.3 (Cluster Secondary Node)

PC04:192.168.10.4 (Cluster Secondary Node)

3. Only one network card is installed in the virtual machine by default. Add the network card in the following demonstration:

Note: at this time, both network cards are in NAT mode. Here I change the network connection mode of the first network adapter to bridge connection, in order to interact with the intranet computer where my physical machine is located.

Install domain controller and configure domain install domain controller

Set up a domain controller on the virtual machine IP:192.168.1.241

Note: a valid domain controller cannot be installed when a fixed IP is not configured

At this point, we set the fixed public network IP of the virtual machine (Note: the DNS server address is not configured here, so you cannot connect to the real public network on the virtual machine. In the formal environment, you need to configure the DNS server address):

Private network IP:

Install the domain controller again:

Domain controller installation completed

Install domain services and configure domain

After the domain configuration is complete, you will be prompted to restart the virtual machine. Please restart immediately!

Join several other virtual machines to the domain

First change the second network card of several other virtual machines, that is, the IP address of local connection 2, to the IP address in preparation.

At the same time, the DNS server points to the virtual machine with the intranet IP of 192.168.10.1, which is required, otherwise you cannot join the new domain.

Successfully joined the domain, restart the virtual machine immediately!

Install and configure windows server failover cluster install .net framework 3.5 first

Installation complete!

Install the failover featur

Configure a failover cluster

Log in to all virtual machines except the domain host using the NewCluster\ administrator account

Note: only the domain administrator account can configure the failover cluster

Create a failover cluster

Check the firewall and turn off the domain firewall

But there is still a problem. At this time, I found that the public network IP of the two virtual machines, PC03 and PC04, were acquired automatically, so I modified them separately:

Then add the node:

The cluster configuration is complete.

Install and configure sqlserver 2012 always on cluster installation sqlserver 2012

Install sqlserver2012 on each virtual machine in the cluster

Select the installation account, which is the domain administrator account

Restart the computer and complete the installation of sqlserver2012!

Configure sqlserver 2012 to enable the alwayson function for the sqlserver service of the virtual machine of each node

Configure alias IP:192.168.10.2

The same alias is also added to 32-bit clients.

Open naming protocols in 32-bit and 64-bit client protocols

IP:192.168.10.3 (the procedure is the same as above)

IP:192.168.10.4

Test login using alias

Note: if the domain administrator account is not used during installation and the same administrator account is not added to the sqlserver administrator account group, you will not be able to use windows authentication mode to log in to sqlserver without a password using the domain administrator account

Configure always on preparation

1. Create a folder to store database backups.

2. Create a test database and back up the database. If you already have a database, just back up the database.

3. Share the backup path

Create an alwayson high availability group

You just need to create it on IP:192.168.10.2.

Note: be sure to change the database recovery model to the full recovery model and back up the database completely. Otherwise, the status here will show that the prerequisites are not met.

Add a listener

At this point, the alwayson cluster completes:

Test cluster:

Create a table on the primary node IP:192.168.10.2 and insert a piece of data

View tables and data on the secondary node IP:192.168.10.3

View tables and data on the secondary node IP:192.168.10.4

The test was successful!

With regard to the problem of the application connecting to the cluster, it should be the virtual IP that connects to the cluster, or you can connect to the virtual IP directly with SSMS. In this case, the password of the sa account must be configured the same on all nodes in the cluster. Otherwise, the password error will occur in the connection of the account using sa after the cluster switch.

At this point, the study on "how to install always on clusters" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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