All Products
Search
Document Center

Server Load Balancer:AddBackendServers

Last Updated:Jun 10, 2026

Menambahkan server backend.

Deskripsi operasi

Catatan

If multiple identical Elastic Compute Service (ECS) instances are specified in a request, only the first ECS instance is added. The other ECS instances are ignored. If the backend server that you add is the same as one of the existing backend servers that are already associated with the listener, an error message is returned.

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tabel berikut menjelaskan otorisasi yang diperlukan untuk memanggil API ini. Anda dapat menentukannya dalam kebijakan Resource Access Management (RAM). Kolom pada tabel dijelaskan sebagai berikut:

  • Action: Aksi yang dapat digunakan dalam elemen Action pada pernyataan kebijakan izin RAM untuk memberikan izin guna melakukan operasi tersebut.

  • API: API yang dapat Anda panggil untuk melakukan aksi tersebut.

  • Access level: Tingkat akses yang telah ditentukan untuk setiap API. Nilai yang valid: create, list, get, update, dan delete.

  • Resource type: Jenis resource yang mendukung otorisasi untuk melakukan aksi tersebut. Ini menunjukkan apakah aksi tersebut mendukung izin tingkat resource. Resource yang ditentukan harus kompatibel dengan aksi tersebut. Jika tidak, kebijakan tersebut tidak akan berlaku.

    • Untuk API dengan izin tingkat resource, jenis resource yang diperlukan ditandai dengan tanda bintang (*). Tentukan Nama Sumber Daya Alibaba Cloud (ARN) yang sesuai dalam elemen Resource pada kebijakan.

    • Untuk API tanpa izin tingkat resource, ditampilkan sebagai All Resources. Gunakan tanda bintang (*) dalam elemen Resource pada kebijakan.

  • Condition key: Kunci kondisi yang didefinisikan oleh layanan. Kunci ini memungkinkan kontrol granular, berlaku baik hanya untuk aksi maupun untuk aksi yang terkait dengan resource tertentu. Selain kunci kondisi spesifik layanan, Alibaba Cloud menyediakan serangkaian common condition keys yang berlaku di semua layanan yang didukung RAM.

  • Dependent action: Aksi dependen yang diperlukan untuk menjalankan aksi tersebut. Untuk menyelesaikan aksi tersebut, pengguna RAM atau role RAM harus memiliki izin untuk melakukan semua aksi dependen.

Action

Access level

Resource type

Condition key

Dependent action

slb:AddBackendServers

update

*LoadBalancer

