Linux上SQL Server扩容内存后无法启动,SSL问题排查
问题:SQL Server添加内存重启后无法启动,出现SSL相关错误
我发现运行SQL Server实例的服务器只有12GB内存,于是关机添加内存后重启。但重启后SQL Server服务无法正常启动并保持运行状态,相关日志如下。这只是本地实例,我没给它装过SSL证书,搞不懂启动时为啥会出现SSL证书相关错误,求排查思路。
相关信息
1. mssql.conf配置内容
[sqlagent] enabled = false [licensing] azurebilling = false [EULA] accepteula = Y
2. 初始错误日志
2023-04-23 22:29:01.61 Server Microsoft SQL Server 2022 (RTM-CU3) (KB5024396) - 16.0.4025.1 (X64) Mar 13 2023 19:10:08 Copyright (C) 2022 Microsoft Corporation Developer Edition (64-bit) on Linux (Ubuntu 22.04.2 LTS) <X64> 2023-04-23 22:29:01.62 Server UTC adjustment: 0:00 2023-04-23 22:29:01.62 Server (c) Microsoft Corporation. 2023-04-23 22:29:01.62 Server All rights reserved. 2023-04-23 22:29:01.62 Server Server process ID is 556. 2023-04-23 22:29:01.62 Server Logging SQL Server messages in file '/var/opt/mssql/log/errorlog'. 2023-04-23 22:29:01.63 Server Registry startup parameters: -d /var/opt/mssql/data/master.mdf -l /var/opt/mssql/data/mastlog.ldf -e /var/opt/mssql/log/errorlog 2023-04-23 22:29:01.64 Server SQL Server detected 2 sockets with 4 cores per socket and 8 logical processors per socket, 16 total logical processors; using 16 logical processors based on SQL Server licensing. This is an informational message; no user action is required. 2023-04-23 22:29:01.64 Server SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required. 2023-04-23 22:29:01.65 Server Detected 19259 MB of RAM. This is an informational message; no user action is required. 2023-04-23 22:29:01.65 Server Using conventional memory in the memory manager. 2023-04-23 22:29:01.65 Server Detected pause instruction latency: 24 cycles. 2023-04-23 22:29:01.67 Server Page exclusion bitmap is enabled. 2023-04-23 22:29:01.72 Server Buffer pool extension is not supported on Linux platform. 2023-04-23 22:29:01.74 Server Buffer Pool: Allocating 4194304 bytes for 2985785 hashPages. 2023-04-23 22:29:01.97 Server Buffer pool extension is already disabled. No action is necessary. 2023-04-23 22:29:02.64 Server Installing Client TLS certificates to the store. 2023-04-23 22:29:02.65 Server Error searching first file in /var/opt/mssql/security/ca-certificates: 3(The system cannot find the path specified.)
3. ls /var/opt/mssql命令输出
data log mssql.conf secrets
更新记录
更新1
我按照官方指南创建了自签名证书并放到/var/opt/mssql/security/ca-certificates目录,但还是出现同样的错误。
更新2
现在日志显示已成功读取SSL证书,但服务还是无法启动,且errorlog文件没有后续错误信息,当前日志如下:
2023-04-25 12:16:25.08 Server Microsoft SQL Server 2022 (RTM-CU3) (KB5024396) - 16.0.4025.1 (X64) Mar 13 2023 19:10:08 Copyright (C) 2022 Microsoft Corporation Express Edition (64-bit) on Linux (Ubuntu 22.04.2 LTS) <X64> 2023-04-25 12:16:25.08 Server UTC adjustment: 0:00 2023-04-25 12:16:25.08 Server (c) Microsoft Corporation. 2023-04-25 12:16:25.08 Server All rights reserved. 2023-04-25 12:16:25.09 Server Server process ID is 556. 2023-04-25 12:16:25.09 Server Logging SQL Server messages in file '/var/opt/mssql/log/errorlog'. 2023-04-25 12:16:25.09 Server Registry startup parameters: -d /var/opt/mssql/data/master.mdf -l /var/opt/mssql/data/mastlog.ldf -e /var/opt/mssql/log/errorlog 2023-04-25 12:16:25.10 Server SQL Server detected 2 sockets with 4 cores per socket and 8 logical processors per socket, 16 total logical processors; using 8 logical processors based on SQL Server licensing. This is an informational message; no user action is required. 2023-04-25 12:16:25.10 Server SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required. 2023-04-25 12:16:25.11 Server Detected 19259 MB of RAM. This is an informational message; no user action is required. 2023-04-25 12:16:25.11 Server Using conventional memory in the memory manager. 2023-04-25 12:16:25.11 Server Detected pause instruction latency: 24 cycles. 2023-04-25 12:16:25.11 Server Page exclusion bitmap is enabled. 2023-04-25 12:16:25.15 Server Buffer pool extension is not supported on Linux platform. 2023-04-25 12:16:25.16 Server Buffer Pool: Allocating 4194304 bytes for 2984885 hashPages. 2023-04-25 12:16:25.37 Server Buffer pool extension is already disabled. No action is necessary. 2023-04-25 12:16:26.04 Server Installing Client TLS certificates to the store. 2023-04-25 12:16:26.06 Server Successfully placed mssql.crt in trusted root store 2023-04-25 12:16:26.06 Server Number of Files Processed in /var/opt/mssql/security/ca-certificates directory: 1
排查思路
- 权限检查:确认
/var/opt/mssql/security及子目录、证书文件的权限,必须让mssql用户拥有读写权限,执行命令:sudo chown -R mssql:mssql /var/opt/mssql/security sudo chmod -R 700 /var/opt/mssql/security - 强制禁用SSL尝试:既然是本地实例,直接在
mssql.conf末尾添加SSL禁用配置,再重启服务:
执行重启命令:[network] forceencryption = 0sudo systemctl restart mssql-server - 查看系统日志:SQL Server的errorlog无后续信息,直接查系统服务日志找线索:
sudo journalctl -u mssql-server --since "10 minutes ago" - 验证数据文件完整性:添加内存的硬件操作可能导致磁盘文件损坏,用单用户模式启动看详细报错:
sudo /opt/mssql/bin/sqlservr -c -m - 版本兼容性检查:确认Ubuntu 22.04和SQL Server 2022 CU3的兼容性,必要时升级到最新累积更新包。
内容的提问来源于stack exchange,提问作者Devin Gardner
相关产品推荐
相关产品推荐

