01 – 为SQL Server高可用集群配置域控制器「建议收藏」

01 – 为SQL Server高可用集群配置域控制器「建议收藏」
In this series for SQL Server Always On Availability Groups, we are covering e…

	01 - 为SQL Server高可用集群配置域控制器[数据库教程]

In this series for SQL Server Always On Availability Groups, we are covering end to end configurations for SQL Server 2019 on Windows Server 2016. In the article, A comprehensive guide to SQL Server Always On Availability Groups on Windows Server 2016, we configured three virtual machines with their networking configurations.

In this article, we will explore the following topics.

  • Domain controller, active directory and join servers in the configured domain
  • Assign static IP’s for all virtual machines
  • Disable firewall settings
  • Validate and create a cluster

Prerequisites

  • You should follow the article, A comprehensive guide to SQL Server Always On Availability Groups on Windows Server 2016, and be ready with the Powered on virtual machines.
  • You should get a basic knowledge of domain controller, active directory, IP configurations

Enable Domain Controller and Active Directory in a virtual machine for SQL Server Always On Availability Groups

Before we enable these features and roles, let’s go over their brief description:

  • Domain Controller: A domain controller servers all security authentications requests for a Windows Server domain. In an organization, each server is a member of the domain controller. We use an FQDN [ServerName].[Domain] to connect with the server
  • DNS: You cannot remember the IP addresses of all servers. For example, we can easily connect to SQLShack.com, but if you have its IP address, it is difficult to remember all URL’s IP address. It is a standard method to associate names instead of the IP address
  • Active Directory: It is a container that consists of organization units for all users, their credentials, groups. All users must authenticate themselves to use an organization resource

We will use the VM named VDITest3 for the configuration of active directory (AD) and domain. Usually, in an organization, you maintain different servers for both AD and domain.

Connect to the Virtual machine for the domain controller and Active Directory configuration. Launch the server manager -> dashboard.

Server Manager configuration for SQL Server Always-On Availability Groups

Click on the Add Roles and Features. It opens the wizard with brief information. We can skip this step.

Add roles and features

In the next step, Select option Role-based or feature-based installation and click Next.

Role-based or feature-based installation

It shows the VM name, IP address and operating system in the destination server. You can verify the server name before continuing with the installation.

Select destination server

In the server roles, enable the Active Directory Domain Services. It opens a pop-up window with its dependency features or services. Click on Add features to install all dependencies.

Active Directory domain services

Similarly, enable the DNS server as well.

Enable the DNS server

Click Next, and you get an introduction page for the active directory. You can go through the information provided to gain a basic understanding.

Active directory domain service

Similarly, you get an introduction to the DNS services as well.

DNS Server introduction

In the next step, review all features and roles installations. You should not install unnecessary services, features, roles on a server as a best practice.

Some roles and features require a reboot of the server. Therefore I put a check on the Restart the destination server automatically if required.

In case, you add a role or feature to an existing server, and I would recommend you reboot manually.

Restart the destination server automatically

It starts the installation of the specified roles and features.

Installation progress

We can see features installation is completed.

Features installation progress

In the server roles, we get a warning message, and it asks us to promote the server as a domain controller because we installed a Domain controller feature on this server. Click on the message- Promote this server as a domain controller.

It opens an active directory services configuration wizard, as shown below. In this deployment configuration, select Add a new forest and specify the root domain name. I specify the root domain as MyDemoSQL.com

Promote this server as a domain controller

Click Next. We can go with the default options for the forest functional level and functional domain level. Specify the domain admin password. You should store this password in a safe and secure place.

Domain Controller options

In the DNS option, skip the configuration and move towards the next page.

DNS options

It shows the NetBIOS domain name. It is the domain name without .com suffix.

NetBIOS domain name

By default, it installs the AD database, log file in the Windows directory of the root drive. We can go-ahead for the C drive for the demo purpose.

AD database

Review your configurations and Click Next to begin active directory configuration.

Review options

First, it does the prerequisite check. We can ignore the warning messages here.

Warnings and status

It performs the reboot of the VM.

Reboot

After reboot, you can verify that the computer is part of the MyDemoSQL.com domain. At this point, we have only one VM configured with the domain.

