使用 mssql-conf 工具配置 Linux 上的 SQL ServerConfigure SQL Server on Linux with the mssql-conf tool

适用于:Applies to: 是SQL ServerSQL Server(所有支持的版本)yesSQL ServerSQL Server (all supported versions) - Linux适用于:Applies to: 是SQL ServerSQL Server(所有支持的版本)yesSQL ServerSQL Server (all supported versions) - Linux

mssql-conf 是随 SQL Server 2017 for Red Hat Enterprise Linux、SUSE Linux Enterprise Server 和 Ubuntu 安装的配置脚本。mssql-conf is a configuration script that installs with SQL Server 2017 for Red Hat Enterprise Linux, SUSE Linux Enterprise Server, and Ubuntu. 它会修改存储配置值的 mssql.conf 文件It modifies the mssql.conf file where configuration values are stored. 可使用 mssql-conf 实用工具设置以下参数:You can use mssql-conf utility to set the following parameters:

参数Parameter 描述Description
代理Agent 启用 SQL Server 代理。Enable SQL Server Agent.
排序规则Collation 为 Linux 上的 SQL Server 设置新排序规则。Set a new collation for SQL Server on Linux.
客户反馈Customer feedback 选择 SQL Server 是否向 Microsoft 发送反馈。Choose whether or not SQL Server sends feedback to Microsoft.
数据库邮件配置文件Database Mail Profile 为 Linux 上的 SQL Server 设置默认数据库邮件配置文件。Set the default database mail profile for SQL Server on Linux.
默认数据目录Default data directory 更改新 SQL Server 数据库数据文件 (.mdf) 的默认目录。Change the default directory for new SQL Server database data files (.mdf).
默认日志目录Default log directory 更改新 SQL Server 数据库日志 (.ldf) 文件的默认目录。Changes the default directory for new SQL Server database log (.ldf) files.
默认 master 数据库目录Default master database directory 更改 master 数据库和日志文件的默认目录。Changes the default directory for the master database and log files.
默认 master 数据库文件名Default master database file name 更改 master 数据库文件的名称。Changes the name of master database files.
默认转储目录Default dump directory 更改新内存转储和其他故障诊断文件的默认目录。Change the default directory for new memory dumps and other troubleshooting files.
默认错误日志目录Default error log directory 更改新 SQL Server 错误日志、默认探查器跟踪、系统健康状况会话 XE 和 Hekaton 会话 XE 文件的默认目录。Changes the default directory for new SQL Server ErrorLog, Default Profiler Trace, System Health Session XE, and Hekaton Session XE files.
默认备份目录Default backup directory 更改新备份文件的默认目录。Change the default directory for new backup files.
转储类型Dump type 选择要收集的转储内存转储文件的类型。Choose the type of dump memory dump file to collect.
高可用性High availability 启用可用性组。Enable Availability Groups.
本地审核目录Local Audit directory 设置目录以添加本地审核文件。Set a directory to add Local Audit files.
区域设置Locale 设置 SQL Server 要使用的区域设置。Set the locale for SQL Server to use.
内存限制Memory limit 设置 SQL Server 的内存限制。Set the memory limit for SQL Server.
网络设置Network settings SQL Server 的其他网络设置。Additional network settings for SQL Server.
Microsoft 分布式事务处理协调器Microsoft Distributed Transaction Coordinator 在 Linux 上配置 MSDTC 并对其进行故障排除。Configure and troubleshoot MSDTC on Linux.
TCP 端口TCP port 更改 SQL Server 侦听连接的端口。Change the port where SQL Server listens for connections.
TLSTLS 配置传输级别安全性。Configure Transport Level Security.
跟踪标志Traceflags 设置服务要使用的跟踪标志。Set the traceflags that the service is going to use.

mssql-conf 是随 SQL Server 2019 (15.x)SQL Server 2019 (15.x) for Red Hat Enterprise Linux、SUSE Linux Enterprise Server 和 Ubuntu 安装的配置脚本。mssql-conf is a configuration script that installs with SQL Server 2019 (15.x)SQL Server 2019 (15.x) for Red Hat Enterprise Linux, SUSE Linux Enterprise Server, and Ubuntu. 可以使用此实用工具设置以下参数:You can use this utility to set the following parameters:

参数Parameter 描述Description
代理Agent 启用 SQL Server 代理Enable SQL Server Agent
排序规则Collation 为 Linux 上的 SQL Server 设置新排序规则。Set a new collation for SQL Server on Linux.
客户反馈Customer feedback 选择 SQL Server 是否向 Microsoft 发送反馈。Choose whether or not SQL Server sends feedback to Microsoft.
数据库邮件配置文件Database Mail Profile 为 Linux 上的 SQL Server 设置默认数据库邮件配置文件。Set the default database mail profile for SQL Server on Linux.
默认数据目录Default data directory 更改新 SQL Server 数据库数据文件 (.mdf) 的默认目录。Change the default directory for new SQL Server database data files (.mdf).
默认日志目录Default log directory 更改新 SQL Server 数据库日志 (.ldf) 文件的默认目录。Changes the default directory for new SQL Server database log (.ldf) files.
默认 master 数据库文件目录Default master database file directory 更改现有 SQL 安装中 master 数据库文件的默认目录。Changes the default directory for the master database files on existing SQL installation.
默认 master 数据库文件名Default master database file name 更改 master 数据库文件的名称。Changes the name of master database files.
默认转储目录Default dump directory 更改新内存转储和其他故障诊断文件的默认目录。Change the default directory for new memory dumps and other troubleshooting files.
默认错误日志目录Default error log directory 更改新 SQL Server 错误日志、默认探查器跟踪、系统健康状况会话 XE 和 Hekaton 会话 XE 文件的默认目录。Changes the default directory for new SQL Server ErrorLog, Default Profiler Trace, System Health Session XE, and Hekaton Session XE files.
默认备份目录Default backup directory 更改新备份文件的默认目录。Change the default directory for new backup files.
转储类型Dump type 选择要收集的转储内存转储文件的类型。Choose the type of dump memory dump file to collect.
高可用性High availability 启用可用性组。Enable Availability Groups.
本地审核目录Local Audit directory 设置目录以添加本地审核文件。Set a directory to add Local Audit files.
区域设置Locale 设置 SQL Server 要使用的区域设置。Set the locale for SQL Server to use.
内存限制Memory limit 设置 SQL Server 的内存限制。Set the memory limit for SQL Server.
Microsoft 分布式事务处理协调器Microsoft Distributed Transaction Coordinator 在 Linux 上配置 MSDTC 并对其进行故障排除。Configure and troubleshoot MSDTC on Linux.
MLServices EULAMLServices EULAs 对于 mlservices 包,接受 R 和 Python EULA。Accept R and Python EULAs for mlservices packages. 仅适用于 SQL Server 2019。Applies to SQL Server 2019 only.
网络设置Network settings SQL Server 的其他网络设置。Additional network settings for SQL Server.
outboundnetworkaccessoutboundnetworkaccess mlservices R、Python 和 Java 扩展启用出站网络访问。Enable outbound network access for mlservices R, Python, and Java extensions.
TCP 端口TCP port 更改 SQL Server 侦听连接的端口。Change the port where SQL Server listens for connections.
TLSTLS 配置传输级别安全性。Configure Transport Level Security.
跟踪标志Traceflags 设置服务要使用的跟踪标志。Set the traceflags that the service is going to use.

