如何使用SIOS DataKeeper在AWS EC2中配置较少SANSQL Server群集

In this article, we will review how to configure SAN less SQL Server cluster in AWS EC2 instances using SIOS DataKeeper.

在本文中,我们将回顾如何使用SIOS DataKeeper在AWS EC2实例中配置SAN较少SQL Server群集。

SQL Server clustering is a high availability feature which failover the SQL Server resources to the secondary node in case of a failure in the primary node. The data is stored in the shared drive and will be accessible to the active node in the cluster. In case of failover, we do not need to transfer jobs, logins, linked server or server scoped triggers, etc. to the other node as the instance is the same.

SQL Server群集是一项高可用性功能,如果主节点发生故障,该功能会将SQL Server资源故障转移到辅助节点。 数据存储在共享驱动器中,并且群集中的活动节点可以访问该数据。 如果发生故障转移,我们不需要将作业,登录名,链接的服务器或服务器范围的触发器等转移到另一个节点,因为实例是相同的。

Please refer to the below image which shows the traditional SQL Server failover cluster using shared disks. The shared disks are active on the NODE1 which is active, and the SQL server services are running on NODE1. The users connect to the instance using a virtual SQL Server cluster name or IP address which routes the request to the active node in the cluster.

请参考下图,该图显示了使用共享磁盘的传统SQL Server故障转移群集。 共享磁盘在活动的NODE1上处于活动状态,并且SQL Server服务在NODE1上运行。 用户使用虚拟SQL Server群集名称或IP地址连接到实例,该名称或IP地址将请求路由到群集中的活动节点。

traditional SQL Server cluster

使用SIOS DataKeeperSQL Server群集 (SQL Server clustering using SIOS DataKeeper)

SIOS DataKeeper allows us to build the SQL Server cluster on cloud environments without the need for shared storage.

SIOS DataKeeper允许我们在云环境上构建SQL Server群集,而无需共享存储。

The data in the disk on the primary node is mirrored to the secondary node. Please refer to the below image for SAN less SQL Server cluster using SIOS DataKeeper.

主节点上磁盘中的数据已镜像到辅助节点。 请参考下图,了解使用SIOS DataKeeper的SAN较少SQL Server群集。

san less SQL Server cluster

NODE1 will have its disk and NODE2 will have its disk. SIOS DataKeeper will replicate the data to the other node synchronously or asynchronously based on the option we choose.

NODE1将拥有其磁盘,而NODE2将拥有其磁盘。 SIOS DataKeeper将根据我们选择的选项将数据同步或异步复制到另一个节点。

The following are the steps involved in configuring the SAN less SQL Server cluster in AWS EC2 instances.

以下是在AWS EC2实例中配置SAN较少SQL Server群集所涉及的步骤。

  1. Launch two instances and add them to one domain

    启动两个实例并将它们添加到一个域
  2. Configure windows failover cluster

    配置Windows故障转移群集
  3. Attach a volume to both instances

    将卷附加到两个实例
  4. Configure SIOS jobs to replicate the data

    配置SIOS作业以复制数据
  5. Install the SQL Server failover cluster

    安装SQL Server故障转移群集

Let go over these steps one by one.

让我们一步一步地完成这些步骤。

For demo purpose, I am launching a Windows server 2016 base from AWS console to installing active directory services and make it as a domain controller. For production servers please configure domain controller with all the security and firewall rules you need.

出于演示目的,我将从AWS控制台启动Windows Server 2016 base,以安装活动目录服务并将其用作域控制器。 对于生产服务器,请为域控制器配置所需的所有安全和防火墙规则。

Log in to the AWS and navigate to the EC2 console. Click on Launch an instance and search for Windows Server 2016 base image. Select the image as shown in the below image.

登录到AWS并导航到EC2控制台。 单击启动实例,然后搜索Windows Server 2016基本映像。 选择图像,如下图所示。

SQL Server cluster setup