Verify Domain

Network configuration for the Static IP and DNS Server

We require a static IP for the domain controller VM along with the SQL Server Always On Availability Groups. Type ipconfig and it returns the following output.

In the output, we can note the IPv4 address, subnet mask and default gateway.

Static IP and DNS Server

To set a static IP address, navigate to the Control Panel->Network and Internet->Network Connections. Click on the Change adapter settings.

Change adapter settings

It opens networking options. Here, click on the Internet Protocol Version 4(TCP/IPv4) and Properties.

networking options

By default, it is configured to obtain the IP address automatically. In this case, if you reboot the server, it might get a new IP address.

Click on the Use the following IP addresses and specify the IP address as follows.

  • IP address: 10.0.2.15
  • Subnet mask: 255.255.255.0
  • Preferred gateway – blank
  • Preferred DNS server: 127.0.0.1 ( because this server itself is a DNS server)

Assign Static IP

Click OK to save the changes. You can again type ipconfig in the command prompt to validate these settings.

Verify changes

Configure Reverse lookup zones in DNS for SQL Server Always On Availability Groups

We need to configure a reverse lookup zone in the DNS. It resolves the IP address to the server name. In the server manager dashboard, navigate to tools -> DNS.

Reverse lookup zones in DNS

It opens the following DNS manager with different folders.

DNS manager

Open the Reverse Lookup Zones folder and right-click on it to launch a new zone wizard.

new zone wizard

In the next zone wizard, go with the default option – Primary zone.

Zone type for SQL Server Always-On Availability Groups

In the next step, select the zone replication scope- To all DNS servers running on domain controllers in the domain: MyDemoSQL.com

To all DNS servers running on domain controllers

Select the type of lookup zone as a Reverse lookup zone.

reverse lookup zone

We are using an IPv4 address range, so select the IPv4 reverse lookup zone. In case you use an IPv6 IP range, select the other option.

IPv address range

In the reverse lookup zone name, we need to enter the network ID portion of the IP address. It is the digits before the last dot. In my case, I have an IP address in the range 10.0.2.15. Therefore, the network SID is 10.0.2

New Zone wizard

Accept the recommended method of the dynamic update as Allow only secure dynamic updates and click Next.

Dynamic update

Review the configuration and click Finish to create a reverse lookup zone.

create a reverse lookup zone

It shows the following reverse lookup zone as per our configurations.

Verify zone

Create an active directory user and assign domain admin permissions for SQL Server Always On availability groups

Type DSA.msc in the run, and it launches the AD containers with all users, computer service accounts.

Create an active directory user for SQL Server always on availability groups

To create a new AD user, right-click on the container (in this case, Users) and create a new user.

Specify the first name, last name, user login name. It should be a unique login name in an OU.

New object

On the next page, specify the password of this AD user along with configuration options. You can specify options such as :

  • User must change password at next logon
  • User cannot change password
  • Password never expires
  • An account is disabled

For my demo purpose, I have unchecked all user password configuration.

User password and configuration

Review and confirm the user details to create in the Users group.

Verify user details

In the active directory users, double click on the Domain Admins.

Domain Admins

It opens the domain admins properties. Click on Add, search for the AD user we created and add it here.

Edit Domain Admins properties

Add this user as an administrator in all three VM’s as well. Add this user to the local administrator of all three VM’s. Open the computer management from the server manager -> Tools-> Computer management.

Add user in the administrator group

Add SQLNode1 and SQLNode2 in the domain for SQL Server Always On availability groups

In the next step, open the network properties of the SQLNode1 and SQLNode2. Enter the following values for the IP address.

SQLNode1 network configuration

  • IP address: 10.0.2.21
  • Subnet mask: 255.255.255.0
  • Preferred gateway – blank
  • Preferred DNS server: 10.0.2.15 ( it is the IP address of our DNS server)

SQLNode1 network configuration for SQL Server Always-On Availability Groups

Validate IP configurations

Validate IP configurations

SQLNode2 network configuration

  • IP address: 10.0.2.22
  • Subnet mask: 255.255.255.0
  • Preferred gateway – blank
  • Preferred DNS server: 10.0.2.15 ( it is the IP address of our DNS server)