提示

还可以使用环境变量配置其中某些设置。Some of these settings can also be configured with environment variables. 有关详细信息,请参阅使用环境变量配置 SQL Server 设置For more information, see Configure SQL Server settings with environment variables.

使用提示Usage tips

  • 对于 Always On 可用性组和共享磁盘群集,始终在每个节点上进行相同的配置更改。For Always On Availability Groups and shared disk clusters, always make the same configuration changes on each node.

  • 对于共享磁盘群集方案,请勿尝试重新启动 mssql-server 服务以应用更改。For the shared disk cluster scenario, do not attempt to restart the mssql-server service to apply changes. SQL Server 作为应用程序运行。SQL Server is running as an application. 应将资源脱机,然后重新联机。Instead, take the resource offline and then back online.

  • 这些示例通过指定完整路径 /opt/mssql/bin/mssql-conf 来运行 mssql-conf。These examples run mssql-conf by specifying the full path: /opt/mssql/bin/mssql-conf. 如果选择改为导航到该路径,请在当前目录 ./mssql-conf 的上下文中运行 mssql-conf。If you choose to navigate to that path instead, run mssql-conf in the context of the current directory: ./mssql-conf.

启用 SQL Server 代理Enable SQL Server Agent

使用 sqlagent.enabled 设置可启用 SQL Server 代理The sqlagent.enabled setting enables SQL Server Agent. 默认情况下,SQL Server 代理处于禁用状态。By default, SQL Server Agent is disabled. 如果 mssql.conf 设置文件中不存在 sqlagent.enabled,则 SQL Server 在内部假定已禁用 SQL Server 代理。If sqlagent.enabled is not present in the mssql.conf settings file, then SQL Server internally assumes that SQL Server Agent is disabled.

若要更改此设置,请使用以下步骤:To change this setting, use the following steps:

  1. 启用 SQL Server 代理:Enable the SQL Server Agent:

    sudo /opt/mssql/bin/mssql-conf set sqlagent.enabled true 
    
  2. 重启 SQL Server 服务:Restart the SQL Server service:

    sudo systemctl restart mssql-server
    

为 Linux 上的 SQL Server 设置默认数据库邮件配置文件Set the default database mail profile for SQL Server on Linux

通过 sqlpagent.databasemailprofile 可为电子邮件警报设置默认的 DB 邮件配置文件。The sqlpagent.databasemailprofile allows you to set the default DB Mail profile for email alerts.

sudo /opt/mssql/bin/mssql-conf set sqlagent.databasemailprofile <profile_name>

SQL 代理错误日志SQL Agent error logs

sqlpagent.errorlogfile 和 sqlpagent.errorlogginglevel 设置允许你分别设置 SQL 代理日志文件路径和日志记录级别。The sqlpagent.errorlogfile and sqlpagent.errorlogginglevel settings allows you to set the SQL Agent log file path and logging level respectively.

sudo /opt/mssql/bin/mssql-conf set sqlagent.errorfile <path>

SQL 代理日志记录级别是位掩码值,等于:SQL Agent logging levels are bitmask values that equal:

  • 1 = 错误1 = Errors
  • 2 = 警告2 = Warnings
  • 4 = 信息4 = Info

如果要捕获所有级别,请使用 7 作为值。If you want to capture all levels, use 7 as the value.

sudo /opt/mssql/bin/mssql-conf set sqlagent.errorlogginglevel <level>

更改 SQL Server 排序规则Change the SQL Server collation

使用 set-collation 选项可将排序规则值更改为支持的任何排序规则。The set-collation option changes the collation value to any of the supported collations.

  1. 首先,备份服务器上的所有用户数据库First backup any user databases on your server.

  2. 然后,使用 sp_detach_db 存储过程分离用户数据库。Then use the sp_detach_db stored procedure to detach the user databases.

  3. 运行 set-collation 选项并按照提示进行操作:Run the set-collation option and follow the prompts:

    sudo /opt/mssql/bin/mssql-conf set-collation
    
  4. mssql-conf 实用工具会尝试更改为指定的排序规则值并重新启动该服务。The mssql-conf utility will attempt to change to the specified collation value and restart the service. 如果出现任何错误,它会将排序规则回滚到前一个值。If there are any errors, it rolls back the collation to the previous value.

  5. 还原用户数据库备份。Restore your user database backups.

若要获取支持的排序规则的列表,请运行 sys.fn_helpcollations 函数:SELECT Name from sys.fn_helpcollations()For a list of supported collations, run the sys.fn_helpcollations function: SELECT Name from sys.fn_helpcollations().

配置客户反馈Configure customer feedback

使用 telemetry.customerfeedback 设置可更改 SQL Server 是否向 Microsoft 发送反馈。The telemetry.customerfeedback setting changes whether SQL Server sends feedback to Microsoft or not. 默认情况下,对于所有版本,此值设置为“true”。By default, this value is set to true for all editions. 若要更改该值,请运行以下命令:To change the value, run the following commands:

重要

无法关闭 SQL Server、Express 和 Developer 免费版本的客户反馈。You can not turn off customer feedback for free editions of SQL Server, Express and Developer.

  1. 使用 telemetry.customerfeedbackset 命令以根身份运行 mssql-conf 脚本。Run the mssql-conf script as root with the set command for telemetry.customerfeedback. 以下示例通过指定 false 来关闭客户反馈。The following example turns off customer feedback by specifying false.

    sudo /opt/mssql/bin/mssql-conf set telemetry.customerfeedback false
    
  2. 重启 SQL Server 服务:Restart the SQL Server service:

    sudo systemctl restart mssql-server
    

