aws ec2 选择可用区

In this article, we will review how to set up multi-subnet Always On Availability groups using AWS EC2 instances and AWS FSx as file share witness.

在本文中,我们将回顾如何使用AWS EC2实例和AWS FSx作为文件共享见证来设置多子网Always On可用性组。

The following are the steps involved in creating a multi-subnet Always On Availability groups in AWS EC2 instances:

以下是在AWS EC2实例中创建多子网Always On可用性组所涉及的步骤:

  • Prepare EC2 instances 准备EC2实例
  • Create AWS FSx for file share witness 创建用于文件共享见证的AWS FSx
  • Create Windows Server Failover cluster 创建Windows Server故障转移群集
  • Create Always On Availability Groups 创建始终在线可用性组

Let’s go over these steps one by one.

让我们一步一步地进行这些步骤。

准备EC2实例 (Preparing EC2 instances)

Log in to the AWS management console, click on Services, and navigate to the EC2 console.

登录到AWS管理控制台,单击服务 ,然后导航到EC2控制台。

Click on the Launch Instance button and choose the instance of your choice. For demo purposes, I used Windows Server 2019 with SQL Server 2017 Enterprise edition image. You can also launch windows server image and install SQL Server by bringing your own license method (BYOL).

单击启动实例按钮,然后选择所需的实例。 出于演示目的,我将Windows Server 2019与SQL Server 2017 Enterprise版映像一起使用。 您还可以通过自带许可证方法(BYOL)启动Windows Server映像并安装SQL Server。

Choose the instance type of your choice and configure the instance details like virtual private cloud network (VPC), subnet, etc. In this case, I am launching node 1 in the us-east-1a availability zone.

选择所需的实例类型,然后配置实例详细信息,例如虚拟私有云网络(VPC),子网等。在这种情况下,我将在us-east-1a可用性区域中启动节点1。

Add the storage and tag the instances. Configure the security group and launch the instance. Similarly, launch node 2 in the same virtual private cloud network (VPC) but a different availability zone i.e., us-east-1b. So, we have both the nodes up and running in the respective availability zones.

添加存储并标记实例。 配置安全组并启动实例。 同样,在相同的虚拟私有云网络(VPC)中启动节点2,但在不同的可用区域(即us-east-1b)中启动节点2。 因此,我们在相应的可用区中都启动并运行了节点。

Add two secondary IPs for each node. One is used for Windows Server Failover Clustering, and the other will be used for Always On Availability group listener.

为每个节点添加两个辅助IP。 一种用于Windows Server故障转移群集,另一种用于Always On可用性组侦听器。

To add the secondary IPs, select the node, and click on Actions (1). Click on Networking (2) and finally select Manage IP Addresses (3).

要添加辅助IP,请选择节点,然后单击“操作(1)”。 单击网络(2),最后选择管理IP地址(3)。

In Manage IP Addresses pop up, Click on Assign new IP two times and then click on Yes, Update as shown in the below image. You can input the custom IP addresses that are available or use the auto-assign option, which assigns a random IP address automatically.

在弹出的“ 管理IP地址”中 ,单击两次“ 分配新IP” ,然后单击“ 是,更新” ,如下图所示。 您可以输入可用的自定义IP地址,也可以使用自动分配选项,该选项会自动分配一个随机IP地址。

Similarly, assign two secondary IP addresses on node-2 as well.

同样,在节点2上也分配两个辅助IP地址。

Node 1 IP addresses:

节点1的IP地址:

Windows OS

172.31.44.241

Windows Failover cluster

172.31.44.223

Always On Availability groups Listener

172.31.44.110

Windows操作系统

172.31.44.241

Windows故障转移群集

172.31.44.223

始终在线可用性组侦听器

172.31.44.110

Node 2 IP addresses:

节点2的IP地址:

Windows OS

172.31.3.187

Windows Failover cluster

172.31.4.222

Always On Availability groups Listener

172.31.15.89

Windows操作系统

172.31.3.187

Windows故障转移群集

172.31.4.222

始终在线可用性组侦听器

172.31.15.89

Now we need to add both the nodes to a domain. For detailed steps of adding the nodes to the domain, you can refer to the following SQL Shack articles:

现在,我们需要将两个节点都添加到域中。 有关将节点添加到域中的详细步骤,可以参考以下SQL Shack文章:

  • How to configure SAN less SQL Server clusters in AWS EC2 using SIOS DataKeeper 如何使用SIOS DataKeeper在AWS EC2中配置较少SANSQL Server群集
  • Domain Controller and Domain Client Node setup for AlwaysON High Availability 用于AlwaysON高可用性的域控制器和域客户端节点设置

