VPC网络下启用internal域名

更新时间:
复制为 MD 格式

SLSinternal域名指形如*-internal.log.aliyuncs.comendpoint。internal域名适用于VPC网络环境,使用internal域名访问SLS服务免收网络费用。internal域名拥有固定的小范围网段,其范围参见VPC专用内网域名

internal域名的优势

  • 免费:不收取网络费用。

  • 稳定:直接使用阿里云内网。

  • 网段范围小、可预期:

    • 减少多云专线打通时IP冲突风险。

    • 简化防火墙配置。

限制条件

仅 LoongCollector 3.0.12及以上版本建议使用internal域名。

主机场景客户端配置

  • 未安装 LoongCollector:在安装采集器时会自动探测并优先启用 internal 域名,或通过./loongcollector.sh install ${region_id}-internal强制使用 internal 域名。对于无法访问 OSS VPC 域名的使用场景(如企业通过专线仅打通阿里云SLS网络),请预先完成服务器无法连接外部网络时如何升级 并通过./loongcollector.sh install-local ${region_id}-internal安装。

  • 已安装 LoongCollector:若要启用 internal 域名,需修改/usr/local/ilogtail_config.json

    1. 参考示例修改配置文件,示例中${region_id}根据实际情况替换:

      • 若采集器是从 Logtail 升级到 LoongCollector:

        {
            "config_server_address" : "http://logtail.${region_id}-internal.log.aliyuncs.com",
            "data_server_list" :
            [
                {
                    "cluster" : "${region_id}",
                    "endpoint" : "${region_id}-internal.log.aliyuncs.com"
                }
            ]
        }
      • 若直接安装 LoongCollector:

        {
            "primary_region" : "${region_id}",
            "config_servers" :
            [
                "http://logtail.${region_id}-internal.log.aliyuncs.com"
            ],
            "data_servers" :
            [
                {
                    "region" : "${region_id}",
                    "endpoint_list": [
                        "${region_id}-internal.log.aliyuncs.com"
                    ]
                }
            ]
        }
    2. 执行sudo /etc/init.d/loongcollectord restart重启LoongCollector。

容器场景客户端配置

  1. 登录容器服务管理控制,在左侧导航栏选择集群列表

  2. 单击目标集群,单击应用,在列表中选择loongcollector,点击操作列的更新

  3. 将配置YAML中的net值修改为Internal并确定,等待DaemonSet的实例全部重启完毕后即生效。

    image.png