search
HomeDatabaseMysql TutorialSqlserver2012 alwayson部署攻略

一、环境。 1、服务器:准备 4 台虚拟机。 2、操作系统: windows2008R2SP2 或者以上版本。 3、数据库: Sqlserver2012 。 二、操作系统安装及设置。 4 、在 4 台虚拟机上均装上操作系统 windows2008R2, 并分别设置计算机名为 :DomainServer 、 DB1 、 DB2

一、环境。

1、服务器:准备4台虚拟机。

2、操作系统:windows2008 R2 SP2或者以上版本。

3、数据库:Sqlserver 2012

 

二、操作系统安装及设置。

4、在4台虚拟机上均装上操作系统windows 2008 R2,并分别设置计算机名为:DomainServerDB1DB2DB3,分别设置IP192.168.100.20192.168.100.21192.168.100.22192.168.100.23

5、在DB1DB2DB3上开启功能.NET3.5 SP1

6、在DB1DB2DB3上安装Sqlserver2012

7、在DomainServer服务器上建立域服务alwayson.com、并将DB1DB2DB3DNS设置为192.168.100.20,然后加如域alwayson.com

 

三、windows2008故障转移群集部署。

8、以alwayson.com\administrator域帐户登录DB1DB2DB3,并添加故障转移集群功能。

9、在DB1DB2DB3中任一台机上创建群集,并将DB1DB2DB3台服务器添加进去、群集名称为alwaysoncluster,群集IP192.168.100.25,仲裁配置为“多数节点”。

 

四、alwayson部署。

10、关闭DB1DB2DB3的防火墙或者在防火墙规则中添加例外端口14335022

11、分别打开DB1DB2DB3“SQL Server 配置管理器,在左侧的“SQL Server 服务列表中找到默认的实例,并开启alwayson功能

Sqlserver2012 alwayson部署攻略

12、将Sqlserver服务的登录帐户更改为域帐户alwayson.com\administrator,并重启sqlserver服务。

13、分别使用数据库管理工具连接DB1DB2DB3的数据库,并创建sqlserver的域登录帐户alwayson.com\administrator,并赋予sysadmin角色。

14、在DB1DB2DB3的分别建立目录D:\SQLDATA用于存放sql数据库文件,在局域网内建立一个可读写共享目录,该共享目录用于存放快照文件。要消除单点故障,可考虑将该共享存放在DFS共享上。

15、在DB1上新建数据库,数据文件存放在上面的新建文件夹D:\sqldata下,并做一次完整备份,要使用alwayson的数据库必须先完备一次。

16、以域管理员帐户登录DB1、打开“Sql Server Management Studio”,展开“alwayson高可用性”,并新建alwayson可用性组,命名为alwayson

17、选择刚刚完备过的数据库。

18、在指定副本中添加DB1DB2DB3,其中DB1为主,DB2DB3为辅;DB1DB2为自动故障转移,同步提交,DB3不是自动故障转移且为异步提交,DB1DB2DB3均为可读辅助副本。

 Sqlserver2012 alwayson部署攻略

 

19、选择数据同步中选择完整,并填入用于存放快照的共享文件夹位置,然后直接下一步直至alwayson部署完成。

20、添加侦听器,在添加可用性组的地方选择添加侦听器,名称为alwaysonconn,IP192.168.100.25,端口为1433,此连接用于程序连接,此伪IP信息始终在主数据库服务器上,若使用集群伪IP192.168.100.24会出现该IP不在主数据库服务器上的错误。

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
How to Grant Permissions to New MySQL UsersHow to Grant Permissions to New MySQL UsersMay 09, 2025 am 12:16 AM

TograntpermissionstonewMySQLusers,followthesesteps:1)AccessMySQLasauserwithsufficientprivileges,2)CreateanewuserwiththeCREATEUSERcommand,3)UsetheGRANTcommandtospecifypermissionslikeSELECT,INSERT,UPDATE,orALLPRIVILEGESonspecificdatabasesortables,and4)

How to Add Users in MySQL: A Step-by-Step GuideHow to Add Users in MySQL: A Step-by-Step GuideMay 09, 2025 am 12:14 AM

ToaddusersinMySQLeffectivelyandsecurely,followthesesteps:1)UsetheCREATEUSERstatementtoaddanewuser,specifyingthehostandastrongpassword.2)GrantnecessaryprivilegesusingtheGRANTstatement,adheringtotheprincipleofleastprivilege.3)Implementsecuritymeasuresl

MySQL: Adding a new user with complex permissionsMySQL: Adding a new user with complex permissionsMay 09, 2025 am 12:09 AM

ToaddanewuserwithcomplexpermissionsinMySQL,followthesesteps:1)CreatetheuserwithCREATEUSER'newuser'@'localhost'IDENTIFIEDBY'password';.2)Grantreadaccesstoalltablesin'mydatabase'withGRANTSELECTONmydatabase.TO'newuser'@'localhost';.3)Grantwriteaccessto'

MySQL: String Data Types and CollationsMySQL: String Data Types and CollationsMay 09, 2025 am 12:08 AM

The string data types in MySQL include CHAR, VARCHAR, BINARY, VARBINARY, BLOB, and TEXT. The collations determine the comparison and sorting of strings. 1.CHAR is suitable for fixed-length strings, VARCHAR is suitable for variable-length strings. 2.BINARY and VARBINARY are used for binary data, and BLOB and TEXT are used for large object data. 3. Sorting rules such as utf8mb4_unicode_ci ignores upper and lower case and is suitable for user names; utf8mb4_bin is case sensitive and is suitable for fields that require precise comparison.

MySQL: What length should I use for VARCHARs?MySQL: What length should I use for VARCHARs?May 09, 2025 am 12:06 AM

The best MySQLVARCHAR column length selection should be based on data analysis, consider future growth, evaluate performance impacts, and character set requirements. 1) Analyze the data to determine typical lengths; 2) Reserve future expansion space; 3) Pay attention to the impact of large lengths on performance; 4) Consider the impact of character sets on storage. Through these steps, the efficiency and scalability of the database can be optimized.

MySQL BLOB : are there any limits?MySQL BLOB : are there any limits?May 08, 2025 am 12:22 AM

MySQLBLOBshavelimits:TINYBLOB(255bytes),BLOB(65,535bytes),MEDIUMBLOB(16,777,215bytes),andLONGBLOB(4,294,967,295bytes).TouseBLOBseffectively:1)ConsiderperformanceimpactsandstorelargeBLOBsexternally;2)Managebackupsandreplicationcarefully;3)Usepathsinst

MySQL : What are the best tools to automate users creation?MySQL : What are the best tools to automate users creation?May 08, 2025 am 12:22 AM

The best tools and technologies for automating the creation of users in MySQL include: 1. MySQLWorkbench, suitable for small to medium-sized environments, easy to use but high resource consumption; 2. Ansible, suitable for multi-server environments, simple but steep learning curve; 3. Custom Python scripts, flexible but need to ensure script security; 4. Puppet and Chef, suitable for large-scale environments, complex but scalable. Scale, learning curve and integration needs should be considered when choosing.

MySQL: Can I search inside a blob?MySQL: Can I search inside a blob?May 08, 2025 am 12:20 AM

Yes,youcansearchinsideaBLOBinMySQLusingspecifictechniques.1)ConverttheBLOBtoaUTF-8stringwithCONVERTfunctionandsearchusingLIKE.2)ForcompressedBLOBs,useUNCOMPRESSbeforeconversion.3)Considerperformanceimpactsanddataencoding.4)Forcomplexdata,externalproc

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

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.