After adding nodes to the window’s active directory domain, restart both the nodes.

将节点添加到窗口的活动目录域后,重新启动两个节点。

Log in to each node using the remote desktop protocol (RDP) and start installing the Failover Cluster feature. To install the Failover Cluster feature, Open Server Manager, and click on Add roles and features.

使用远程桌面协议(RDP)登录到每个节点,然后开始安装故障转移群集功能。 要安装故障转移群集功能,请打开服务器管理器,然后单击添加角色和功能

Click on the Next button and select Roles-based or feature-based installation. Select the server and click on the Next button. On Features pane, select the Failover clustering feature and click on the Add Features button.

单击下一步按钮,然后选择基于角色的安装或基于功能的安装。 选择服务器,然后单击下一步按钮。 在“ 功能”窗格上,选择“故障转移”群集功能,然后单击“ 添加功能”按钮。

Click Next and select restart the destination server if required. Click on the Install button. Similarly, install the failover cluster feature on node-2 as well.

单击下一步,然后根据需要选择重新启动目标服务器。 单击安装按钮。 同样,在节点2上也安装故障转移群集功能。

为文件共享见证创建AWS FSx (Creating AWS FSx for file share witness)

Log in to the AWS management console, click on Services and navigate to FSx console, as shown in the below image.

登录到AWS管理控制台,单击服务 ,然后导航到FSx控制台,如下图所示。

Click on Create file system and select Amazon FSx for Windows File Server. Click on the Next button.

单击创建文件系统,然后选择适用于Windows File Server的 Amazon FSx 。 单击下一步按钮。

Enter the file system name, select the configuration options like virtual private cloud (VPC) network, subnet, and security groups. Select self-managed Microsoft Active Directory and enter the domain name and the IP address of the domain controller. Enter the user name and password, which has the right permissions to create AWS FSx objects in Microsoft Active Directory. Click on the Next button and click on Create file system.

输入文件系统名称,选择配置选项,例如虚拟私有云(VPC)网络,子网和安全组。 选择自我管理的Microsoft Active Directory,然后输入域控制器的域名和IP地址。 输入用户名和密码,该用户名和密码具有在Microsoft Active Directory中创建AWS FSx对象的权限。 单击下一步按钮,然后单击创建文件系统。

Once the file system is created successfully and available, click on the file system name to navigate to the file system details page where you can see the DNS name of the file system. You can access the file system using the DNS name. For example, if DNS name is amznfsxnhgf0abc.domain.com then you can access file share using amznfsxnhgf0abc.domain.com\share and the same will be used as file share witness in Always On Availability groups cluster

成功创建文件系统并使其可用后,单击文件系统名称以导航至文件系统详细信息页面,您可以在其中查看文件系统的DNS名称。 您可以使用DNS名称访问文件系统。 例如,如果DNS名称为amznfsxnhgf0abc.domain.com,则可以使用amznfsxnhgf0abc.domain.com \ share访问文件共享,并且该文件将用作Always On可用性组群集中的文件共享见证。

Make sure you have the connectivity to file system from both the nodes by adding rules in the Fsx security group to allow inbound connections from both the nodes.

通过在Fsx安全组中添加规则以允许来自两个节点的入站连接,确保从两个节点都具有到文件系统的连接性。

创建Windows Server故障转移群集 (Creating Windows Server Failover cluster)

Log in to node 1 using the remote desktop protocol (RDP) and launch failover cluster manager. Click on Create Cluster, as shown in the below image.

使用远程桌面协议(RDP)登录到节点1,并启动故障转移群集管理器。 单击Create Cluster ,如下图所示。

Click on the Next button. Add both the nodes and click the Next button.

单击下一步按钮。 添加两个节点,然后单击下一步按钮。

Select Yes to run the validation tests and access the validation report. In this case, I am ignoring the validation test. Click Next.

选择“ 是”以运行验证测试并访问验证报告。 在这种情况下,我将忽略验证测试。 单击下一步

Enter the name of the failover cluster and click on the Next button to create a Windows failover cluster which manages the Always On Availability groups failover.

输入故障转移群集的名称,然后单击下一步按钮以创建Windows故障转移群集,该群集管理Always On Availability组故障转移。

Once the cluster creation is successful, open the failover cluster manager. Click on the cluster you created (1). Right-click on the IP address under cluster core resources and click on Properties (2). Select the Static IP address and input one of the secondary IP address from the node, which is in 172.31.32.0/20 subnet.

