SQL Server代理服务无法启动

Ric*_*o-E 8 sql-server hyper-v docker windows-server-2016

我使用以下命令在Windows Server 2016虚拟机上的Docker容器中启动Windows SQL Server:

docker container run --name mssql-server --detach --publish 1433:1433 --memory 2048mb --volume C:\_Data:C:\_Data --env sa_password=myPassword --env ACCEPT_EULA=Y microsoft/mssql-server-windows-developer
Run Code Online (Sandbox Code Playgroud)

之后,我要使用以下命令启动SQL Agent:

docker container exec mssql-server cmd.exe /C "net start sqlserveragent"
Run Code Online (Sandbox Code Playgroud)

不幸的是我得到以下输出:

The SQL Server Agent (MSSQLSERVER) service is starting.
The SQL Server Agent (MSSQLSERVER) service could not be started.

The service did not report an error.

More help is available by typing NET HELPMSG 3534
Run Code Online (Sandbox Code Playgroud)

当我输入时,NET HELPMSG 3534我得到:

The service did not report an error.
Run Code Online (Sandbox Code Playgroud)

我完全没有主意。在我的本地计算机上,这可以正常工作,但是在构建服务器上却不能。

任何帮助表示赞赏。

编辑:我打开了SQL Server Management Studio,并注意到该SQL Server Agent (Agent XPs disabled)节点。因此,我遍历了https://www.mssqltips.com/sqlservertip/2729/how-to-start-sql-server-agent-when-agent-xps-show-disabled/中的所有内容。之后我执行了

exec sp_configure 'Agent XPs'
Run Code Online (Sandbox Code Playgroud)

结果是: 代理XP已明确启用

但是,当我尝试启动代理时,从上面得到了完全相同的错误消息(service ist startup ...服务无法启动...未报告错误)。

有趣的是,当我跑步时

exec sp_configure 'Agent XPs'
Run Code Online (Sandbox Code Playgroud)

再次,我得到这个: 代理XP被禁用

start-agent-command如何禁用Agent XP?

Edit2:我刚刚从https://community.spiceworks.com/topic/293771-sql-server-agent-agent-agent-xps-disabled-sql-server-2008上的评论中学到,代理在配置时自动配置此值。开始和停止。因此,我不应该手动启用它。

Edit3: 在Jeroen Mostert发表评论后,我调查了EventLog。我使用以下命令:

docker container exec mssql-server powershell.exe "Get-EventLog Application -Newest 100"
Run Code Online (Sandbox Code Playgroud)

这是来自应用程序日志的结果

Time         EntryType   Source                                  InstanceID Message                                                                                        
----         ---------   ------                                  ---------- -------                                                                                        
Jun 25 10:37 Information SQLSERVERAGENT                          1073741926 SQLServerAgent service successfully stopped.                                                   
Jun 25 10:37 Information MSSQLSERVER                             1073757281 Configuration option 'Agent XPs' changed from 1 to 0. Run the RECONFIGURE statement to install.
Jun 25 10:36 Information MSSQLSERVER                             1073757281 Configuration option 'Agent XPs' changed from 0 to 1. Run the RECONFIGURE statement to install.
Run Code Online (Sandbox Code Playgroud)

您可以看到,我已经手动启用了Agent XPs。然后我从上方运行命令以启动代理,这给了我接下来的两行

System-EventLog给了我:

Time         EntryType   Source                                   InstanceID Message                                                                                                                                                                                                                                                             
----         ---------   ------                                   ---------- -------                                                                                                                                                                                                                                                             
Jun 25 10:37 Information Service Control Manager                  1073748860 The SQL Server Agent (MSSQLSERVER) service entered the stopped state.                                                                                                                                                                                               
Run Code Online (Sandbox Code Playgroud)

编辑4: 根据Dan Guzman的评论:这是内容SQLAGENT.OUT

2019-07-09 11:03:44 - ? [000]
2019-07-09 11:03:44 - ? [098] SQLServerAgent terminated (normally)
Run Code Online (Sandbox Code Playgroud)

编辑5: 版本是(select @@version):

Microsoft SQL Server 2017 (RTM-CU3-GDR) (KB4052987) - 14.0.3015.40 (X64)   Dec 22 2017 16:13:22   Copyright (C) 2017 Microsoft Corporation  Developer Edition (64-bit) on Windows Server 2016 Datacenter 10.0 <X64> (Build 14393: ) (Hypervisor) 
Run Code Online (Sandbox Code Playgroud)

Ric*_*o-E 1

我的解决方案是将构建服务器升级到 Windows Server 2019。就是这样。然后一切正常,没有任何进一步的改变。