acs:slb:{#regionId}:{#accountId}:loadbalancer/{#LoadBalancerId}

*Instance

acs:ecs:{#regionId}:{#accountId}:instance/{#InstanceId}

None None

Parameter permintaan

Parameter

Type

Required

Description

Example

RegionId

string

No

ID wilayah tempat instans Classic Load Balancer (CLB) ditempatkan.

Anda dapat memanggil operasi untuk mengkueri daftar wilayah terbaru.

cn-beijing

LoadBalancerId

string

Yes

ID instans CLB.

lb-2ze7o5h52g02kkzz******

BackendServers

string

No

Daftar server backend yang ingin Anda tambahkan. Tetapkan parameter berikut:

  • ServerId: Wajib diisi. Nilai ini harus berupa string. Masukkan ID antarmuka jaringan elastis (ENI) atau instans kontainer elastis. Jika ServerId diatur ke ID ENI atau instans kontainer elastis, Type wajib diisi.

  • Weight: Bobot server backend. Nilai valid: 0 hingga 100. Nilai default: 100.

    Jika nilai diatur ke 0, tidak ada permintaan yang diteruskan ke server backend tersebut.

  • Description: Opsional. Deskripsi server backend. Nilai ini harus berupa string. Panjang deskripsi harus antara 1 hingga 80 karakter, dan dapat berisi huruf, angka, tanda hubung (-), garis miring (/), titik (.), dan garis bawah (_).

  • Type: Tipe server backend. Nilai valid:

    • ecs (default): Instance ECS

    • eni: ENI

    • eci: instans kontainer elastis

Catatan

Anda hanya dapat menentukan ENI dan instans kontainer elastis sebagai server backend untuk instans CLB berperforma tinggi.

  • ServerIp: Alamat IP Instance ECS, ENI, atau instans kontainer elastis

  • Port: Port backend

Contoh:

  • Instance ECS: [{ "ServerId": "i-xxxxxxxxx", "Weight": "100", "Type": "ecs", "Port":"80","Description":"test-112" }]

  • ENI: [{ "ServerId": "eni-xxxxxxxxx", "Weight": "100", "Type": "eni", "ServerIp": "192.168.**.**", "Port":"80","Description":"test-112" }]

  • ENI dengan beberapa alamat IP: [{ "ServerId": "eni-xxxxxxxxx", "Weight": "100", "Type": "eni", "ServerIp": "192.168.**.**", "Port":"80","Description":"test-113" },{ "ServerId": "eni-xxxxxxxxx", "Weight": "100", "Type": "eni", "ServerIp": "172.166.**.**", "Port":"80","Description":"test-113" }]

  • Instans kontainer elastis: [{ "ServerId": "eci-xxxxxxxxx", "Weight": "100", "Type": "eci", "ServerIp": "192.168.**.**", "Port":"80","Description":"test-114" }]

Catatan

Server backend yang Anda tambahkan ke instans CLB harus dalam status Berjalan. Anda dapat menambahkan paling banyak 20 server backend ke satu instans CLB dalam setiap permintaan.

[{ "ServerId": "eni-xxxxxxxxx", "Weight": "100", "Type": "eni", "ServerIp": "192.168.**.**", "Port":"80","Description":"test-112" },{ "ServerId": "eni-xxxxxxxxx", "Weight": "100", "Type": "eni", "ServerIp": "172.166.**.**", "Port":"80","Description":"test-113" }]

Elemen respons

Element

Type

Description

Example

object

LoadBalancerId

string

The ID of the CLB instance.

lb-2ze7o5h52g02kkzz****

RequestId

string

The ID of the request.

34B82C81-F13B-4EEB-99F6-A048C67CC830

BackendServers

object

BackendServer

array<object>

The list of backend servers.

object

Type

string

The type of the backend server. Valid values:

  • ecs (default): an ECS instance

  • eni: an ENI

  • eci: an elastic container instance

ecs

Weight

string

The weight of the backend server.

Valid values: 0 to 100. Default value: 100.

If the value is set to 0, no requests are forwarded to the backend server.

100

Description

string

The description of the backend server.

The description of the backend server.

ServerId

string

The ID of the ECS instance, ENI, or elastic container instance.

i-2zej4lxhjoq1icu*****

Contoh

Respons sukses

JSONformat

{
  "LoadBalancerId": "lb-2ze7o5h52g02kkzz****",
  "RequestId": "34B82C81-F13B-4EEB-99F6-A048C67CC830",
  "BackendServers": {
    "BackendServer": [
      {
        "Type": "ecs",
        "Weight": "100",
        "Description": "The description of the backend server.",
        "ServerId": "i-2zej4lxhjoq1icu*****"
      }
    ]
  }
}

Kode kesalahan

HTTP status code

Error code

Error message

Description

400 InvalidParameter The specified load balancer does not support the network type of the ECS instance.
400 Mismatched.ZoneId The zone of the server is not matched with the cloud box loadbalancer.
400 BackendServerProcessing Backend Server is adding, please try again later.
400 InvalidBackendServers.ServerIpConflict %s.
400 OperationUnsupported.AddBackendServers This type of backend server is not allowed to attached to singleTunnel or anyTunnel lb.
400 IncorrectStatus.RSByPassToas %s.
400 OperationFailed.ActionNotSupport The loadbalancer does not support such action.
400 NetworkConflict %s.
400 SystemBusy The system is busy.

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.