你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Trino 配置管理

重要

此功能目前以预览版提供。 Microsoft Azure 预览版的补充使用条款包含适用于 beta 版、预览版或其他尚未正式发布的 Azure 功能的更多法律条款。 有关此特定预览版的信息,请参阅 Azure HDInsight on AKS 预览版信息。 如有疑问或功能建议,请在 AskHDInsight 上提交请求并附上详细信息,并关注我们以获取 Azure HDInsight Community 的更多更新。

HDInsight on AKS 的 Trino 群集附带了开源 Trino 的大部分默认配置。 本文介绍如何更新配置文件,以及如何将自己的补充配置文件添加到群集。

可以通过两种方式添加/更新配置:

注意

HDInsight on AKS 的 Trino 强制实施某些配置并禁止修改某些文件和/或属性。 这样做是为了通过配置确保适当的安全性/连接性。 禁止的文件/属性的示例包括但不限于:

  • jvm.config 文件(堆大小设置除外)。
  • Node.properties:node.id、node.data-dir、log.path 等。
  • Config.properties: http-server.authentication.*, http-server.https.* etc.

使用 Azure 门户

在 Azure 门户中,可以修改三组标准 Trino 配置

  • log.properties
  • config.properties
  • node.properties

按照以下步骤修改配置:

  1. 登录到 Azure 门户

  2. 在 Azure 门户搜索栏中,键入“HDInsight on AKS 群集”,然后从下拉列表中选择“Azure HDInsight on AKS 群集”。

    屏幕截图显示 HDInsight on AKS 群集入门搜索选项。

  3. 从列表页面中选择你的群集名称。

    屏幕截图显示如何从列表中选择所需的 HDInsight on AKS 群集。

  4. 导航到“配置管理”边栏选项卡。

    屏幕截图显示 Azure 门户配置管理。

  5. 为要修改的配置添加新的或更新现有的键值对。 例如,config.properties ->“自定义配置”-> 单击“添加”添加新配置设置,然后单击“确定”。

    屏幕截图显示自定义配置。

  6. 单击“保存”以保存配置。

    屏幕截图显示如何保存配置。

使用 ARM 模板

先决条件

群集管理

所有 Trino 配置均可以在 properties.clusterProfile 下的 serviceConfigsProfiles.serviceName[“trino”] 中指定。

以下示例侧重于 coordinator/worker/miscfiles。 有关目录,请参阅将目录添加到现有群集

"serviceConfigsProfiles": [
    {
        "serviceName": "trino",
        "configs": [
            {
                "component": "catalogs",
                "files": [<file-spec>,…]
            },
            {
                "component": "coordinator",
                "files": [<file-spec>,…]
            },
            {
                "component": "worker",
                "files": [<file-spec>,…]
            },
            {
                "component": " miscfiles",
                "files": [<file-spec>,…]
            },
        ]
    }
]

有几个组件控制不同的配置特性:

构成名称 每个文件规格的必需/允许的属性 说明
常用 filenamevalues 包含协调者和辅助角色的配置文件。
协调器 filenamevalues 仅包含协调者的配置文件,如果存在则替代通用配置文件。
worker filenamevalues 仅包含辅助角色的配置文件,如果存在则替代通用配置文件。
miscfiles filenamecontent 包含用户为整个群集提供的其他配置文件。
catalogs filename,内容或值 包含整个群集的目录文件。

下面的示例展示了如何:

  • 替代群集的默认 node.environment(在 Trino UI 中显示)。
  • 替代协调者和辅助角色的默认 config.properties 值。
  • 添加示例资源组 json,并配置协调器以使用它。
"serviceConfigsProfiles": [
    {
        "serviceName": "trino",
        "configs": [
            {
                "component": "common",
                "files": [
                    {
                        "fileName": "node.properties",
                        "values": {
                            "node.environment": "preview"
                        }
                    },
                    {
                        "fileName": "config.properties",
                        "values": {
                            "join-distribution-type": "AUTOMATIC",
                            "query.max-execution-time": "5d",
                            "shutdown.grace-period": "5m"
                        }
                    }
                ]                
            },
            {
                "component": "coordinator",
                "files": [
                    {
                        "fileName": "resource-groups.properties",
                        "values": {
                            "resource-groups.configuration-manager": "file",
                            "resource-groups.config-file": "${MISC:resource-groups}"
                        }                                            
                    }
                ]
            },
            {
                "component": "miscfiles",
                "files": [
                    {
                        "fileName": "resource-groups",
                        "path": "/customDir/resource-groups.json",
                        "content": "{\"rootGroups\":[{\"name\":\"global\",\"softMemoryLimit\":\"80%\",\"hardConcurrencyLimit\":100,\"maxQueued\":1000,\"schedulingPolicy\":\"weighted\",\"jmxExport\":true,\"subGroups\":[{\"name\":\"data_definition\",\"softMemoryLimit\":\"10%\",\"hardConcurrencyLimit\":5,\"maxQueued\":100,\"schedulingWeight\":1},{\"name\":\"adhoc\",\"softMemoryLimit\":\"10%\",\"hardConcurrencyLimit\":50,\"maxQueued\":1,\"schedulingWeight\":10,\"subGroups\":[{\"name\":\"other\",\"softMemoryLimit\":\"10%\",\"hardConcurrencyLimit\":2,\"maxQueued\":1,\"schedulingWeight\":10,\"schedulingPolicy\":\"weighted_fair\",\"subGroups\":[{\"name\":\"${USER}\",\"softMemoryLimit\":\"10%\",\"hardConcurrencyLimit\":1,\"maxQueued\":100}]}]}]},{\"name\":\"admin\",\"softMemoryLimit\":\"100%\",\"hardConcurrencyLimit\":50,\"maxQueued\":100,\"schedulingPolicy\":\"query_priority\",\"jmxExport\":true}],\"selectors\":[{\"group\":\"global.adhoc.other.${USER}\"}],\"cpuQuotaPeriod\":\"1h\"}"
                    }
                ]
            }
        ]
    }

部署更新的 ARM 模板以反映群集中的更改。 了解如何部署 ARM 模板