集群创建成功后,打开故障转移集群管理器。 单击您创建的集群(1)。 右键单击群集核心资源下的IP地址,然后单击属性(2)。 选择静态IP地址,然后从172.31.32.0/20子网中的节点输入辅助IP地址之一。

Similarly, right-click on the cluster network 1 IP address and click on Properties. Select the static IP address and input one of the secondary IP addresses from another node.

同样,右键单击群集网络1的IP地址,然后单击“属性”。 选择静态IP地址,然后从另一个节点输入一个辅助IP地址。

Now bring the cluster resource online.

现在使群集资源联机。

Now let us configure the file share witness. Right-click on the cluster (1) and select More Actions (2). Finally, click on Configure Cluster Quorum Settings… (3).

现在,让我们配置文件共享见证。 右键单击群集(1),然后选择“更多操作”(2)。 最后,单击“配置群集仲裁设置…”(3)。

Click on the Next button. Select the Quorum witness and click Next. Select configure a file share as witness and click Next. Input the file share path and click Next.

单击下一步按钮 选择仲裁见证人,然后单击下一步 。 选择将文件共享配置为见证服务器,然后单击下一步 。 输入文件共享路径,然后单击“ 下一步”。

创建始终在线可用性组 (Creating Always on Availability Group)

Log in to the node 1 using the remote desktop protocol (RDP) and open SQL Server configuration manager. Click on SQL Server Services and right-click on SQL Server service. Click on Properties. Navigate to AlwaysOn High Availability tab and Enable AlwaysOn Availability groups and restart the SQL Server services. Repeat the same steps on node 2 to enable AlwaysOn Availability Groups.

使用远程桌面协议(RDP)登录到节点1并打开SQL Server配置管理器。 单击“ SQL Server服务”,然后右键单击“ SQL Server服务”。 单击属性。 导航到AlwaysOn高可用性选项卡,然后启用AlwaysOn可用性组,然后重新启动SQL Server服务。 在节点2上重复相同的步骤以启用AlwaysOn可用性组。

Open SQL Server management studio (SSMS) on node-1 and log in to the SQL server. Navigate to Always On High Availability and right-click on it and select New Availability Group Wizard. Click on the Next button.

在节点1上打开SQL Server Management Studio(SSMS),然后登录到SQL Server。 导航到Always On高可用性,然后右键单击它,然后选择New Availability Group Wizard。 单击下一步按钮。

Enter the Always On Availability group’s name and click on the Next button.

输入Always On Availability组的名称,然后单击Next按钮。

Select the databases that need to be added to the availability group and Add the secondary node as Replica. In the listener tab, enter the listener name and add the secondary IP from both nodes which are not used. Click Next.

选择需要添加到可用性组的数据库,然后将辅助节点添加为副本。 在“侦听器”选项卡中,输入侦听器名称,并从两个未使用的节点中添加辅助IP。 单击下一步

Select the type of data synchronization as per your choice. In this case, I used a full database backup and log backup. Click Next and Finish.

根据您的选择选择数据同步的类型。 在这种情况下,我使用了完整的数据库备份和日志备份。 单击下一步,然后单击完成

After successful creation of Always on Availability group, navigate to the availability group in SQL Server management studio (SSMS). Right-click on the availability group and click on Show Dashboard to see the health of Always on Availability groups. Please refer to the below image for the dashboard.

成功创建始终在线可用性组后,请导航到SQL Server Management Studio(SSMS)中的可用性组。 右键单击可用性组,然后单击“ 显示仪表板”以查看“始终可用”组的运行状况。 请参考下图的仪表板。

To test the failover, I shutdown the current primary node and connected using Always On listener name from SQL Server management studio (SSMS). Please refer to the below image for the Always-On dashboard after automatic failover. We can see that the previous primary node is shut down, and the previous secondary node became the primary node after automatic failover. The listener will serve requests from the listener IP address of the currently active node.

为了测试故障转移,我关闭了当前的主节点,并使用来自SQL Server Management Studio(SSMS)的Always On侦听器名称进行了连接。 自动故障转移后,请参考下图的始终在线仪表板。 我们可以看到先前的主节点已关闭,并且先前的辅助节点在自动故障转移后成为了主节点。 侦听器将处理来自当前活动节点的侦听器IP地址的请求。

结论 (Conclusion)

In this article, we explored how to set up multi-subnet Always On Availability Groups using AWS EC2 instances. In case you have any questions, please feel free to ask in the comment section below. To continue you learning about Always On Availability Groups, Please refer to the AlwaysOn Availability Groups category.

