为SQL Server Always On可用性组配置域控制器和Active Directory

2023-11-16

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.

在本系列SQL Server Always On可用性组系列中,我们将介绍Windows Server 2016上SQL Server 2019的端到端配置。在本文“ Windows Server 2016的SQL Server Always On可用性组综合指南”中 ,我们配置了三个虚拟机器及其网络配置。

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

    为所有虚拟机分配静态IP
  • Disable firewall settings

    禁用防火墙设置
  • Validate and create a cluster

    验证并创建集群

先决条件 (Prerequisites)

在虚拟机中为SQL Server Always On可用性组启用域控制器和Active Directory (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 域控制器 :域控制器为Windows Server域服务于所有安全身份验证请求。 在组织中,每个服务器都是域控制器的成员。 我们使用FQDN [ServerName]。[Domain]与服务器连接
  • 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 DNS :您不能记住所有服务器的IP地址。 例如,我们可以轻松连接到SQLShack.com,但是如果您拥有其IP地址,则很难记住所有URL的IP地址。 这是一种关联名称而不是IP地址的标准方法
  • 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 Active Directory:这是一个容器,由所有用户的单位部门,其凭据,组组成。 所有用户都必须对其进行身份验证才能使用组织资源

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.

我们将使用名为VDITest3的VM来配置活动目录(AD)和域。 通常,在组织中,您为AD和域维护不同的服务器。

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

连接到用于域控制器和Active Directory配置的虚拟机。 启动服务器管理器->仪表板。

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

单击添加角色和功能。 它会打开向导并提供简要信息。 我们可以跳过此步骤。

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

在下一步中,选择选项基于角色或基于功能的安装,然后单击下一步

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.

它显示目标服务器中的VM名称,IP地址和操作系统。 您可以在继续安装之前验证服务器名称。

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域服务 。 它会打开一个弹出窗口,其中包含相关功能或服务。 单击添加功能以安装所有依赖项。

Similarly, enable the DNS server as well.

同样,也启用DNS服务器。

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

单击“下一步”,您将获得活动目录的简介页。 您可以阅读所提供的信息以获得基本了解。

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

同样,您也可以了解DNS服务。

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.

万一您将角色或功能添加到现有服务器中,建议您手动重新启动。

It starts the installation of the specified roles and features.

它开始安装指定的角色和功能。

We can see features installation is completed.

我们可以看到功能安装完成。

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

它将打开一个活动目录服务配置向导,如下所示。 在此部署配置中,选择“ 添加新林”并指定根域名。 我将根域指定为MyDemoSQL.com

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.

点击下一步。 我们可以使用林功能级别和功能域级别的默认选项。 指定域管理员密码。 您应该将此密码存储在安全的地方。

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

在DNS选项中,跳过配置并转到下一页。

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

它显示了NetBIOS域名。 它是没有.com后缀的域名。

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数据库日志文件安装在根驱动器的Windows目录中。 为了演示的目的,我们可以继续使用C盘。

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

查看您的配置,然后单击“下一步”开始活动目录配置。

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

首先,它执行先决条件检查。 我们可以在这里忽略警告消息。

It performs the reboot of the VM.

它执行VM的重新引导。

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.

重新启动后,您可以验证计算机是否属于MyDemoSQL.com域。 此时,我们只有一个配置了域的VM。

静态IP和DNS服务器的网络配置 (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.

我们为域控制器VM以及SQL Server Always On可用性组需要一个静态IP。 键入ipconfig ,它将返回以下输出。

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

在输出中,我们可以记下IPv4地址,子网掩码和默认网关。

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

要设置静态IP地址,请导航至控制面板->网络和Internet->网络连接。 单击更改适配器设置。

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

它打开网络选项。 在这里,单击“ Internet协议版本4(TCP / IPv4)”和“属性”。

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.

默认情况下,将其配置为自动获取IP地址。 在这种情况下,如果重新启动服务器,则它可能会获得一个新的IP地址。

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

单击“ 使用以下IP地址”,然后指定IP地址,如下所示。

  • IP address: 10.0.2.15

    IP地址:10.0.2.15
  • Subnet mask: 255.255.255.0

    子网掩码:255.255.255.0
  • Preferred gateway – blank

    首选网关–空白
  • Preferred DNS server: 127.0.0.1 ( because this server itself is a DNS server)

    首选DNS服务器:127.0.0.1(因为此服务器本身是DNS服务器)

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

单击确定以保存更改。 您可以再次在命令提示符下键入ipconfig来验证这些设置。

在DNS中为SQL Server Always On可用性组配置反向查找区域 (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.

我们需要在DNS中配置反向查找区域。 它将IP地址解析为服务器名称。 在服务器管理器仪表板中,导航到工具-> DNS。

It opens the following DNS manager with different folders.

它将打开以下具有不同文件夹的DNS管理器。

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

打开“反向查找区域”文件夹,然后右键单击它以启动新的区域向导

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

在下一个区域向导中,使用默认选项– 主区域。

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

在下一步中,选择区域复制范围- 到域中域控制器上运行的所有DNS服务器:MyDemoSQL.com

Select the type of lookup zone as a 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.

我们正在使用IPv4地址范围,因此请选择IPv4反向查找区域。 如果您使用IPv6 IP范围,请选择其他选项。

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

在反向查找区域名称中,我们需要输入IP地址的网络ID部分。 它是最后一个点之前的数字。 就我而言,我的IP地址范围为10.0.2.15。 因此,网络SID为10.0.2

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

接受建议的动态更新方法为“ 仅允许安全动态更新” ,然后单击“下一步”。

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

查看配置,然后单击完成以创建反向查找区域。

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

它根据我们的配置显示以下反向查找区域。

创建一个活动目录用户并为SQL Server Always On可用性组分配域管理员权限 (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.

在运行中键入DSA.msc ,它将使用所有用户和计算机服务帐户启动AD容器。

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

要创建新的AD用户,请右键单击容器(在本例中为Users),然后创建一个新用户。

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

指定名字,姓氏,用户登录名。 它应该是OU中的唯一登录名。

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

在下一页上,指定此AD用户的密码以及配置选项。 您可以指定以下选项:

  • 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.

出于演示目的,我未选中所有用户密码配置。

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

查看并确认要在“用户”组中创建的用户详细信息。

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

在活动目录用户中,双击“ 域管理员”

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

它将打开域管理员属性。 单击添加,搜索我们创建的AD用户并将其添加到此处。

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.

还要将该用户添加为所有三个VM的管理员。 将此用户添加到所有三个VM的本地管理员中。 从服务器管理器->工具->计算机管理中打开计算机管理。

在域中为SQL Server Always On可用性组添加SQLNode1和SQLNode2 (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和SQLNode2的网络属性。 输入以下IP地址值。

SQLNode1网络配置 (SQLNode1 network configuration)
  • IP address: 10.0.2.21

    IP地址:10.0.2.21
  • Subnet mask: 255.255.255.0

    子网掩码:255.255.255.0
  • Preferred gateway – blank

    首选网关–空白
  • Preferred DNS server: 10.0.2.15 ( it is the IP address of our DNS server)

    首选的DNS服务器:10.0.2.15(这是我们的DNS服务器的IP地址)

验证IP配置 (Validate IP configurations)

SQLNode2网络配置 (SQLNode2 network configuration)
  • IP address: 10.0.2.22

    IP地址:10.0.2.22
  • Subnet mask: 255.255.255.0

    子网掩码:255.255.255.0
  • Preferred gateway – blank

    首选网关–空白
  • Preferred DNS server: 10.0.2.15 ( it is the IP address of our DNS server)

    首选的DNS服务器:10.0.2.15(这是我们的DNS服务器的IP地址)

验证IP配置 (Validate IP configurations)

在MyDemoSQL.com域中为SQL Server Always On可用性组添加SQLNode1 (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.

在此步骤中,我们需要将VM加入现有的域MyDemoSQL.com。 要将服务器添加到域中,请在服务器仪表板中单击服务器名称。

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

它打开系统属性。 单击更改,然后可以指定计算机名称及其域。

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.

单击“确定”,它将虚拟机加入指定的域。 您需要指定域管理员用户名和密码,以使其成为MyDemoSQL.com域的成员。

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

成功添加服务器后,您将收到一条欢迎消息,如下所示。

It reboots the VM. You should

重启虚拟机。 你应该

在MyDemoSQL.com域中添加SQLNode2 (Add SQLNode2 in the MyDemoSQL.com domain)

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

同样,在MyDemoSQL.com域中也添加SQLNode2 VM,并对其进行验证。

结论 (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.

在本文中,我们在虚拟机中配置了域控制器,Active Directory和DNS。 后来,我们配置了反向查找区域,域管理员帐户,本地管理员帐户,并为SQL Server Always On可用性组在域中添加了服务器。

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

在我的下一篇文章中,我将引导您完成故障转移群集的配置,仲裁配置以及SQL节点的存储驱动器分配。

目录 (Table of contents)

A comprehensive guide to SQL Server Always On Availability Groups on Windows Server 2016
Configure Domain Controller and Active Directory for SQL Server Always On Availability Groups
Configure failover clusters, storage controllers and quorum configurations for SQL Server Always On Availability Groups
Install SQL Server 2019 on Windows Server 2016 with SQL Server Always On Availability Groups
Add a new node into existing SQL Server Always On Availability Groups
Configure Managed Service Accounts for SQL Server Always On Availability Groups
Windows Server 2016上SQL Server Always On可用性组的全面指南
为SQL Server Always On可用性组配置域控制器和Active Directory
为SQL Server Always On可用性组配置故障转移群集,存储控制器和仲裁配置
在Windows Server 2016和SQL Server Always On可用性组上安装SQL Server 2019
将新节点添加到现有SQL Server Always On可用性组中
为SQL Server Always On可用性组配置托管服务帐户

翻译自: https://www.sqlshack.com/configure-domain-controller-and-active-directory-for-sql-server-always-on-availability-groups/

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

为SQL Server Always On可用性组配置域控制器和Active Directory 的相关文章

随机推荐

  • 三角函数公式

    转自 https baike baidu com item E4 B8 89 E8 A7 92 E5 87 BD E6 95 B0 E5 85 AC E5 BC 8F 4374733 fr aladdin 三角函数是数学中属于 初等函数中的
  • 现在学java的都是傻子

    不经意的看见 看到学java的都是傻子 当不经意看到 说明 这个最近已经在网上疯传了很多 说明目前这个行业真的已经不好了 所以你得自己当心了 在这个行业不知有多少学习了又放弃了 博主我也是其中之一 从博主我的名字相信大家也可以看出来 从放弃
  • Stem-and-Leaf Plot in R

    Data set faithful 272 2 Waiting time between eruptions and the duration of the eruption for the Old Faithful geyser gt d
  • flink源码阅读---Flink intervalJoin 使用和原理分析

    1 前言 Flink中基于DataStream的join 只能实现在同一个窗口的两个数据流进行join 但是在实际中常常会存在数据乱序或者延时的情况 导致两个流的数据进度不一致 就会出现数据跨窗口的情况 那么数据就无法在同一个窗口内join
  • 主成分分析PCA以及特征值和特征向量的意义

    定义 主成分分析 Principal Component Analysis PCA 是一种统计方法 通过正交变换将一组可能存在相关性的变量转换为一组线性不相关的变量 转换后的这组变量叫主成分 PCA的思想是将n维特征映射到k维上 k
  • android TextUtils工具类的用法

    方法摘要 static CharSequence 返回一个字符序列 commaEllipsize CharSequence text TextPaint p float avail String oneMore String more Co
  • Windows小技巧7--Sublime Text 3使用总结

    Windows小技巧7 Sublime Text 3使用总结 Sublime Text 是一个代码编辑器 也是HTML和散文先进的文本编辑器 Sublime Text是由程序员Jon Skinner于2008年1月份所开发出来 它最初被设计
  • C++中函数返回引用,及问题

    目录 函数返回值 返回引用 C 基础知识 函数返回引用深度解析 关于函数调用返回引用错误并且每次调用不一致的分析与解决 将引用作为函数返回值的格式 好处和规则 实用经验 45 禁止函数返回局部变量的引用 1 返回的是一个引用类型 也就是返回
  • 整数溢出的漏洞危害和预防

    智能合约作为区块链2 0的代表技术 适应于区块链去中心化 分布式的特点 具有独立运行 不可篡改的优良特性 可用于实现包含金融工具在内的各类分布式应用 开发者可以自行定义交易逻辑并开发代码发布到链上 合约代码在矿工节点的虚拟机环境 如EVM
  • vue踩坑填坑(一):引入模块组件

    在webpack vue开发中 如果在一个vue文件中引入另外一个封装的模块组件的vue文件 则有以下两种方式 首先想要在以下代码中引入一个封装好的输入框组件input text vue
  • cf服务器维护会不会掉分,《cf》枪王排位长时间不打会不会掉分? 枪王排位扣分机制介绍...

    川北在线核心提示 原标题 cf 枪王排位长时间不打会不会掉分 枪王排位扣分机制介绍 CF枪王排位大师以上不打会掉分么 很多小伙伴都在问枪王排位长时间不打会不会掉分 为此牛游戏小编为大家带来cf枪王排位扣分机制介绍 一起来看看枪王排位长时间不
  • Basic Level 1014 福尔摩斯的约会 (20分)

    题目 大侦探福尔摩斯接到一张奇怪的字条 我们约会吧 3485djDkxh4hhGE 2984akDfkkkkggEdsb s hgsfdk d Hyscvnm 大侦探很快就明白了 字条上奇怪的乱码实际上就是约会的时间星期四 14 04 因为
  • JDK8 HashMap put() 方法源码分析

    文章目录 一 前置知识 红黑树定义 二 构造方法 HashMap HashMap int initialCapacity float loadFactor tableSizeFor int cap 计算hashmap初始容量 三 put 方
  • 入门级题解7. 整数反转

    给你一个 32 位的有符号整数 x 返回将 x 中的数字部分反转后的结果 如果反转后整数超过 32 位的有符号整数的范围 231 231 1 就返回 0 假设环境不允许存储 64 位整数 有符号或无符号 思路 反转 想到链表反转 又看到是整
  • android studio对数据库进行,Android Studio 学习(四) 数据库

    文件存储 写数据 String data Data ti save FileOutputStream out null BufferedWriter writer null try out openFileOutput data Conte
  • C++毕业设计基于QT实现的超市收银管理系统源代码+数据库

    C 毕业设计基于QT实现的超市收银管理系统源代码 数据库 编译使用 编译完成后 需要拷贝 file目录下的数据库 POP db文件到可执行程序目录下 登录界面 主界面 会员管理 完整代码下载地址 基于QT实现的超市收银管理系统源代码 数据库
  • ctf.show 通关秘籍

    文章目录 CTF show 1 web签到题 2 web2 3 web3 CTF show 1 web签到题 访问web签到题的地址 发现页面只有 where is flag 字样 使用Fn F12进入调试模式 或者页面空白处点击右键查看网
  • mysql默认的数据库和表_MySQL 自带4个默认数据库

    默认数据库分类 information schema performance schema mysql test informance schema 保存了MySQl服务所有数据库的信息 具体MySQL服务有多少个数据库 各个数据库有哪些表
  • Mrosoft visual c++6.0打开文件未响应,快速解决。【最新办法,初学者都会】

    1 下载filetool的vc6 0的辅助工具 下载地址 http download microsoft com download vc60ent s1 6 0 w9xnt4 en us filetool exe 快速下载filetool
  • 为SQL Server Always On可用性组配置域控制器和Active Directory

    In this series for SQL Server Always On availability groups we are covering end to end configurations for SQL Server 201