> For the complete documentation index, see [llms.txt](https://docs.console.zenlayer.com/welcome/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.console.zenlayer.com/welcome/cn/elastic-compute/load-balancing/create-a-load-balancer-instance.md).

# 创建负载均衡器实例

负载均衡器根据预定义的算法和规则，将传入的请求或网络流量分发到一组后端服务器。负载均衡器还对后端服务器进行健康检查，以确保其能够处理请求。

负载均衡器的主要目的是优化资源利用率、最大化吞吐量、最小化响应时间，并确保应用程序或服务的高可用性。

## 操作步骤

前往 **Elastic Compute** > **Load Balancer** > **Create Load Balancer**。

{% stepper %}
{% step %}
**选择计费模式**

目前仅支持[按量付费](/welcome/cn/pricing/general-pricing-rules/pay-as-you-go.md)。
{% endstep %}

{% step %}
**选择地区**

选择您希望部署负载均衡器的地区。

请注意，负载均衡器与后端服务器必须位于同一地区。
{% endstep %}

{% step %}
**选择规格**

目前提供**标准**型，最大连接数、CPS 和 QPS 均无限制。

* **最大连接数**：指负载均衡实例能够处理的最大连接数量。
* **CPS**：每秒新建连接数（CPS），指负载均衡实例每秒能够处理的新连接数量。
* **QPS**：每秒查询数（QPS），指负载均衡实例每秒处理传入查询或请求的速率，特指第七层（应用层）监听场景。
  {% endstep %}

{% step %}
**为负载均衡器选择全局 VPC**

负载均衡器必须部署在特定的全局 VPC 内，且只能与该 VPC 内的后端服务器关联。因此，后端服务器的网络接口（vNIC）必须与负载均衡器位于同一全局 VPC 中。

如果没有合适的全局 VPC，请点击**新建全局 VPC**进行创建。
{% endstep %}

{% step %}
*<mark style="color:green;">**(可选)**</mark>***&#x20;关联安全组**

当您需要**控制或限制进出负载均衡器的流量**时，可以随时将负载均衡器关联到安全组。
{% endstep %}

{% step %}
**选择 IP 协议栈类型和默认弹性 IPv4**

此处配置的弹性公网 IPv4 将作为 VIP（虚拟 IP），即负载均衡器的外部访问地址。

IP 协议栈类型指定负载均衡器支持的 IP 协议版本。目前仅支持 IPv4，即负载均衡器仅分配 IPv4 VIP，且只接受 IPv4 客户端的流量。

* **Premium BGP IP**：利用边界网关协议实现灵活可靠的路由，适用于高可用网络场景。Premium BGP IP 提供优化的多运营商路由。
* **本地 IP**：来源于本地 ISP，与数据中心所在国家匹配，常用于合规或本地化接入场景。本地 IP 适合区域性或成本敏感型场景。

您也可以在创建后再分配弹性 IPv4。详情请参见[绑定弹性 IPv4](https://github.com/zenlayer/zenlayer-documentation-cn/blob/main/elastic-compute/load-balancing/load-balancer-instance/bind-elastic-ipv4.md)。
{% endstep %}

{% step %}
**选择公网计费方式**

负载均衡器转发的公网流量将产生费用。请根据您的业务需求选择合适的公网计费方式。\
目前，弹性公网 IP 支持**数据传输**、**固定带宽**和**带宽集群**三种计费模式。\
如需使用**带宽集群**计费，请提交工单联系我们。

* [数据传输](/welcome/cn/pricing/network-billing/data-transfer.md)\
  配置数据传输包。超出套餐限额的流量将产生额外费用。\
  您可以设置公网带宽上限以控制流量用量，避免超额计费。如不设置带宽上限，将使用默认值。
* [固定带宽](/welcome/cn/pricing/network-billing/flat-rate.md)\
  配置固定带宽上限。适用于公网用量稳定且可预测的业务场景。
* [带宽集群](/welcome/cn/pricing/network-billing/regional-aggregated-burstable-95th.md)\
  在同一地区或城市内的多个计算资源（包括负载均衡器）之间共享带宽承诺。按带宽使用峰值的第 95 百分位计费，为突发流量提供弹性，适用于流量不可预测或周期性高峰的场景以降低成本。
  {% endstep %}

{% step %}
**为负载均衡器命名**

为您的负载均衡器起一个唯一的名称。

名称长度为 2 至 63 个字符，可包含字母、数字、连字符（-）、下划线（\_）、斜杠（/）和句点（.），且必须以字母或数字开头和结尾。
{% endstep %}

{% step %}
**自定义健康探测私有源 IP**

从同一地区的子网中选择 2 个私有 IPv4 地址用于健康检查。如不设置，将从全局 VPC 内同一地区的任意子网中随机分配。

如果没有合适的同地区子网，请点击**新建子网**进行创建。
{% endstep %}

{% step %}
**更多设置**

**管理资源**

您可以将负载均衡器添加到指定的资源组中。在资源组中，特定成员可以被授予对资源的指定权限。

详情请参见[创建资源组](/welcome/cn/platform/team-management/create-a-resource-group.md)。

**设置标签 /** **编辑标签**（在负载均衡器列表页）

标签是可分配给资源的元数据标识。

详情请参见[为资源添加标签](/welcome/cn/platform/team-management/tag-management/add-tags-to-resources.md)。
{% endstep %}
{% endstepper %}

## 结果

创建完成后，负载均衡器进入 **Active**（运行中）状态。在负载均衡器列表页，您可以查看负载均衡器的状态、名称和 ID、地区、IP 类型、网络配置以及是否已配置监听器。

## 后续操作

创建完成后，点击负载均衡器名称进入详情页。前往 **Information**（信息）可查看规格、监听器列表、网络配置、订单与计费等信息。

负载均衡器必须配置监听器和后端服务器后才能正常运行。

详情请参见[为负载均衡器添加监听器](/welcome/cn/elastic-compute/load-balancing/create-a-listener.md)和[向监听器添加后端服务器](/welcome/cn/elastic-compute/load-balancing/add-backend-servers-to-a-listener.md)。

如有需要，您还可以执行以下操作：

* [查看负载均衡器的监听器和网络性能](https://github.com/zenlayer/zenlayer-documentation-cn/blob/main/elastic-compute/load-balancing/load-balancer-instance/check-load-balancer-performance.md)
* [绑定弹性 IPv4](https://github.com/zenlayer/zenlayer-documentation-cn/blob/main/elastic-compute/load-balancing/load-balancer-instance/bind-elastic-ipv4.md)
* [变更安全组](https://github.com/zenlayer/zenlayer-documentation-cn/blob/main/elastic-compute/load-balancing/load-balancer-instance/change-security-group.md)
* [删除负载均衡器](https://github.com/zenlayer/zenlayer-documentation-cn/blob/main/elastic-compute/load-balancing/load-balancer-instance/delete-a-load-balancer.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.console.zenlayer.com/welcome/cn/elastic-compute/load-balancing/create-a-load-balancer-instance.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