SQLNode2 network configuration

Validate IP configurations

Validate IP configurations

Add SQLNode1 in the MyDemoSQL.com domain for SQL Server Always On availability groups

In this step, we need to join the VM to the existing domain MyDemoSQL.com. To add a server into the domain, click on the server name in the server dashboard.

Add SQLNode1 in the MyDemoSQL.com domain

It opens the system properties. Click on the change, and you can specify the computer name and its domain.

Join nodes in the domain for SQL Server Always-On Availability Groups

Click on OK, and it joins the VM into the specified domain. You need to specify the domain admin user name and password to allow it as a member in the MyDemoSQL.com domain.

AD authentication

You get a welcome message, as shown below, once it adds the server successfully.

Welcome to domain

It reboots the VM. You should

Verify domain

Add SQLNode2 in the MyDemoSQL.com domain

Similarly, add the SQLNode2 VM as well in the MyDemoSQL.com domain and validate it.

Add SQLNode2 in the MyDemoSQL.com domain

Conclusion

In this article, we configured Domain Controller, Active Directory and DNS in a virtual machine. Later, we configured Reverse lookup zones, domain admin account, local admin account and added the servers in the domain for SQL Server Always On availability group.

In my next article, I will walk you through the configuration of failover clusters, quorum configuration and storage drives allocation for the SQL nodes.

01 – 为SQL Server高可用集群配置域控制器

原文地址:https://www.cnblogs.com/zhouwy/p/14454917.html

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
转载请注明出处: https://daima100.com/6511.html

(0)
上一篇 2023-04-08
下一篇 2023-04-08

相关推荐

  • SQL Pretty Printer 一款值得你拥有的MSSQL格式化插件

    SQL Pretty Printer 一款值得你拥有的MSSQL格式化插件各位码农小伙伴们,在使用MSSQL编辑器时候是否觉得没有一款格式化工具,写出来的代码很不美观,在团队中,做code review时候,每个人风格不一,对比不够直接呢? 我给大家推荐一款SQL Pret

    2023-02-22
    138
  • [Elasticsearch] ES更新问题踩坑记录「终于解决」

    [Elasticsearch] ES更新问题踩坑记录「终于解决」问题描述 我们有个系统设计的时候针对Hive创建表、删除表, 需要更新ES中的一个状态,标记是否删除,在几乎同时执行两条下面的语句的时候,发现在ES 中出现表即使被创建了还是无法被查询到的情况,针对该

    2023-04-22
    151
  • Python爬虫介绍

    Python爬虫介绍随着互联网的飞速发展,越来越多的数据被存储在各种网站上,但是这些数据通常分散在不同的网站,没有办法方便地访问和利用。而爬虫技术则是一种有效的解决办法,可以自动化地从网站上获取有用的数据,提高数据采集和分析的效率。

    2024-06-30
    49
  • MySQL中的数据类型和schema优化「建议收藏」

    MySQL中的数据类型和schema优化「建议收藏」最近在学习MySQL优化方面的知识。本文就数据类型和schema方面的优化进行介绍。1.选择优化的数据类型MySQL支持的数据类型有很多,而如何选择出正确的数据类型,对于性能是至关重要的。以下几个原…

    2023-04-05
    164
  • 迭代的重要性

    迭代的重要性迭代是指在软件开发中,重复执行一些操作来逐步逼近期望的结果的过程。它是一种递归的方法,可以帮助开发者快速验证他们的想法。

    2024-08-25
    26
  • mysql 全局读锁_数据库行锁和表锁

    mysql 全局读锁_数据库行锁和表锁

    2023-04-22
    157
  • Python Web开发测试题在线挑战

    Python Web开发测试题在线挑战在进行Python Web开发时,开发人员需要对自己的开发技能进行评估。而要进行评估,则需要使用测试工具来进行测试。测试可以验证代码是否可以正常运行,是否存在错误和异常情况,并且可以测试代码的性能,从而使得代码更加稳定和高效。因此,进行Python Web开发测试非常重要。

    2023-12-21
    111
  • 分页查询总结「建议收藏」

    分页查询总结「建议收藏」分页查询关键点小结

    2023-06-16
    157

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注