Choose the Instance type. In this case, I choose t2.medium Configure the instance details and add the storage. Choose the security group if you already have one or create a new one. While launching the instance choose the key pair and make sure you have the key pair which will be used to connect the instance later.

选择实例类型。 在这种情况下,我选择t2.medium配置实例详细信息并添加存储。 选择安全组(如果已有)或创建一个新的安全组。 在启动实例时,请选择密钥对,并确保您具有将在以后用于连接实例的密钥对。

key pair to launch domain controller

After four or five minutes the instance will be available for use. For identification purposes, I am naming it as “Domain Controller”.

四,五分钟后,该实例即可使用。 为了便于识别,我将其命名为“域控制器”。

domain controller

Now select the instance and click on Connect.

现在选择实例,然后单击“连接”。

domain controller

Click on Get Password. upload the .pem which was used to launch the instance. Click on decrypt the password.

单击获取密码。 上载用于启动实例的.pem。 单击解密密码

RDP the instance using the public IP and the password of the instance. Launch Server Manager and click on Add roles and features.

使用公共IP和实例密码对实例进行RDP。 启动服务器管理器 ,然后单击添加角色和功能

SQL Server cluster setup

Click Next and select roles based or feature-based installation and click Next. Select a server from the pool and click Next.

单击下一步,然后 选择基于角色的安装或基于功能的安装,然后单击下一步。 从池中选择服务器,然后单击“ 下一步”

add active directory services

Select Active Directory domain services and click Next, Next and Install.

选择Active Directory域服务,然后单击“ 下一步” ,“ 下一步”和“ 安装”。

add active directory services

Once the installation is completed, close the window and click on Promote this server as a domain controller.

安装完成后,关闭窗口,然后单击“将其升级为域控制器”

promote this server as domain controller

Select Add a new forest and enter the domain name. Click Next.

选择添加新林并输入域名。 单击下一步。

add forest

Enter the password and click Next.

输入密码,然后单击下一步

add forest

Click Next. Enter the NetBIOS name and click Next. Specify the paths for the AD database and logs.

单击下一步 。 输入NetBIOS名称,然后单击“ 下一步” 。 指定AD数据库和日志的路径。

AD DS database and log files

Once the prerequisites check is successful, click on Install. Once the installation completes the server will reboot.

前提条件检查成功后,单击“ 安装”。 安装完成后,服务器将重新启动。

After reboot, RDP to the server again. Launch Active Directory Users and Computers. Create a new user and add it Administrators and Domain Controllers, Domain Computers, Domain Administrators group.

重新引导后,再次将RDP连接到服务器。 启动Active Directory用户和计算机 。 创建一个新用户并将其添加到“ 管理员域控制器” ,“域计算机”,“ 域管理员”组中。

domain controller user

启动两个实例并将它们添加到一个域 (Launch two instances and add them to one domain)

In this demo, I am setting up a two-node SQL Server cluster. So, I am launching two new nodes and join them to the domain we created above. These two nodes will be part of the cluster.

在此演示中,我将设置一个两节点SQL Server群集。 因此,我要启动两个新节点,并将它们加入到上面创建的域中。 这两个节点将成为群集的一部分。

There are two ways to launch the instances. One is launching the instances using EC2 console and install SIOS DataKeeper with your license. The other way is subscribing to SIOS DataKeeper in the AWS Market place and launch the instance from there. This way EC2 instance comes with SIOS pre-installed.

有两种启动实例的方法。 一种是使用EC2控制台启动实例,然后使用许可证安装SIOS DataKeeper。 另一种方法是在AWS Market地方订阅SIOS DataKeeper并从那里启动实例。 这样,EC2实例预装了SIOS。

In this demo, we will use a subscription model.

在此演示中,我们将使用订阅模型。

To subscribe for SIOS data keeper, Navigate to AWS Market Place subscriptions. Click on Discover products.

要订阅SIOS数据管理员,请导航至AWS Market Place订阅 。 单击发现产品

san less SQL Server cluster setup

Search for SIOS DataKeeper and click on SIOS DataKeeper on Windows Server 2016.

