我们前面3片文章介绍了SQL Server 2016 Failover Cluster+ ALwaysOn的完整配置,今天我们介绍一下如果给ALwaysOn增加多个客户端访问点,常规情况下,每个可用性组只有一个单独的可用性组侦听器(Listener),但是在某些极端情况下可能会对相同的可用性组创建多个侦听器。比如一些历史遗留问题。此时可能需要创建一个额外的侦听器用于硬编码。 但是,通过图形化界面(SSMS)、T-SQL甚至PowerShell都不能创建第二个侦听器,必须使用Failover Cluster Manager来实现。我们在我们的“SQLAG”角色内创建一个客户端接入点(Client Access Point)资源。按下面步骤: 我们打开故障转移群集管理器----角色---选择AG---增加资源--客户端访问点 ![Failover Cluster+ ALwaysOn](https://s4.51cto.com/images/blog/201801/11/3decba33c34ce8167b64ecc47db25571.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=) 我们就可以定义客户端访问点名称及对应的访问点IP ![Failover Cluster+ ALwaysOn](https://s4.51cto.com/images/blog/201801/11/b5cd9241af4023ab2ad68ca0b1f08db4.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=) 确认信息 ![Failover Cluster+ ALwaysOn](https://s4.51cto.com/images/blog/201801/11/6ee649a25fdcbf6879b582d5a3fd04d1.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=) 增加完成 ![Failover Cluster+ ALwaysOn](https://s4.51cto.com/images/blog/201801/11/c9c8496f95886e3131c49b6c569c7ec1.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=) 此时我们就可以在角色---AG下看见两个访问名称及IP地址 ![Failover Cluster+ ALwaysOn](https://s4.51cto.com/images/blog/201801/11/ad6c762672d5a919cfa8dbdd621015df.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=) 状态是部分运行中 ![Failover Cluster+ ALwaysOn](https://s4.51cto.com/images/blog/201801/11/623d3e35ac81b369d4186831c497e5be.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=) 我们资源---发现刚才新增加的是脱机状态 ![Failover Cluster+ ALwaysOn](https://s4.51cto.com/images/blog/201801/11/43288cb97059923dd607bcb9d83a21ef.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=) 此时我们右键新的客户端访问点并选择属性: ![Failover Cluster+ ALwaysOn](https://s4.51cto.com/images/blog/201801/11/8a2de85224d019a5a42375400b1eefcb.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=) 依赖关系 ![Failover Cluster+ ALwaysOn](https://s4.51cto.com/images/blog/201801/11/a9a297740470f37b797f3eb76cdd1f6d.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=) 选择之前的监听器 ![Failover Cluster+ ALwaysOn](https://s4.51cto.com/images/blog/201801/11/6b12411b780e03bfa2b918500d309ad4.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=) 我们右击联机即可 ![Failover Cluster+ ALwaysOn](https://s4.51cto.com/images/blog/201801/11/f15b9ef5b91fedb590e80b72bfbd9350.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=) 联机后,我们用这两个监听器地址都可以链接管理的 ![Failover Cluster+ ALwaysOn](https://s4.51cto.com/images/blog/201801/11/8ca1851baa59a9b0c3f9c189f012a961.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=)