有关详细信息,请参阅 Linux 上的 SQL Server 的客户反馈SQL Server 隐私声明For more information, see Customer Feedback for SQL Server on Linux and the SQL Server Privacy Statement.

更改默认数据或日志目录位置Change the default data or log directory location

使用 filelocation.defaultdatadir 和 filelocation.defaultlogdir 设置可更改创建新数据库和日志文件的位置 。The filelocation.defaultdatadir and filelocation.defaultlogdir settings change the location where the new database and log files are created. 默认情况下,此位置为 /var/opt/mssql/data。By default, this location is /var/opt/mssql/data. 若要更改这些设置,请使用以下步骤:To change these settings, use the following steps:

  1. 为新的数据库数据和日志文件创建目标目录。Create the target directory for new database data and log files. 以下示例创建一个新的 /tmp/data 目录:The following example creates a new /tmp/data directory:

    sudo mkdir /tmp/data
    
  2. 将目录的所有者和组更改为 mssql 用户:Change the owner and group of the directory to the mssql user:

    sudo chown mssql /tmp/data
    sudo chgrp mssql /tmp/data
    
  3. 使用 mssql-conf 通过 set 命令更改默认数据目录:Use mssql-conf to change the default data directory with the set command:

    sudo /opt/mssql/bin/mssql-conf set filelocation.defaultdatadir /tmp/data
    
  4. 重启 SQL Server 服务:Restart the SQL Server service:

    sudo systemctl restart mssql-server
    
  5. 现在,为新数据库创建的所有数据库文件都将存储在此新位置。Now all the database files for the new databases created will be stored in this new location. 如果要更改新数据库的日志文件 (.ldf) 位置,可以使用下面的“set”命令:If you would like to change the location of the log (.ldf) files of the new databases, you can use the following "set" command:

    sudo /opt/mssql/bin/mssql-conf set filelocation.defaultlogdir /tmp/log
    
  6. 此命令还假定存在 /tmp/log 目录,并且它位于用户和组“mssql”下。This command also assumes that a /tmp/log directory exists, and that it is under the user and group mssql.

更改默认的 master 数据库文件目录位置Change the default master database file directory location

使用 filelocation.masterdatafile 和 filelocation.masterlogfile 设置可更改 SQL Server 引擎查找 master 数据库文件的位置 。The filelocation.masterdatafile and filelocation.masterlogfile setting changes the location where the SQL Server engine looks for the master database files. 默认情况下,此位置为 /var/opt/mssql/data。By default, this location is /var/opt/mssql/data.

若要更改这些设置,请使用以下步骤:To change these settings, use the following steps:

  1. 为新的错误日志文件创建目标目录。Create the target directory for new error log files. 以下示例创建一个新的 /tmp/masterdatabasedir 目录:The following example creates a new /tmp/masterdatabasedir directory:

    sudo mkdir /tmp/masterdatabasedir
    
  2. 将目录的所有者和组更改为 mssql 用户:Change the owner and group of the directory to the mssql user:

    sudo chown mssql /tmp/masterdatabasedir
    sudo chgrp mssql /tmp/masterdatabasedir
    
  3. 使用 mssql-conf 通过 set 命令更改主数据和日志文件的默认 master 数据库目录:Use mssql-conf to change the default master database directory for the master data and log files with the set command:

    sudo /opt/mssql/bin/mssql-conf set filelocation.masterdatafile /tmp/masterdatabasedir/master.mdf
    sudo /opt/mssql/bin/mssql-conf set filelocation.masterlogfile /tmp/masterdatabasedir/mastlog.ldf
    

    备注

    除了移动主数据和日志文件外,此操作还将移动所有其他系统数据库的默认位置。In addition to moving the master data and log files, this also moves the default location for all other system databases.

  4. 停止 SQL Server 服务:Stop the SQL Server service:

    sudo systemctl stop mssql-server
    
  5. 移动 master.mdf 和 masterlog.ldf:Move the master.mdf and masterlog.ldf:

    sudo mv /var/opt/mssql/data/master.mdf /tmp/masterdatabasedir/master.mdf 
    sudo mv /var/opt/mssql/data/mastlog.ldf /tmp/masterdatabasedir/mastlog.ldf
    
  6. 启动 SQL Server 服务:Start the SQL Server service:

    sudo systemctl start mssql-server
    

    备注

    如果 SQL Server 在指定目录中找不到 master.mdf 和 mastlog.ldf 文件,将在指定目录中自动创建系统数据库的模板化副本,并且 SQL Server 将成功启动。If SQL Server cannot find master.mdf and mastlog.ldf files in the specified directory, a templated copy of the system databases will be automatically created in the specified directory, and SQL Server will successfully start up. 但是,诸如用户数据库、服务器登录名、服务器证书、加密密钥、SQL 代理作业或旧 SA 登录密码等元数据将不会在新 master 数据库中更新。However, metadata such as user databases, server logins, server certificates, encryption keys, SQL agent jobs, or old SA login password will not be updated in the new master database. 必须停止 SQL Server 并将旧的 master.mdf 和 mastlog.ldf 移动到新的指定位置,然后启动 SQL Server 以继续使用现有元数据。You will have to stop SQL Server and move your old master.mdf and mastlog.ldf to the new specified location and start SQL Server to continue using the existing metadata.

更改 master 数据库文件的名称Change the name of master database files

使用 filelocation.masterdatafile 和 filelocation.masterlogfile 设置可更改 SQL Server 引擎查找 master 数据库文件的位置 。The filelocation.masterdatafile and filelocation.masterlogfile setting changes the location where the SQL Server engine looks for the master database files. 还可以使用它来更改 master 数据库和日志文件的名称。You can also use this to change the name of the master database and log files.

若要更改这些设置,请使用以下步骤:To change these settings, use the following steps:

  1. 停止 SQL Server 服务:Stop the SQL Server service:

    sudo systemctl stop mssql-server
    
  2. 使用 mssql-conf 通过 set 命令更改主数据和日志文件的预期 master 数据库名称:Use mssql-conf to change the expected master database names for the master data and log files with the set command:

    sudo /opt/mssql/bin/mssql-conf set filelocation.masterdatafile /var/opt/mssql/data/masternew.mdf
    sudo /opt/mssql/bin/mssql-conf set filelocation.mastlogfile /var/opt/mssql/data/mastlognew.ldf
    

    重要

    只能在 SQL Server 成功启动后更改 master 数据库和日志文件的名称。You can only change the name of the master database and log files after SQL Server has started successfully. 在初始运行之前,SQL Server 需要命名为 master.mdf 和 mastlog.ldf 的文件。Before the initial run, SQL Server expects the files to be named master.mdf and mastlog.ldf.

  3. 更改 master 数据库数据和日志文件的名称Change the name of the master database data and log files

    sudo mv /var/opt/mssql/data/master.mdf /var/opt/mssql/data/masternew.mdf
    sudo mv /var/opt/mssql/data/mastlog.ldf /var/opt/mssql/data/mastlognew.ldf
    
  4. 启动 SQL Server 服务:Start the SQL Server service:

    sudo systemctl start mssql-server
    

