Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind

1.前言:

         最近我有机会接触到windows2008R2的一系列服务器产品,本文将记录在vbox上搭建windows2008R2下的mssql2008R2 cluster+logshipping环境过程,由于本人过去没有接触过此类环境,该实验也是历时一周研究逐个扫清障碍才得以完成。如果有不妥之处请拍砖! 另外要特别感谢一下Eason, 他是windows及虚拟化领域专家,在两个重点难题上给了我极具建设性的建议! 另外网上也鲜有vbox下搭建该环境的文章,希望本文对习惯vbox搭建虚拟机环境的朋友们有所帮助!


2.网络拓扑图:

Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第1张图片


备注: 整个环境均在vbox中完成,一共使用了10 网段中8个IP, 另外server1与server2之间,配置了两个私有IP做心跳检测。


3. 域控制器搭建,并将server1,server2,server3,server4 加入域


3.1 先在win2008dc上将dns指向自己,然后开始域控制器的创建:

实验重点之一: 在虚拟机环境中,如果我们使用了clone的方式来创建多个windows主机环境,那么在使用这些主机之前,必须使用sysprep来初始化每个主机操作系统SID,否则会在后面的实验中带来一系列诡异且无法解决的问题! sysprep初始化完成后,会显示“欢迎使用”字样,需要重新进性主机名与网络的配置。


Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第2张图片


Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第3张图片


Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第4张图片


Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第5张图片


Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第6张图片


Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第7张图片


Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第8张图片


Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第9张图片


Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第10张图片


Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第11张图片


Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第12张图片


Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第13张图片


Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第14张图片



3.2 针对需要加域的机器,只需要将DNS指向域控制器,然后即可加域:

Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第15张图片


Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第16张图片



3.3 完成加域之后,请在每个主机中关闭Domain network上的防火墙!




4. 配置共享存储服务器

      实验重点之二: 在win2008R2虚拟机环境中,无论是使用VM ware还是Vbox,我们都不能使用虚拟机本身的共享磁盘功能创建共享存储,因为在windows 2008 cluster验证环节,会因为无法识别存储设备厂商而失败(这个问题在真实物理存储设备中也会存在,而微软官方唯一的解决办法就是找存储厂商刷新存储的Firmware,而这在我们测试环境是不可能做到的!),幸好这里有个”曲线救国“的方案,就是借助第三方SAN iSCSI 共享服务软件(starwind),搭建共享存储服务器,这样以来,其他主机可以使用ISCSI indicator通过TCP/IP的方式同时连接并挂载上面的磁盘,实现共享存储的功能。


Starwind 的配置:


4.1 在安装之前,首先在每台主机上启用Microsoft iSCSI Initiator Service,并设置自动启动

Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第17张图片 


4.2 在server4上安装starwind:

Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第18张图片

根据自己需求配置共享磁盘的个数与尺寸,但是至少需要有一个仲裁盘,一个DTC磁盘,一个用户数据盘



4.3 将共享磁盘挂载到cluster的各个节点中:

将共享磁盘挂载到server1,server2,然后格式化为NTFS,分配盘符。通常仲裁盘为Q, 其他数据盘为R,S。  通过重启确认两台server 均为每个共享磁盘分配了同样的盘符。

Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第19张图片


最终在storage management中,布局如下:

Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第20张图片



5. 配置windows failover cluster


5.1 为节点之间配置心跳线

5.1.1在vbox中,使用internal的网络模式,为虚拟机加上第二块网卡

Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第21张图片



5.1.2 将第二块网卡在虚拟机操作系统中进行配置

不需要网关与dns,其他无关服务全部取消。

Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第22张图片


Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第23张图片


Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第24张图片


将心跳网卡指定为最高速度,避免因为自适应而发生的丢包:

Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第25张图片


将域网卡与心跳网卡命名,这有利于后面的管理:


