All Products
Search
Document Center

Server Load Balancer:CreateServerGroup

Last Updated:Jun 10, 2026

Membuat kelompok server untuk instans Gateway Load Balancer (GWLB).

Deskripsi operasi

CreateServerGroup is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the ListServerGroups operation to query the status of the task.

  • If the server group is in the Creating state, it indicates that the server group is being created.

  • If the server group is in the Available state, it indicates that the server group is created.

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

gwlb:CreateServerGroup

create

*ServerGroup

acs:gwlb:{#regionId}:{#accountId}:servergroup/*

*VPC

acs:vpc:{#regionId}:{#accountId}:vpc/{#VpcId}

None None

Parameter permintaan

Parameter

Type

Required

Description

Example

ServerGroupType

string

No

Tipe kelompok server. Nilai valid:

  • Instance (default): memungkinkan Anda menentukan sumber daya tipe Ecs, Eni, atau Eci.

  • Ip: memungkinkan Anda menambahkan server dengan menentukan alamat IP-nya.

Instance

ServerGroupName

string

No

Nama kelompok server.

Nama harus terdiri dari 2 hingga 128 karakter, dan dapat berisi angka, periode (.), garis bawah (_), serta tanda hubung (-). Harus diawali dengan huruf.

testServerGroupName

Protocol

string

No

Protokol backend. Nilai valid:

  • GENEVE (default).

Valid values:

  • GENEVE :

    GENEVE.

GENEVE

Scheduler

string

No

Algoritma penjadwalan. Nilai valid:

  • 5TCH (default): menentukan penghashan konsisten yang didasarkan pada faktor berikut: alamat IP sumber, alamat IP tujuan, port sumber, protokol, dan port tujuan. Permintaan yang berisi informasi sama berdasarkan faktor sebelumnya akan diteruskan ke server backend yang sama.

  • 3TCH: menentukan penghashan konsisten yang didasarkan pada faktor berikut: alamat IP sumber, alamat IP tujuan, dan protokol. Permintaan yang berisi informasi sama berdasarkan faktor sebelumnya akan diteruskan ke server backend yang sama.

  • 2TCH: menentukan penghashan konsisten yang didasarkan pada faktor berikut: alamat IP sumber dan alamat IP tujuan. Permintaan yang berisi informasi sama berdasarkan faktor sebelumnya akan diteruskan ke server backend yang sama.

5TCH

ServerFailoverMode

string

No

Menentukan bagaimana GWLB memproses permintaan melalui koneksi yang sudah ada ketika server backend tidak berjalan seperti yang diharapkan. Nilai valid:

  • NoRebalance (default): GWLB melanjutkan penerusan permintaan melalui koneksi yang sudah ada ke server backend yang tidak tersedia.

  • Rebalance: GWLB meneruskan permintaan melalui koneksi yang sudah ada ke server backend sehat yang tersisa.

NoRebalance

VpcId

string

Yes

ID VPC.

Catatan

Jika ServerGroupType disetel ke Instance, hanya server di VPC yang ditentukan yang dapat ditambahkan ke kelompok server.

vpc-bp15zckdt37pq72zv****

ResourceGroupId

string

No

ID kelompok sumber daya.

rg-atstuj3rtop****

ConnectionDrainConfig

object

No

Konfigurasi pengurasan koneksi.

ConnectionDrainEnabled

boolean

No

Specifies whether to enable connection draining. Valid values:

  • true

  • false

false

ConnectionDrainTimeout

integer

No

The timeout period of connection draining.

Unit: seconds

Valid values: 1 to 3600.

Default value: 300.

300

HealthCheckConfig

object

No

Konfigurasi pemeriksaan kesehatan.

HealthCheckConnectPort

integer

No

The backend server port used for health checks.

Valid values: 1 to 65535.

Default value: 80.

80

HealthCheckConnectTimeout

integer

No

The maximum timeout period for a health check response.

Unit: seconds.

Valid values: 1 to 300.

Default value: 5.

5

HealthCheckDomain

string

No

The domain name used for health checks. Valid values:

  • $SERVER_IP (default): the private IP address of a backend server.

  • domain: a domain name. The domain name must be 1 to 80 characters in length, and can contain letters, digits, hyphens (-), and periods (.).

Catatan

This parameter takes effect only if you set HealthCheckProtocol to HTTP.

$SERVER_IP

HealthCheckEnabled

boolean

No

Specifies whether to enable health checks. Valid values:

  • true (default)

  • false

true

HealthCheckHttpCode

array

No

The HTTP status codes that the system returns for health checks.

string

No

The HTTP status codes returned for health checks. Multiple HTTP status codes are separated by commas (,). Valid values:

  • http_2xx

  • http_3xx

  • http_4xx

  • http_5xx

Default value: http_2xx.

Catatan

This parameter takes effect only if you set HealthCheckProtocol to HTTP.

http_2xx

HealthCheckInterval

integer

No

The interval at which health checks are performed.

Unit: seconds.

Valid values: 1 to 50.

Default value: 10.

10

HealthCheckPath

string

No

The path used for health checks.

It must be 1 to 80 characters in length, and can contain letters, digits, hyphens (-), forward slashes (/), periods (.), percent signs (%), question marks (?), number signs (#), and ampersands (&). The URL can also contain the following extended characters: _ ; ~ ! ( ) * [ ] @ $ ^ : ' , + =

It must start with a forward slash (/).

Catatan

This parameter takes effect only if you set HealthCheckProtocol to HTTP.

/test/index.html

HealthCheckProtocol

string

No

The protocol used for health checks. Valid values:

  • TCP (default): GWLB performs TCP health checks by sending SYN packets to a backend server to check whether the port of the backend server is available to receive requests.

  • HTTP: GWLB performs HTTP health checks to check whether backend servers are healthy by sending GET requests which simulate access from browsers.

TCP

HealthyThreshold

integer

No

The number of times that an unhealthy backend server must consecutively pass health checks before it is declared healthy. In this case, the health check status of the backend server changes from fail to success.

Valid values: 2 to 10.

Default value: 2.

2

UnhealthyThreshold

integer

No

The number of times that a healthy backend server must consecutively fail health checks before it is declared unhealthy. In this case, the health check status of the backend server changes from success to fail.

Valid values: 2 to 10.

Default value: 2.

2

HealthCheckReq

string

No

HealthCheckExp

string

No

Tag

array<object>

No

Kunci tag.

Anda dapat menentukan paling banyak 20 tag dalam setiap pemanggilan.

object

No

The tag.

Key

string

No

The tag key. The tag key cannot be an empty string. The tag key can be up to 128 characters in length, and cannot start with acs: or aliyun. The tag key cannot contain http:// or https://.

testTagKey

Value

string

No

The tag value. The tag value can be up to 256 characters in length and cannot contain http:// or https://.

testTagValue

DryRun

boolean

No

Apakah akan menjalankan dry run saja tanpa menjalankan permintaan aktual. Nilai valid:

  • true: Hanya menjalankan dry run. Sistem memeriksa permintaan untuk masalah potensial, termasuk nilai parameter yang hilang, sintaks permintaan yang salah, dan batasan layanan. Jika permintaan gagal dry run, kode kesalahan dikembalikan. Jika permintaan lolos dry run, kode kesalahan DryRunOperation dikembalikan.

  • false (default): Menjalankan dry run dan menjalankan permintaan aktual. Jika permintaan lolos dry run, kode status HTTP 2xx dikembalikan dan operasi dijalankan.

False

ClientToken

string

No

Token klien yang digunakan untuk memastikan idempotensi permintaan.

Anda dapat menggunakan klien untuk menghasilkan token, tetapi Anda harus memastikan bahwa token tersebut unik di antara permintaan yang berbeda. Token klien hanya boleh berisi karakter ASCII.

Catatan

Jika Anda tidak menentukan parameter ini, sistem secara otomatis menggunakan request ID sebagai token klien. Request ID dapat berbeda untuk setiap permintaan.

123e4567-e89b-12d3-a456-42665544****

Elemen respons

Element

Type

Description

Example

object

RequestId

string

The request ID.

54B48E3D-DF70-471B-AA93-08E683A1B45

ServerGroupId

string

The server group ID.

sgp-atstuj3rtoptyui****

Contoh

Respons sukses

JSONformat

{
  "RequestId": "54B48E3D-DF70-471B-AA93-08E683A1B45",
  "ServerGroupId": "sgp-atstuj3rtoptyui****"
}

Kode kesalahan

HTTP status code

Error code

Error message

Description

400 IllegalParam.HealthCheckProtocol The param of %s is illegal.
400 QuotaExceeded.ServerGroupsNum The quota of %s is exceeded for resource %s, usage %s/%s.
400 DuplicatedParam.TagKey The param of %s is duplicated.
400 IllegalParam.TagKey The param of %s is illegal.
404 ResourceNotFound.Vpc The specified resource of %s is not found.

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.