更改默认转储目录位置Change the default dump directory location

使用 filelocation.defaultdumpdir 设置可更改每当系统崩溃时生成内存和 SQL 转储的默认位置。The filelocation.defaultdumpdir setting changes the default location where the memory and SQL dumps are generated whenever there is a crash. 默认情况下,这些文件在 /var/opt/mssql/log 中生成。By default, these files are generated in /var/opt/mssql/log.

若要设置新位置,请使用以下命令:To set up this new location, use the following commands:

  1. 为新的转储文件创建目标目录。Create the target directory for new dump files. 以下示例创建一个新的 /tmp/dump 目录:The following example creates a new /tmp/dump directory:

    sudo mkdir /tmp/dump
    
  2. 将目录的所有者和组更改为 mssql 用户:Change the owner and group of the directory to the mssql user:

    sudo chown mssql /tmp/dump
    sudo chgrp mssql /tmp/dump
    
  3. 使用 mssql-conf 通过 set 命令更改默认数据目录:Use mssql-conf to change the default data directory with the set command:

    sudo /opt/mssql/bin/mssql-conf set filelocation.defaultdumpdir /tmp/dump
    
  4. 重启 SQL Server 服务:Restart the SQL Server service:

    sudo systemctl restart mssql-server
    

更改默认的错误日志文件目录位置Change the default error log file directory location

使用 filelocation.errorlogfile 设置可更改创建新错误日志、默认探查器跟踪、系统健康状况会话 XE 和 Hekaton 会话 XE 文件的位置。The filelocation.errorlogfile setting changes the location where the new error log, default profiler trace, system health session XE and Hekaton session XE files are created. 默认情况下,此位置为 /var/opt/mssql/log。By default, this location is /var/opt/mssql/log. 设置用于 SQL 错误日志文件的目录将成为其他日志的默认日志目录。The directory in which SQL errorlog file is set becomes the default log directory for other logs.

若要更改这些设置,请执行以下操作:To change these settings:

  1. 为新的错误日志文件创建目标目录。Create the target directory for new error log files. 以下示例创建一个新的 /tmp/logs 目录:The following example creates a new /tmp/logs directory:

    sudo mkdir /tmp/logs
    
  2. 将目录的所有者和组更改为 mssql 用户:Change the owner and group of the directory to the mssql user:

    sudo chown mssql /tmp/logs
    sudo chgrp mssql /tmp/logs
    
  3. 使用 mssql-conf 通过 set 命令更改默认错误日志文件名:Use mssql-conf to change the default errorlog filename with the set command:

    sudo /opt/mssql/bin/mssql-conf set filelocation.errorlogfile /tmp/logs/errorlog
    
  4. 重启 SQL Server 服务:Restart the SQL Server service:

    sudo systemctl restart mssql-server
    

errorlog.numerrorlogs 设置允许你指定在循环日志之前所维护的错误日志数。The errorlog.numerrorlogs setting will allow you to specify the number of error logs maintained before cycling the log.

更改默认备份目录位置Change the default backup directory location

使用 filelocation.defaultbackupdir 设置可更改生成备份文件的默认位置。The filelocation.defaultbackupdir setting changes the default location where the backup files are generated. 默认情况下,这些文件在 /var/opt/mssql/data 中生成。By default, these files are generated in /var/opt/mssql/data.

若要设置新位置,请使用以下命令:To set up this new location, use the following commands:

  1. 为新的备份文件创建目标目录。Create the target directory for new backup files. 以下示例创建一个新的 /tmp/backup 目录:The following example creates a new /tmp/backup directory:

    sudo mkdir /tmp/backup
    
  2. 将目录的所有者和组更改为 mssql 用户:Change the owner and group of the directory to the mssql user:

    sudo chown mssql /tmp/backup
    sudo chgrp mssql /tmp/backup
    
  3. 使用 mssql-conf 通过“set”命令更改默认备份目录:Use mssql-conf to change the default backup directory with the "set" command:

    sudo /opt/mssql/bin/mssql-conf set filelocation.defaultbackupdir /tmp/backup
    
  4. 重启 SQL Server 服务:Restart the SQL Server service:

    sudo systemctl restart mssql-server
    

指定核心转储设置Specify core dump settings

如果某个 SQL Server 进程发生异常,SQL Server 会创建内存转储。If an exception occurs in one of the SQL Server processes, SQL Server creates a memory dump.

可使用两个选项控制 SQL Server 收集的内存转储类型:coredump.coredumptype 和 coredump.captureminiandfull 。There are two options for controlling the type of memory dumps that SQL Server collects: coredump.coredumptype and coredump.captureminiandfull. 这两个选项与核心转储捕获的两个阶段相关。These relate to the two phases of core dump capture.

