search
HomeDatabaseMysql Tutorial 基于Windows Server 2008 R2的WSFC实现 SQL Server 2012高可用性组(Always

两年前的《SQLServer2008R2数据库镜像部署》,今天再续前缘微软新一代数据库产品SQLServer2012已经面世一段时间了,不管从功能上讲还是性能上的体现,较之其早期

两年前的《SQL Server 2008 R2数据库镜像部署》,今天“再续前缘”——

微软新一代数据库产品SQL Server 2012已经面世一段时间了,不管从功能上讲还是性能上的体现,较之其早期产品都有了很大提升。特别是其引入高可用性组(AlwaysOn Group, AG)这一概念和功能,大大增强和提高了SQL Server的可用性,在之前的镜像数据库的基础上有了质的变化。

 SQL Server 2012高可用性组在实现过程中较之早起的SQL Server故障转移群集来讲,不依赖特别提供共享存储磁盘阵列,香港虚拟主机,每个节点独立存储一份数据库的副本。其较之早起的镜像数据库来讲,提供多节点高可用,并且针对数据库辅助节点副本可读;此外,在当前可读节点出现故障时,能通过AG自身的机制保证数据库正常访问,而不需要像之前的镜像数据库一样,需要通过访问端来进行切换。

因此,以下将对SQL Server 2012高可用性组的实现进行详细介绍。

一、具体的环境如下

在Windows域中,部署3台成员服务器用作SQL Server服务器,因为SQL Server 2012的高可用性组需要Windows的群集服务支持,所以必须预先在这些成员服务器上实现WSFC。服务器的操作系统均为Windows Server 2008 R2,因此其WSFC的仲裁配置有多数(奇数)节点、节点(偶数)和磁盘多数、多数节点(偶数)和文件共享、非多数:仅磁盘等4种。在此,为了体现SQL Server AG无需要各节点共享存储设备这一特性,准备使用3个节点实现。由于是奇数,所以选择多数节点仲裁配置。虽然这种仲裁配置不是被SQL Server 2012 AG推荐的,但是并不影响AG的实现和使用。

clip_image002

另外,由于本文着重讲述SQL Server 2012 AG的实现,所以对于服务器基本配置和网络设置,以及Windows活动目录和域的实现在此略去。

二、实现SQL Server 2012高可用性组必须的WSFC环境

首先在每台成员服务器上安装并配置WSFC,以配置SQL03为例:

1、安装WSFC群集组件

1)打开服务器管理器,选择“功能”,在右边窗口中点击“添加功能”。

clip_image004

2)在添加功能向导中,勾选“故障转移群集”,点击“下一步”。

clip_image006

3)在“确认安装选择”页面中,点击“安装”,进行安装操作。

clip_image008

4)完成并关闭“故障转移群集”的安装。

clip_image010

2、配置WSFC

为所有节点均安装完“故障转移群集”服务后,在任意节点服务器的“服务器管理器”中展开“故障转移群集管理器”对WSFC进行配置。

1)通过“故障转移群集管理器”窗口点击“创建一个群集”打开“创建群集向导”

clip_image012

2)在“开始之前”页中,点击“下一步”。

clip_image014

3)添加所有服务器节点,即将环境中的3台成员服务器添加为群集节点服务器。点击“下一步”。

clip_image016

4)在“验证警告”页面中,如果需要对基本环境(包括硬件)进行WSFC需求验证,可以选择“是”。在本示例中由于不必需进行验证,所以选择“否”。点击“下一步”。

clip_image018

5)定义“用于管理群集的访问点”,为群集进行名,并指定群集IP地址。点击“下一步”。

clip_image020

6)确认之前配置信息,若无误,点击“下一步”,开始群集创建。

clip_image022

7)完成群集创建,点击“完成”关闭向导。

clip_image024

8)在“故障转移群集管理器”会显示成功创建的群集,展开其“节点”,显示现有节点情况。

clip_image026

9)右击群集节点,在上下文菜单中点击“更多操作”,在扩展菜单中选择“配置群集仲裁设置”为该群集配置仲裁。

clip_image028

10)在“开始之前”页面中点击“下一步”。

clip_image030

11)根据此前的设计,由于是奇数节点,并且没有共享磁盘存储和共享文件夹存在,所以可以选择“多数节点”,点击“下一步”。

clip_image032

详细请参考:

12)在“确认”页面中,点击“下一步”。

clip_image034

13)完成WSFC的仲裁配置。

clip_image036

至此,为SQL Server 2012 AG准备的WSFC环境已经完成。

三、为各节点服务器安装并配置SQL Server 2012,以SQL03为例进行如下操作。

1、安装SQL Server 2012

1)在节点服务器上,插入SQL Server 2012安装介质。运行“SQL Server安装中心”,选择“安装”,点击“全新SQL Server独立安装或向现有安装添加功能”。

注意:这里不要选择“新的SQL Server故障转移群集安装”,香港空间,如果是故障转移群集安装的话最终将实现的是早起的SQL数据库群集,并且需要共享数据存储磁盘整列,导致所有SQL节点共享同一个数据存储副本。

clip_image038

2)使用安装程序支持规则验证是否通过。

clip_image040

3)指定产品密钥,或选择Evaluation版本。

clip_image042