搜索SIOS DataKeeper,然后在Windows Server 2016上单击SIOS DataKeeper

san less SQL Server cluster setup

Click on Continue to Subscribe and Accept Terms.

单击继续以 订阅并接受条款。

Once the subscription is successful, click on Continue to Configuration.

订阅成功后,单击继续配置。

SIOS DataKeeper subscription

Select the region, software version and click on Continue to Launch.

选择区域,软件版本,然后单击继续启动

SIOS DataKeeper subscription

Choose Launch through EC2 and click on Launch.

选择通过EC2启动,然后单击启动

SIOS DataKeeper subscription

Select the instance type. In this case, I choose m5d.large and click on Configure Instance Details.

选择实例类型。 在这种情况下,我选择m5d.large并单击Configure Instance Details

SIOS DataKeeper subscription instances

Enter the number of instances as 2, select the subnet and click on Add Storage. You can also launch instances individually in multiple availability zones.

输入实例数为2,选择子网,然后单击Add Storage 。 您还可以在多个可用性区域中分别启动实例。

SIOS DataKeeper subscription

Add storage, tags, select the security groups and launch the instances.

添加存储,标签,选择安全组并启动实例。

RDP to the instances we launched, Navigate to Control Panel -> Network and Internet -> Network and sharing center.

RDP到我们启动的实例,导航到控制面板->网络和Internet->网络和共享中心。

Click on the network adaptor -> Properties -> double click on Internet Protocol Version 4.

单击网络适配器->属性->双击Internet协议版本4。

san less SQL Server cluster setup

IPV4 properties

IPV4 Properties

Open the command prompt and enter ipconfig to know the IP address of the node and modify the ipv4 properties as shown in the below image. Select use the following IP address and enter the same IP address, subnet mask, default gateway of the node. Enter the private IP of the domain controller in the Preferred DNS server.

打开命令提示符,然后输入ipconfig以了解该节点的IP地址,并修改ipv4属性,如下图所示。 选择“使用以下IP地址”,然后输入相同的IP地址,子网掩码,节点的默认网关。 在“ 首选DNS服务器”中输入域控制器的专用IP。

IPV4 properties to join node to domain

Click ok and apply the changes. Now join the node to the domain.

单击确定应用更改。 现在将节点加入域。

join node to domain

Similarly, on node2 change the IP address, subnet mask, default gateway, and the preferred DNS server.

同样,在node2上更改IP地址,子网掩码,默认网关和首选DNS服务器。

Join the node2 to the domain. After joining the node, it restarts.

将node2加入域。 加入节点后,它将重新启动。

RDP to node1 and launch failover cluster manager. Add both nodes which will be part of the cluster and click Next.

RDP到node1并启动故障转移群集管理器。 添加将成为群集一部分的两个节点,然后单击下一步。

san less SQL Server cluster setup

Enter the name of the cluster and give it an IP address.

输入集群的名称并为其提供IP地址。

Cluster setup

Uncheck the Add all the eligible storage to the cluster and click Next. We can add storage later using SIOS DataKeeper.

取消选中将所有符合条件的存储添加到群集中,然后单击下一步 。 我们稍后可以使用SIOS DataKeeper添加存储。

cluster setup

Once the cluster setup is done you would see both nodes in the failover cluster manager.

完成集群设置后,您将在故障转移集群管理器中看到两个节点。

nodes in failover cluster

将卷附加到两个实例 (Attach a volume to both the instances)

We need to create two volumes and associate one to each node. Navigate to AWS EC2 console. Click on volumes and Create Volume.

我们需要创建两个卷,并将每个卷关联一个。 导航到AWS EC2控制台。 单击卷并创建卷

add volumes to the nodes

Select the created volume and click on Actions dropdown. Click on attach volume and associate it to node1.

选择创建的卷,然后单击“ 操作”下拉列表。 单击附加卷并将其关联到node1。

add volumes to the nodes

Similarly, create another volume and attach it to the node2 which will be used in the SQL Server cluster.