第一阶段的捕获由 coredump.coredumptype 设置控制,此设置确定异常期间生成的转储文件类型。The first phase capture is controlled by the coredump.coredumptype setting, which determines the type of dump file generated during an exception. 第二阶段由 coredump.captureminiandfull 设置启用。The second phase is enabled when the coredump.captureminiandfull setting. 如果 coredump.captureminiandfull 设置为 true,则会生成 coredump.coredumptype 指定的转储文件,还会生成第二个小型转储 。If coredump.captureminiandfull is set to true, the dump file specified by coredump.coredumptype is generated and a second mini dump is also generated. 将 coredump.captureminiandfull 设置为 false 可禁用第二次捕获尝试。Setting coredump.captureminiandfull to false disables the second capture attempt.

  1. 确定是否使用 coredump.captureminiandfull 设置捕获小型转储和完全转储。Decide whether to capture both mini and full dumps with the coredump.captureminiandfull setting.

    sudo /opt/mssql/bin/mssql-conf set coredump.captureminiandfull <true or false>
    

    默认值:falseDefault: false

  2. 使用 coredump.coredumptype 设置指定转储文件的类型。Specify the type of dump file with the coredump.coredumptype setting.

    sudo /opt/mssql/bin/mssql-conf set coredump.coredumptype <dump_type>
    

    默认值:miniplusDefault: miniplus

    下表列出了可能的 coredump.coredumptype 值。The following table lists the possible coredump.coredumptype values.

    类型Type 说明Description
    minimini Mini 是最小的转储文件类型。Mini is the smallest dump file type. 它使用 Linux 系统信息确定进程中的线程和模块。It uses the Linux system information to determine threads and modules in the process. 转储仅包含主机环境线程堆栈和模块。The dump contains only the host environment thread stacks and modules. 不包含间接内存引用或全局变量。It does not contain indirect memory references or globals.
    miniplusminiplus MiniPlus 与 mini 相似,但它包括更多内存。MiniPlus is similar to mini, but it includes additional memory. 它理解 SQLPAL 的内部机制和主机环境,可将下面的内存区域添加到转储:It understands the internals of SQLPAL and the host environment, adding the following memory regions to the dump:
    - 各种全局变量- Various globals
    - 超过 64TB 的所有内存- All memory above 64TB
    - - 在/proc/$pid/maps 中找到的所有命名区域- All named regions found in /proc/$pid/maps
    - 来自线程和堆栈的间接内存- Indirect memory from threads and stacks
    - 线程信息- Thread information
    - 关联的 Teb 和 Peb- Associated Teb's and Peb's
    - 模块信息- Module Information
    - VMM 和 VAD 树- VMM and VAD tree
    filteredfiltered Filtered 采用基于减法的设计,其中包括进程中的所有内存,除非专门排除某些内存。Filtered uses a subtraction-based design where all memory in the process is included unless specifically excluded. 此设计理解 SQLPAL 的内部机制和主机环境,从转储中排除某些区域。The design understands the internals of SQLPAL and the host environment, excluding certain regions from the dump.
    fullfull Full 是完整的过程转储,包括 /proc/$pid/maps 中的所有区域。Full is a complete process dump that includes all regions located in /proc/$pid/maps. 这并非由 coredump.captureminiandfull 设置控制。This is not controlled by coredump.captureminiandfull setting.

高可用性High Availability

使用 hadr.hadrenabled 选项可在 SQL Server 实例上启用可用性组。The hadr.hadrenabled option enables availability groups on your SQL Server instance. 下面的命令通过将 hadr.hadrenabled 设置为 1 来启用可用性组。The following command enables availability groups by setting hadr.hadrenabled to 1. 必须重启 SQL Server,该设置才能生效。You must restart SQL Server for the setting to take effect.

sudo /opt/mssql/bin/mssql-conf set hadr.hadrenabled  1
sudo systemctl restart mssql-server

有关如何将此项用于可用性组的信息,请参阅以下两个主题。For information on how this is used with availability groups, see the following two topics.

设置本地审核目录Set local audit directory

使用 telemetry.userrequestedlocalauditdirectory 设置可启用本地审核,并可设置创建本地审核日志的目录。The telemetry.userrequestedlocalauditdirectory setting enables Local Audit and lets you set the directory where the Local Audit logs are created.

  1. 为新的本地审核日志创建目标目录。Create a target directory for new Local Audit logs. 以下示例创建新的 /tmp/audit 目录:The following example creates a new /tmp/audit directory:

    sudo mkdir /tmp/audit
    
  2. 将目录的所有者和组更改为 mssql 用户:Change the owner and group of the directory to the mssql user:

    sudo chown mssql /tmp/audit
    sudo chgrp mssql /tmp/audit
    
  3. 使用 telemetry.userrequestedlocalauditdirectoryset 命令以根身份运行 mssql-conf 脚本:Run the mssql-conf script as root with the set command for telemetry.userrequestedlocalauditdirectory:

    sudo /opt/mssql/bin/mssql-conf set telemetry.userrequestedlocalauditdirectory /tmp/audit
    
  4. 重启 SQL Server 服务:Restart the SQL Server service:

    sudo systemctl restart mssql-server
    

有关详细信息,请参阅 Linux 上的 SQL Server 客户反馈For more information, see Customer Feedback for SQL Server on Linux.

更改 SQL Server 区域设置Change the SQL Server locale

使用 language.lcid 设置可将 SQL Server 区域设置更改为任何支持的语言标识符 (LCID)。The language.lcid setting changes the SQL Server locale to any supported language identifier (LCID).

  1. 以下示例将区域设置更改为法语 (1036):The following example changes the locale to French (1036):

    sudo /opt/mssql/bin/mssql-conf set language.lcid 1036
    
  2. 重启 SQL Server 服务以应用更改:Restart the SQL Server service to apply the changes:

    sudo systemctl restart mssql-server
    

设置内存限制Set the memory limit

使用 memory.memorylimitmb 设置可控制 SQL Server 可用的物理内存量(以 MB 为单位)。The memory.memorylimitmb setting controls the amount physical memory (in MB) available to SQL Server. 默认值为物理内存的 80%。The default is 80% of the physical memory.

  1. 使用 memory.memorylimitmb 的 set 命令以根用户身份运行 mssql-conf 脚本 。Run the mssql-conf script as root with the set command for memory.memorylimitmb. 以下示例将 SQL Server 可用的内存更改为 3.25 GB (3328 MB)。The following example changes the memory available to SQL Server to 3.25 GB (3328 MB).

    sudo /opt/mssql/bin/mssql-conf set memory.memorylimitmb 3328
    
  2. 重启 SQL Server 服务以应用更改:Restart the SQL Server service to apply the changes:

    sudo systemctl restart mssql-server
    

其他内存设置Additional memory settings

内存设置提供以下选项。The following options are available to the memory settings.

选项Option 描述Description
memory.disablememorypressurememory.disablememorypressure SQL Server 禁用内存压力。SQL Server disable memory pressure. 值可以为 truefalseValues can be true or false.
memory.memory_optimizedmemory.memory_optimized 启用或禁用 SQL Server 内存优化功能 - 永久性内存文件启示、内存保护。Enable or disable SQL Server memory optimized features - persistent memory file enlightenment, memory protection. 值可以为 truefalseValues can be true or false.

配置 MSDTCConfigure MSDTC