4)接受许可协议

clip_image044

5)运行检查“安装程序支持规则”,验证SQL Server 2012运行环境是否符合要求。

clip_image046

与之前版本相同,需要对SQL Server必要的端口打开Windows防火墙的入站规则,比如TCP- 1433端口等。

特别注意:由于AG默认需要用到TCP-5022端口,所以该端口务必保证在Windows防火墙中开启,允许其入站访问。

6)设置SQL Server 2012服务器角色为“具有默认值的所有功能”,点击“下一步”。

clip_image048

7)在“功能选择”列表中选择实际所需功能,在此,为了简便不再进行自定义。直接使用默认选中组件。并且,需要指定相应的“共享功能目录”,即SQL Server的安装位置。

clip_image050

8)再次检查安装规则是否能正常执行通过。

clip_image052

9)选择并指定实例名,在此使用默认实例来进行示范,并且指定“实例根目录”。

clip_image054

10)检查磁盘空间要求是否达到SQL Server 2012的安装需求,点击“下一步”。

clip_image056

11)指定“服务账户”和“排序规则”,在此选择默认设置。如果需要在完成安装后进行自定义配置,点击“下一步”。

clip_image058

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
What are stored procedures in MySQL?What are stored procedures in MySQL?May 01, 2025 am 12:27 AM

Stored procedures are precompiled SQL statements in MySQL for improving performance and simplifying complex operations. 1. Improve performance: After the first compilation, subsequent calls do not need to be recompiled. 2. Improve security: Restrict data table access through permission control. 3. Simplify complex operations: combine multiple SQL statements to simplify application layer logic.

How does query caching work in MySQL?How does query caching work in MySQL?May 01, 2025 am 12:26 AM

The working principle of MySQL query cache is to store the results of SELECT query, and when the same query is executed again, the cached results are directly returned. 1) Query cache improves database reading performance and finds cached results through hash values. 2) Simple configuration, set query_cache_type and query_cache_size in MySQL configuration file. 3) Use the SQL_NO_CACHE keyword to disable the cache of specific queries. 4) In high-frequency update environments, query cache may cause performance bottlenecks and needs to be optimized for use through monitoring and adjustment of parameters.

What are the advantages of using MySQL over other relational databases?What are the advantages of using MySQL over other relational databases?May 01, 2025 am 12:18 AM

The reasons why MySQL is widely used in various projects include: 1. High performance and scalability, supporting multiple storage engines; 2. Easy to use and maintain, simple configuration and rich tools; 3. Rich ecosystem, attracting a large number of community and third-party tool support; 4. Cross-platform support, suitable for multiple operating systems.

How do you handle database upgrades in MySQL?How do you handle database upgrades in MySQL?Apr 30, 2025 am 12:28 AM

The steps for upgrading MySQL database include: 1. Backup the database, 2. Stop the current MySQL service, 3. Install the new version of MySQL, 4. Start the new version of MySQL service, 5. Recover the database. Compatibility issues are required during the upgrade process, and advanced tools such as PerconaToolkit can be used for testing and optimization.

What are the different backup strategies you can use for MySQL?What are the different backup strategies you can use for MySQL?Apr 30, 2025 am 12:28 AM

MySQL backup policies include logical backup, physical backup, incremental backup, replication-based backup, and cloud backup. 1. Logical backup uses mysqldump to export database structure and data, which is suitable for small databases and version migrations. 2. Physical backups are fast and comprehensive by copying data files, but require database consistency. 3. Incremental backup uses binary logging to record changes, which is suitable for large databases. 4. Replication-based backup reduces the impact on the production system by backing up from the server. 5. Cloud backups such as AmazonRDS provide automation solutions, but costs and control need to be considered. When selecting a policy, database size, downtime tolerance, recovery time, and recovery point goals should be considered.

What is MySQL clustering?What is MySQL clustering?Apr 30, 2025 am 12:28 AM

MySQLclusteringenhancesdatabaserobustnessandscalabilitybydistributingdataacrossmultiplenodes.ItusestheNDBenginefordatareplicationandfaulttolerance,ensuringhighavailability.Setupinvolvesconfiguringmanagement,data,andSQLnodes,withcarefulmonitoringandpe

How do you optimize database schema design for performance in MySQL?How do you optimize database schema design for performance in MySQL?Apr 30, 2025 am 12:27 AM

Optimizing database schema design in MySQL can improve performance through the following steps: 1. Index optimization: Create indexes on common query columns, balancing the overhead of query and inserting updates. 2. Table structure optimization: Reduce data redundancy through normalization or anti-normalization and improve access efficiency. 3. Data type selection: Use appropriate data types, such as INT instead of VARCHAR, to reduce storage space. 4. Partitioning and sub-table: For large data volumes, use partitioning and sub-table to disperse data to improve query and maintenance efficiency.

How can you optimize MySQL performance?How can you optimize MySQL performance?Apr 30, 2025 am 12:26 AM

TooptimizeMySQLperformance,followthesesteps:1)Implementproperindexingtospeedupqueries,2)UseEXPLAINtoanalyzeandoptimizequeryperformance,3)Adjustserverconfigurationsettingslikeinnodb_buffer_pool_sizeandmax_connections,4)Usepartitioningforlargetablestoi

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)