大网数据广告活动
数据库与应用安全

Error 41131 when creating availability group

· 52CE 我爱测

Provides resolutions for an issue where error 41131 occurs when you create an availability group in Microsoft SQL Server.

This article provides resolutions for an issue where error 41131 occurs when you create an availability group in Microsoft SQL Server.

Original product version: SQL Server
Original KB number: 2847723

Symptoms

When you try to create a high-availability group in Microsoft SQL Server, you receive the following error message:

Msg 41131, Level 16, State 0, Line 2
Failed to bring availability group 'availability_group' online. The operation timed out. Verify that the local Windows Server Failover Clustering (WSFC) node is online. Then verify that the availability group resource exists in the WSFC cluster. If the problem persists, you might need to drop the availability group and create it again.

Cause

This issue occurs if the [NT AUTHORITY\SYSTEM] account is missing from the SQL Server login or if the account lacks the necessary permissions to create the high-availability group.

Resolution

To resolve this issue, use one of the following methods:

Method 1: Use manual steps

  1. Create a login in SQL Server for the [NT AUTHORITY\SYSTEM] account on each SQL Server computer that hosts a replica in your availability group.

  2. Grant the [NT AUTHORITY\SYSTEM] account the following server-level permissions:

    • ALTER any availability group

    • Connect SQL

    • View server state

    [!NOTE] Make sure that no other permissions are granted to the account.

Method 2: Use script

  1. To create the [NT AUTHORITY\SYSTEM] account, run the following statement in a query window:

    USE [master]
    GO
    CREATE LOGIN [NT AUTHORITY\SYSTEM] FROM WINDOWS WITH DEFAULT_DATABASE=[master]
    GO
    
  2. To grant the permissions to the [NT AUTHORITY\SYSTEM] account, run the following statement in a query window:

    GRANT ALTER ANY AVAILABILITY GROUP TO [NT AUTHORITY\SYSTEM]
    GO
    GRANT CONNECT SQL TO [NT AUTHORITY\SYSTEM]
    GO
    GRANT VIEW SERVER STATE TO [NT AUTHORITY\SYSTEM]
    GO
    

More information

The [NT AUTHORITY\SYSTEM] account is used by SQL Server Always On health detection to connect to the SQL Server computer and to monitor health. When you create an availability group and the primary replica in the availability group comes online, health detection is initiated. If the [NT AUTHORITY\SYSTEM] account doesn't exist or have sufficient permissions, health detection can't be initiated, and the availability group can't come online during the creation process.

Make sure that these permissions exist on each SQL Server computer that could host the primary replica of the availability group.

Note: The Resource Host Monitor Service process (RHS.exe) that hosts SQL Resource.dll can be run only under a System account.

For more information, see Troubleshooting automatic failover problems in SQL Server Always On environments.

Source: Microsoft Learn / IT Pro troubleshooting by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / IT Pro troubleshooting
适用范围
See source applicability · Source date 05/31/2022
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。