network.rpcport 和 distributedtransaction.servertcpport 设置用于配置 Microsoft 分布式事务处理协调器 (MSDTC) 。The network.rpcport and distributedtransaction.servertcpport settings are used to configure the Microsoft Distributed Transaction Coordinator (MSDTC). 要更改这些设置,请运行以下命令:To change these settings, run the following commands:

  1. 使用 network.rpcport 的 set 命令以根用户身份运行 mssql-conf 脚本:Run the mssql-conf script as root with the set command for "network.rpcport":

    sudo /opt/mssql/bin/mssql-conf set network.rpcport <rcp_port>
    
  2. 然后设置“distributedtransaction.servertcpport”设置:Then set the "distributedtransaction.servertcpport" setting:

    sudo /opt/mssql/bin/mssql-conf set distributedtransaction.servertcpport <servertcpport_port>
    

除了设置这些值之外,还必须为端口 135 配置路由和更新防火墙。In addition to setting these values, you must also configure routing and update the firewall for port 135. 有关如何执行此操作的详细信息,请参阅如何在 Linux 上配置 MSDTCFor more information on how to do this, see How to configure MSDTC on Linux.

可以使用 mssql-conf 的其他几项设置来监视 MSDTC 并对其进行故障排除。There are several other settings for mssql-conf that you can use to monitor and troubleshoot MSDTC. 下表简要描述了这些设置。The following table briefly describes these settings. 有关其用法的详细信息,请参阅 Windows 支持文章如何为 MS DTC 启用诊断跟踪了解详细信息。For more information on their use, see the details in the Windows support article, How to enable diagnostic tracing for MS DTC.

mssql-conf 设置mssql-conf setting 说明Description
distributedtransaction.allowonlysecurerpccallsdistributedtransaction.allowonlysecurerpccalls Configure secure only RPC calls for distributed transactionsConfigure secure only RPC calls for distributed transactions
distributedtransaction.fallbacktounsecurerpcifnecessarydistributedtransaction.fallbacktounsecurerpcifnecessary 为分布式事务配置“仅安全”的 RPC 调用Configure security only RPC calls for distributed transactions
distributedtransaction.maxlogsizedistributedtransaction.maxlogsize DTC 事务日志文件大小 (MB)。DTC transaction log file size in MB. 默认为 64MBDefault is 64MB
distributedtransaction.memorybuffersizedistributedtransaction.memorybuffersize 存储跟踪的循环缓冲区大小。Circular buffer size in which traces are stored. 此大小以 MB 为单位,默认为 10MBThis size is in MB and default is 10MB
distributedtransaction.servertcpportdistributedtransaction.servertcpport MSDTC rpc 服务器端口MSDTC rpc server port
distributedtransaction.trace_cmdistributedtransaction.trace_cm 连接管理器中的跟踪Traces in the connection manager
distributedtransaction.trace_contactdistributedtransaction.trace_contact 跟踪联系人池和联系人Traces the contact pool and contacts
distributedtransaction.trace_gatewaydistributedtransaction.trace_gateway 跟踪网关源Traces Gateway source
distributedtransaction.trace_logdistributedtransaction.trace_log 日志跟踪Log tracing
distributedtransaction.trace_miscdistributedtransaction.trace_misc 不能归入其他类别的跟踪Traces that cannot be categorized into the other categories
distributedtransaction.trace_proxydistributedtransaction.trace_proxy MSDTC 代理中生成的跟踪Traces that are generated in the MSDTC proxy
distributedtransaction.trace_svcdistributedtransaction.trace_svc 跟踪服务和 .exe 文件启动Traces service and .exe file startup
distributedtransaction.trace_tracedistributedtransaction.trace_trace 跟踪基础结构本身The trace infrastructure itself
distributedtransaction.trace_utildistributedtransaction.trace_util 跟踪从多个位置调用的实用工具例程Traces utility routines that are called from multiple locations
distributedtransaction.trace_xadistributedtransaction.trace_xa XA 事务管理器 (XATM) 跟踪源XA Transaction Manager (XATM) tracing source
distributedtransaction.tracefilepathdistributedtransaction.tracefilepath 应存储跟踪文件的文件夹Folder in which trace files should be stored
distributedtransaction.turnoffrpcsecuritydistributedtransaction.turnoffrpcsecurity 为分布式事务启用或禁用 RPC 安全性Enable or disable RPC security for distributed transactions

接受 MLServices EULAAccept MLServices EULAs

机器学习 R 或 Python 包添加到数据库引擎需要接受 R 和 Python 的开源分发许可条款。Adding machine learning R or Python packages to the database engine requires that you accept the licensing terms for open-source distributions of R and Python. 下表枚举了与 mlservices EULA 相关的所有可用命令或选项。The following table enumerates all available commands or options related to mlservices EULAs. 对 R 和 Python 使用相同的 EULA 参数,具体取决于所安装的内容。The same EULA parameter is used for R and Python, depending on what you installed.

# For all packages: database engine and mlservices
# Setup prompts for mlservices EULAs, which you need to accept
sudo /opt/mssql/bin/mssql-conf setup

# Add R or Python to an existing installation
sudo /opt/mssql/bin/mssql-conf setup accept-eula-ml

# Alternative valid syntax
# Adds the EULA section to the INI and sets acceptulam to yes
sudo /opt/mssql/bin/mssql-conf set EULA accepteulaml Y

# Rescind EULA acceptance and removes the setting
sudo /opt/mssql/bin/mssql-conf unset EULA accepteulaml

还可以将接受 EULA 的内容直接添加到 mssql.conf 文件You can also add EULA acceptance directly to the mssql.conf file:

[EULA]
accepteula = Y
accepteulaml = Y

启用出站网络访问Enable outbound network access

默认情况下,SQL Server 机器学习服务功能中的 R、Python 和 Java 扩展的出站网络访问处于禁用状态。Outbound network access for R, Python, and Java extensions in the SQL Server Machine Learning Services feature is disabled by default. 若要启用出站请求,请使用 mssql-conf 设置“outboundnetworkaccess”布尔属性。To enable outbound requests, set the "outboundnetworkaccess" Boolean property using mssql-conf.

设置该属性后,重新启动 SQL Server Launchpad 服务以从 INI 文件中读取更新的值。After setting the property, restart SQL Server Launchpad service to read the updated values from the INI file. 每当修改与扩展性相关的设置时,都会收到重启消息提醒。A restart message reminds you whenever an extensibility-related setting is modified.

# Adds the extensibility section and property.
# Sets "outboundnetworkaccess" to true.
# This setting is required if you want to access data or operations off the server.
sudo /opt/mssql/bin/mssql-conf set extensibility outboundnetworkaccess 1