同样,创建另一个卷并将其附加到将在SQL Server群集中使用的node2。

RDP to node1 and open disk management. The newly attached volume shows up as below. Click ok.

RDP到node1并打开磁盘管理 。 新连接的卷显示如下。 单击确定

add volume to the nodes

Right-click on the disk and click on New Simple Volume.

右键单击磁盘,然后单击“ 新建简单卷”

New Simple Volume

Assign the letter to drive and Click Next.

将字母分配给驱动器,然后单击下一步。

New Simple Volume

Format and assign the label. Click Next.

格式化并分配标签。 单击下一步

New Simple Volume

Similarly, on node2 make a volume and give the same label and drive letter.

同样,在node2上创建一个卷,并提供相同的标签和驱动器号。

配置SIOS DataKeeper作业以复制数据 (Configure SIOS DataKeeper jobs to replicate the data)

On node1 launch the SIOS DataKeeper. Click on Connect to server.

在节点1上,启动SIOS DataKeeper。 单击连接到服务器。

SIOS DataKeeper source and target connection

Enter node1 and click on Connect.

输入node1并单击Connect。

SIOS DataKeeper source and target connection

Similarly, Connect to node2. Once both nodes are connected, click on create the job. Enter the job name and the description.

同样,连接到node2。 连接两个节点后,单击创建作业 。 输入工作名称和描述。

san less SQL Server cluster setup

Choose the source and the drive you want to mirror. Click Next.

选择源和要镜像的驱动器。 单击下一步

SIOS DataKeeper source and target connection

Choose the target server and the drive. Click Next.

选择目标服务器和驱动器。 单击下一步

SIOS DataKeeper source and target connection

Choose the synchronization mode and click on Done.

选择同步模式,然后单击完成。

synchronization mode

Once the mirroring is created, it asks if you want to add the volume to the failover cluster. Click Yes.

创建镜像后,它会询问您是否要将卷添加到故障转移群集。 单击是。

add storage to failover cluster

Now the disk will be shown in the failover cluster manager. We can see node1 is the owner node of the disk.

现在,该磁盘将显示在故障转移群集管理器中。 我们可以看到node1是磁盘的所有者节点。

If you want to add more disks you need to create jobs for them and add the volume to the failover cluster.

如果要添加更多磁盘,则需要为其创建作业并将卷添加到故障转移群集。

DataKeeper volume in failover cluster

On node2, the disk is locked.

在节点2上,磁盘已锁定。

clustered disk on secondary node

Now we have windows failover cluster and the cluster storage needed so that we can proceed and install the SQL Server cluster instance.

现在,我们有了Windows故障转移群集和所需的群集存储,以便我们可以继续并安装SQL Server群集实例。

安装SQL Server故障转移群集实例 (Install SQL Server failover cluster instance)

Login to the node1 and locate the setup files to install the SQL Server failover cluster.

登录到node1并找到安装文件以安装SQL Server故障转移群集。

Please refer to the below articles for step by step installation of the SQL Server failover cluster.

请参考以下文章,以逐步安装SQL Server故障转移群集。

SQL Server 2014 – Install a clustered instance – step-by-step (1/3)

SQL Server 2014 –安装群集实例–分步(1/3)

SQL Server 2014 – Install a clustered instance – step-by-step (2/3)

SQL Server 2014 –安装群集实例–分步(2/3)

SQL Server 2014 – Install a clustered instance – step-by-step (3/3)

SQL Server 2014 –安装群集实例–分步(3/3)

结论 (Conclusion)

In this article, we explored to launch instances with SIOS subscription and created mirrored drives using SIOS which will be used as a clustered storage. In case you have any questions, please feel free to ask in the comment section below.

在本文中,我们探索了使用SIOS订阅启动实例的过程,并使用SIOS创建了将用作集群存储的镜像驱动器。 如果您有任何疑问,请随时在下面的评论部分中提问。

翻译自: https://www.sqlshack.com/how-to-configure-san-less-sql-server-clusters-in-aws-ec2-using-sios-datakeeper/

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值