在本文中,我们探讨了如何使用AWS EC2实例设置多子网Always On可用性组。 如果您有任何疑问,请随时在下面的评论部分中提问。 若要继续学习Always On可用性组,请参考AlwaysOn可用性组类别。

翻译自: https://www.sqlshack.com/configuring-sql-server-always-on-availability-groups-on-aws-ec2/

aws ec2 选择可用区

aws ec2 选择可用区_在AWS EC2上配置SQL Server Always On可用性组相关推荐

  1. sql server父节点_将新节点添加到现有SQL Server Always On可用性组中

    sql server父节点 This is the 5th article in the series of a comprehensive guide to SQL Server Always On ...

  2. aws ec2 选择可用区_AWS Messaging Services:选择合适的服务

    aws ec2 选择可用区 1. AWS消息服务 AWS Messaging服务使云中相似和不同的软件系统能够异步通信和交换信息. 这些软件系统可能不兼容且使用不同的语言,也可能在不同的平台上. AW ...

  3. tde数据库加密_如何在TDE加密的数据库上配置SQL Server镜像

    tde数据库加密 Securing and encrypting sensitive data stored in your production databases is a big concern ...

  4. 思科模拟器划分子网实验报告_模拟多子网群集以设置SQL Server Always On可用性组–实验设置

    思科模拟器划分子网实验报告 In this article, we are going to see how to create a multi subnet cluster spanning acr ...

  5. linux配置conf_如何使用mssql-conf和其他可用工具在Linux上配置SQL Server 2017

    linux配置conf Configuration of any system plays a vital role in its working efficiently. However, conf ...

  6. sql server高可用_SQL Server始终在线可用性组采访问题与解答

    sql server高可用 In this article, we will discuss a number of interview questions that you could be ask ...

  7. sql活动监视器 死锁_使用system_health扩展事件监视SQL Server死锁

    sql活动监视器 死锁 Performance monitoring is a must to do the task for a DBA. You should ensure that the da ...

  8. 40了解云计算平台的高可用架构,如 AWS 的多可用区、GCP 的负载均衡器

    云计算平台提供的高可用架构可以帮助用户确保服务的可靠性和稳定性.在 AWS 和 GCP 中,高可用架构通常涉及多个可用区域(Availability Zones)或负载均衡器(Load Balance ...

  9. 亚马逊ec2 实例删除_在Amazon EC2实例中的Red Hat上安装SQL Server Linux

    亚马逊ec2 实例删除 This article explores the configuration of the Red hat Amazon EC2 instance for SQL Serve ...

最新文章

  1. 使用opencv dnn 模块调用darknet模型时候出错,不支持relu激活函数
  2. SQL Server中的高可用性(3)----复制 (转载)
  3. [翻译] MotionBlur
  4. 应用程序服务器和Web服务器之间有什么区别?
  5. 高职院校计算机基础课程要求,浅谈高职院校计算机的应用基础课程的改革.doc...
  6. 兄弟机cnc系统面板图解_FANUC软操作面板的应用介绍,真的太详细了
  7. idea创建maven程序_使用Maven程序集创建漏洞评估工件
  8. win10修改服务器地址,win10 修改服务器地址
  9. REHL 6 安装指南
  10. Div Vertical Menu ver2
  11. 在win7 64位上安装VS2015的问题汇总
  12. 解决屏蔽JS代码报错的问题
  13. 有限差分法解NS方程原理
  14. 图解十大经典机器学习算法
  15. 从零開始搭建微信硬件开发环境全过程——1小时掌握微信硬件开发流程
  16. 矩阵的生成及对角线运算
  17. 【转】2009最受欢迎中国技术博客评选(PB50)结果公布
  18. Oracle 轻量级实时监控工具 oratop
  19. 九连环课程设计c语言,九连环C语言程序
  20. [译] APT分析报告:01.Linux系统下针对性的APT攻击概述

热门文章

  1. c语言会生成class文件,一文带你刨析class文件
  2. 架构师软技能之协商(上)
  3. 【习题 7-2 UVA-225】Golygons
  4. Ajax提交数据判断员工编号是否存在,及自动填充与员工编号所对应的员工姓名。...
  5. (剑指Offer)面试题46:求1+2+3+....+n
  6. phoneGap实现离线缓存
  7. android单元测试作用,Android单元测试源码解读
  8. 线程安全的三大不安全案例以及解决方法
  9. Visual Studio Code是什么
  10. 老年人学摄影,装备该如何选择?