# Turns off network access but preserves the setting
sudo /opt/mssql/bin/mssql-conf set extensibility outboundnetworkaccess 0

# Removes the setting and rescinds network access
sudo /opt/mssql/bin/mssql-conf unset extensibility.outboundnetworkaccess

还可以将“outboundnetworkaccess”直接添加到 mssql.conf 文件You can also add "outboundnetworkaccess" directly to the mssql.conf file:

[extensibility]
outboundnetworkaccess = 1

更改 TCP 端口Change the TCP port

使用 network.tcpport 设置可更改 SQL Server 侦听连接的 TCP 端口。The network.tcpport setting changes the TCP port where SQL Server listens for connections. 默认情况下,此端口设置为 1433。By default, this port is set to 1433. 若要更改端口,请运行以下命令:To change the port, run the following commands:

  1. 使用“network.tcpport”的“set”命令以根用户身份运行 mssql-conf 脚本:Run the mssql-conf script as root with the "set" command for "network.tcpport":

    sudo /opt/mssql/bin/mssql-conf set network.tcpport <new_tcp_port>
    
  2. 重启 SQL Server 服务:Restart the SQL Server service:

    sudo systemctl restart mssql-server
    
  3. 连接到 SQL Server 后,必须在主机名或 IP 地址后用逗号 (,) 指定自定义端口。When connecting to SQL Server now, you must specify the custom port with a comma (,) after the hostname or IP address. 例如,要使用 SQLCMD 进行连接,则需使用以下命令:For example, to connect with SQLCMD, you would use the following command:

    sqlcmd -S localhost,<new_tcp_port> -U test -P test
    

指定 TLS 设置Specify TLS settings

以下选项为在 Linux 上运行的 SQL Server 实例配置 TLS。The following options configure TLS for an instance of SQL Server running on Linux.

选项Option 说明Description
network.forceencryptionnetwork.forceencryption 如果为 1,则 SQL ServerSQL Server 强制加密所有连接。If 1, then SQL ServerSQL Server forces all connections to be encrypted. 默认情况下,此选项为 0。By default, this option is 0.
network.tlscertnetwork.tlscert SQL ServerSQL Server 用于 TLS 的证书文件的绝对路径。The absolute path to the certificate file that SQL ServerSQL Server uses for TLS. 示例: /etc/ssl/certs/mssql.pem,证书文件必须可由 mssql 帐户访问。Example: /etc/ssl/certs/mssql.pem The certificate file must be accessible by the mssql account. Microsoft 建议使用 chown mssql:mssql <file>; chmod 400 <file> 限制对文件的访问。Microsoft recommends restricting access to the file using chown mssql:mssql <file>; chmod 400 <file>.
network.tlskeynetwork.tlskey SQL ServerSQL Server 用于 TLS 的专用密钥文件的绝对路径。The absolute path to the private key file that SQL ServerSQL Server uses for TLS. 示例:/etc/ssl/private/mssql.key,证书文件必须可由 mssql 帐户访问。Example: /etc/ssl/private/mssql.key The certificate file must be accessible by the mssql account. Microsoft 建议使用 chown mssql:mssql <file>; chmod 400 <file> 限制对文件的访问。Microsoft recommends restricting access to the file using chown mssql:mssql <file>; chmod 400 <file>.
network.tlsprotocolsnetwork.tlsprotocols SQL Server 允许的 TLS 协议列表(以逗号分隔)。A comma-separated list of which TLS protocols are allowed by SQL Server. SQL ServerSQL Server 始终尝试协商允许的最强协议。always attempts to negotiate the strongest allowed protocol. 如果客户端不支持任何允许的协议,SQL ServerSQL Server 将拒绝连接尝试。If a client does not support any allowed protocol, SQL ServerSQL Server rejects the connection attempt. 为实现兼容性,默认情况下允许所有支持的协议(1.2、1.1、1.0)。For compatibility, all supported protocols are allowed by default (1.2, 1.1, 1.0). 如果客户端支持 TLS 1.2,Microsoft 建议仅允许 TLS 1.2。If your clients support TLS 1.2, Microsoft recommends allowing only TLS 1.2.
network.tlsciphersnetwork.tlsciphers 指定 SQL ServerSQL Server 允许将哪些密码用于 TLS。Specifies which ciphers are allowed by SQL ServerSQL Server for TLS. 必须按照 OpenSSL 的密码列表格式设置此字符串的格式。This string must be formatted per OpenSSL's cipher list format. 通常不需要更改此选项。In general, you should not need to change this option.
默认情况下,允许使用以下密码:By default, the following ciphers are allowed:
ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA
network.kerberoskeytabfilenetwork.kerberoskeytabfile Kerberos keytab 文件的路径Path to the Kerberos keytab file

有关使用 TLS 设置的示例,请参阅加密与 Linux 上的 SQL Server 的连接For an example of using the TLS settings, see Encrypting Connections to SQL Server on Linux.

网络设置Network settings

请参阅教程:对 Linux 上的 SQL Server 使用 Active Directory 身份验证,以获取有关在 Linux 上的 SQL Server 中使用 AD 身份验证的全面信息。See Tutorial: Use Active Directory authentication with SQL Server on Linux for comprehensive information on using AD authentication with SQL Server on Linux.

以下选项是可使用 mssql-conf 配置的其他网络设置。The following options are additional network settings configurable using mssql-conf.

选项Option 描述Description
network.disablesssdnetwork.disablesssd 禁用查询 SSSD 来获取 AD 帐户信息,默认为 LDAP 调用。Disable querying SSSD for AD account information and default to LDAP calls. 值可以为 truefalseValues can be true or false.
network.enablekdcfromkrb5confnetwork.enablekdcfromkrb5conf 允许从 krb5.conf 查找 KDC 信息。Enable looking up KDC information from krb5.conf. 值可以为 truefalseValues can be true or false.
network.forcesecureldapnetwork.forcesecureldap 强制使用 LDAPS 联系域控制器。Force using LDAPS to contact domain controller. 值可以为 truefalseValues can be true or false.
network.ipaddressnetwork.ipaddress 传入连接的 IP 地址。IP address for incoming connections.
network.kerberoscredupdatefrequencynetwork.kerberoscredupdatefrequency 检查需要更新的 kerberos 凭据之间的时间(以秒为单位)。Time in seconds between checks for kerberos credentials that need to be updated. 值是一个整数。Value is an integer.
network.privilegedadaccountnetwork.privilegedadaccount 要用于 AD 身份验证的特权 AD 用户。Privileged AD user to use for AD authentication. 值为 <username>Value is <username>. 有关详细信息,请参阅教程:对 Linux 上的 SQL Server 使用 Active Directory 身份验证For more information, see Tutorial: Use Active Directory authentication with SQL Server on Linux
uncmappinguncmapping 将 UNC 路径映射到本地路径。Maps UNC path to a local path. 例如,sudo /opt/mssql/bin/mssql-conf set uncmapping //servername/sharename /tmp/folderFor example, sudo /opt/mssql/bin/mssql-conf set uncmapping //servername/sharename /tmp/folder.