在上面的界面按一下alt键,选择advanced,将lan的优先级调高于cluster:

Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第26张图片


5.2 分别在两个节点的操作系统安装failover clusting 的feature

Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第27张图片


Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第28张图片


Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第29张图片


5.2.1 先进行failover cluster安装前的验证

Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第30张图片


Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第31张图片


请确保该验证过程100%通过,没有任何warning,否则一定要排查。 可以发现在检测期间,共享磁盘会在两个节点中不停的online-offline,这是向导在做一系列的failover测试,以确认共享磁盘组能满足windows 2008 cluster的需求!

Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第32张图片


没有任何警告,通过检测:

Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第33张图片


5.2.2 开始创建failover cluster

Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第34张图片


Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第35张图片


Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第36张图片


5.3 确认仲裁盘对象正确,如果不对,需要进行调整

Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第37张图片


调整仲裁盘的方式:

Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第38张图片


选择适合当前的配置类型

Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第39张图片


指定作为仲裁盘的共享存储

Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第40张图片


Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第41张图片




6. 为windows failover cluster添加DTC应用

Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第42张图片


Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第43张图片


指定DTC Ip:

Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第44张图片


指定DTC磁盘:

Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第45张图片


Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第46张图片


配置成功后,状态如下:

Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第47张图片



7. 万事俱备,只欠安装sqlserver2008R2 cluster!

7.1 添加域帐户sqlcluster用于启动mssql相关服务

Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第48张图片

其中sqlcluster用于集群中sql相关服务的启动,sqlservice用于stand-alone环境的sql相关服务启动。


7.2 在节点1上安装sql2008 failover cluster

Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第49张图片


Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第50张图片


这里我比较疑惑的是:我已经将网卡lan的优先级提到了网卡cluster之上,为什么还会有此警告呢? 如果知道的朋友告诉我一下,谢谢! 但是安装还是可以继续的。

Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第51张图片


Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第52张图片


Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第53张图片


Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第54张图片


Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第55张图片


Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第56张图片


Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第57张图片


Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第58张图片


Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第59张图片


Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第60张图片


Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第61张图片


Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第62张图片


Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第63张图片



针对sql2008的安装,单cpu与1g内存应该说是最低硬件标准了。虽然硬件资源比较捉襟见肘,但是还是可以顺利完成安装的:)

Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第64张图片


Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第65张图片


此时在DNS服务器上,也建立好了相关A记录

Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第66张图片



7.3 在节点2上,使用安装向导将本节点加入cluster

其过程与在节点1安装并无太大区别,不同的是需要在此过程中指定要加入的集群实例,并且要提供与节点一相同的域账户口令。

Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第67张图片


Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第68张图片


Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第69张图片


Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第70张图片


8. 为cluster实例配置logshipping standby database

8.1 在集群建立主库共享备份文件夹

在test3 上安装sql2008 stand-alone的过程略过。

本步骤重点: 主实例的日志备份路径必须放在共享数据存储上,可以在当前sql服务启动的节点上,访问S盘,建立logshipping共享文件夹,并将域帐户bond\sqlcluster与bond\sqlservice均加入,赋予读写权限!

Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第71张图片

此时,\\mssqlcluster1\logshipping   已经可以访问了!

Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第72张图片


在sqlserver应用下,多出了一个file server:

Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第73张图片



8.2 在server3建立备库共享文件夹

Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第74张图片


8.2 配置logshipping

详细步骤略过,仅指出重点步骤:

Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第75张图片


此处必须使用共享存储,

Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第76张图片


Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第77张图片


Deploy MSSQL2008R2 cluster and logshipping on Windows2008R2 cluster by using VBOX&StarWind_第78张图片




至此,在vbox虚拟机与starwind的支持下,windows2008R2cluster+MSSQL2008 cluster 创建完成,特此记录! 今后可能会有陆续修正的地方。

你可能感兴趣的:(----MSSQL,High,Availability)