启用/禁用跟踪标志Enable/Disable traceflags

使用 traceflag 选项可启用或禁用 SQL Server 服务启动的跟踪标志。This traceflag option enables or disables traceflags for the startup of the SQL Server service. 若要启用/禁用跟踪标志,请使用以下命令:To enable/disable a traceflag, use the following commands:

  1. 使用以下命令启用跟踪标志。Enable a traceflag using the following command. 例如,对于跟踪标志 1234:For example, for Traceflag 1234:

    sudo /opt/mssql/bin/mssql-conf traceflag 1234 on
    
  2. 可以通过单独指定跟踪标志来启用多个跟踪标志:You can enable multiple traceflags by specifying them separately:

    sudo /opt/mssql/bin/mssql-conf traceflag 2345 3456 on
    
  3. 同样,可以通过指定跟踪标志并添加“off”参数来禁用一个或多个启用的跟踪标志:In a similar way, you can disable one or more enabled traceflags by specifying them and adding the off parameter:

    sudo /opt/mssql/bin/mssql-conf traceflag 1234 2345 3456 off
    
  4. 重启 SQL Server 服务以应用更改:Restart the SQL Server service to apply the changes:

    sudo systemctl restart mssql-server
    

删除设置Remove a setting

要取消设置使用 mssql-conf set 进行的任何设置,请使用 unset 选项和设置名称调用 mssql-conf。To unset any setting made with mssql-conf set, call mssql-conf with the unset option and the name of the setting. 这将清除设置,有效地将其重置为默认值。This clears the setting, effectively returning it to its default value.

  1. 以下示例清除 network.tcpport 选项。The following example clears the network.tcpport option.

    sudo /opt/mssql/bin/mssql-conf unset network.tcpport
    
  2. 重启 SQL Server 服务。Restart the SQL Server service.

    sudo systemctl restart mssql-server
    

查看当前设置View current settings

要查看任何已配置的设置,请运行以下命令以输出 mssql.conf 文件的内容:To view any configured settings, run the following command to output the contents of the mssql.conf file:

sudo cat /var/opt/mssql/mssql.conf

此文件中未显示的所有设置均使用其默认值。Any settings not shown in this file are using their default values. 下一部分提供示例 mssql.conf 文件。The next section provides a sample mssql.conf file.

mssql.conf formatmssql.conf format

以下 /var/opt/mssql/mssql.conf 文件提供了每个设置的示例。The following /var/opt/mssql/mssql.conf file provides an example for each setting. 可以根据需要使用此格式手动更改 mssql.conf 文件。You can use this format to manually make changes to the mssql.conf file as needed. 如果手动更改文件,则必须在应用更改之前重启 SQL Server。If you do manually change the file, you must restart SQL Server before the changes are applied. 要将 mssql.conf 文件与 Docker 配合使用,必须让 Docker 保留你的数据To use the mssql.conf file with Docker, you must have Docker persist your data. 首先将完整的 mssql.conf 文件添加到主机目录,然后运行容器。First add a complete mssql.conf file to your host directory and then run the container. 客户反馈中有一个示例。There is an example of this in Customer Feedback.

[EULA]
accepteula = Y

[coredump]
captureminiandfull = true
coredumptype = full

[filelocation]
defaultbackupdir = /var/opt/mssql/data/
defaultdatadir = /var/opt/mssql/data/
defaultdumpdir = /var/opt/mssql/data/
defaultlogdir = /var/opt/mssql/data/

[hadr]
hadrenabled = 0

[language]
lcid = 1033

[memory]
memorylimitmb = 4096

[network]
forceencryption = 0
ipaddress = 10.192.0.0
kerberoskeytabfile = /var/opt/mssql/secrets/mssql.keytab
tcpport = 1401
tlscert = /etc/ssl/certs/mssql.pem
tlsciphers = ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA
tlskey = /etc/ssl/private/mssql.key
tlsprotocols = 1.2,1.1,1.0

[sqlagent]
databasemailprofile = default
errorlogfile = /var/opt/mssql/log/sqlagentlog.log
errorlogginglevel = 7

[telemetry]
customerfeedback = true
userrequestedlocalauditdirectory = /tmp/audit

[traceflag]
traceflag0 = 1204
traceflag1 = 2345
traceflag = 3456
[EULA]
accepteula = Y
accepteulaml = Y

[coredump]
captureminiandfull = true
coredumptype = full

[distributedtransaction]
servertcpport = 51999

[filelocation]
defaultbackupdir = /var/opt/mssql/data/
defaultdatadir = /var/opt/mssql/data/
defaultdumpdir = /var/opt/mssql/data/
defaultlogdir = /var/opt/mssql/data/

[hadr]
hadrenabled = 0

[language]
lcid = 1033

[memory]
memorylimitmb = 4096

[network]
forceencryption = 0
ipaddress = 10.192.0.0
kerberoskeytabfile = /var/opt/mssql/secrets/mssql.keytab
rpcport = 13500
tcpport = 1401
tlscert = /etc/ssl/certs/mssql.pem
tlsciphers = ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA
tlskey = /etc/ssl/private/mssql.key
tlsprotocols = 1.2,1.1,1.0

[sqlagent]
databasemailprofile = default
errorlogfile = /var/opt/mssql/log/sqlagentlog.log
errorlogginglevel = 7

[telemetry]
customerfeedback = true
userrequestedlocalauditdirectory = /tmp/audit

[traceflag]
traceflag0 = 1204
traceflag1 = 2345
traceflag = 3456

后续步骤Next steps

若要改用环境变量更改其中的某些配置,请参阅使用环境变量配置 SQL Server 设置To instead use environment variables to make some of these configuration changes, see Configure SQL Server settings with environment variables.

有关其他管理工具和方案,请参阅管理 Linux 上的 SQL ServerFor other management tools and scenarios, see Manage SQL Server on Linux.