Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.
Menggunakan penyimpanan data global (CLI)
Anda dapat menggunakan AWS Command Line Interface (AWS CLI) untuk mengontrol beberapa AWS layanan dari baris perintah dan mengotomatiskannya melalui skrip. Anda dapat menggunakan AWS CLI untuk operasi ad hoc (satu kali).
Mengunduh dan mengonfigurasi AWS CLI
AWS CLI Berjalan di Windows, macOS, atau Linux. Gunakan prosedur berikut untuk mengunduh dan mengonfigurasinya.
Untuk mengunduh, menginstal, dan mengonfigurasi CLI
-
Unduh AWS CLI di halaman web antarmuka AWS baris perintah
. -
Ikuti petunjuk untuk Menginstal AWS CLI dan Mengkonfigurasi AWS CLI di Panduan Pengguna.AWS Command Line Interface
Menggunakan AWS CLI dengan datastores global
Gunakan operasi CLI berikut untuk menangani penyimpanan data global:
-
create-global-replication-group
aws elasticache create-global-replication-group \ --global-replication-group-id-suffix
my global datastore
\ --primary-replication-group-idsample-repl-group
\ --global-replication-group-descriptionan optional description of the global datastore
Amazon ElastiCache secara otomatis menerapkan awalan ke ID datastore global saat dibuat. Setiap AWS Wilayah memiliki awalan sendiri. Sebagai contoh, ID penyimpanan data global yang dibuat di Wilayah AS Barat (California Utara) dimulai dengan "virxk" dan diikuti nama akhiran yang Anda berikan. Akhiran tersebut dikombinasikan dengan awalan yang dihasilkan secara otomatis, menjamin keunikan nama penyimpanan data global di beberapa Wilayah.
Tabel berikut mencantumkan setiap AWS Wilayah dan awalan ID datastore globalnya.
Nama Wilayah/Wilayah Awalan Wilayah AS Timur (Ohio)
us-east-2
fpkhr
Wilayah AS Timur (Virginia Utara)
us-east-1
ldgnf
Wilayah AS Barat (California Utara)
us-west-1
virxk
Wilayah AS Barat (Oregon)
us-west-2
sgaui
Wilayah Kanada (Pusat)
ca-central-1
bxodz
Wilayah Asia Pasifik (Mumbai)
ap-south-1
erpgt
Wilayah Asia Pasifik (Tokyo)
ap-northeast-1
quwsw
Wilayah Asia Pasifik (Seoul)
ap-northeast-2
lfqnh
Wilayah Asia Pasifik (Osaka)
ap-northeast-3
nlapn
Wilayah Asia Pasifik (Singapura)
ap-southeast-1
vlqxn
Wilayah Asia Pasifik (Sydney)
ap-southeast-2
vbgxd
Wilayah Eropa (Frankfurt)
eu-central-1
iudkw
Wilayah Eropa (Irlandia)
eu-west-1
gxeiz
Wilayah Eropa (London)
eu-west-2
okuqm
Wilayah Eropa (Paris)
eu-west-3
fgjhi
Wilayah Amerika Selatan (Sao Paulo)
sa-east-1
juxlw
Wilayah Tiongkok (Beijing)
cn-north-1
emvgo
Wilayah China (Ningxia)
cn-northwest-1
ckbem
Wilayah Asia Pasifik (Hong Kong)
ap-east-1
knjmp
AWS GovCloud (AS-Barat)
us-gov-west-1
sgwui
-
create-replication-group— Gunakan operasi ini untuk membuat cluster sekunder untuk datastore global dengan memasok nama datastore global ke parameter.
--global-replication-group-id
aws elasticache create-replication-group \ --replication-group-id
secondary replication group name
\ --replication-group-description“Replication group description"
\ --global-replication-group-idglobal datastore name
Saat memanggil operasi ini dan meneruskan
--global-replication-group-id
nilai, ElastiCache akan menyimpulkan nilai dari grup replikasi utama grup replikasi global untuk parameter berikut. Jangan memasukkan nilai untuk parameter ini:"PrimaryClusterId",
"AutomaticFailoverEnabled",
"NumNodeGroups",
"CacheParameterGroupName",
"CacheNodeType",
"Engine",
"EngineVersion",
"CacheSecurityGroupNames",
"EnableTransitEncryption",
"AtRestEncryptionEnabled",
"SnapshotArns",
"SnapshotName"
-
describe-global-replication-groups
aws elasticache describe-global-replication-groups \ --global-replication-group-id
my global datastore
\ --show-member-infoan optional parameter that returns a list of the primary and secondary clusters that make up the global datastore
-
modify-global-replication-group
aws elasticache modify-global-replication-group \ --global-replication-group-id
my global datastore
\ --automatic-failover-enabled \ --cache-node-typenode type
\ --cache-parameter-group-nameparameter group name
\ --engine-versionengine version
\ -—apply-immediately \ --global-replication-group-descriptiondescription
Redis ke OSS Valkey cross-engine upgrade untuk ElastiCache GlobalDataStore
Anda dapat memutakhirkan grup replikasi global Redis OSS yang ada ke Valkey menggunakan Konsol, API, atau CLI.
Jika Anda memiliki grup replikasi global Redis OSS yang ada, Anda dapat meningkatkan ke Valkey dengan menentukan versi mesin dan mesin baru dengan API. modify-global-replication-group
Untuk Linux, macOS, atau Unix:
aws elasticache modify-global-replication-group \ --global-replication-group-id myGlobalReplGroup \ --engine valkey \ --apply-immediately \ --engine-version 8.0
Untuk Windows:
aws elasticache modify-global-replication-group ^ --global-replication-group-id myGlobalReplGroup ^ --engine valkey ^ --apply-immediately ^ --engine-version 8.0
Jika Anda memiliki grup parameter cache khusus yang diterapkan ke grup replikasi global Redis OSS yang ingin Anda tingkatkan, Anda juga harus melewati grup parameter cache Valkey kustom dalam permintaan. Grup parameter kustom Valkey input harus memiliki nilai parameter statis Redis OSS yang sama dengan grup parameter kustom Redis OSS yang ada.
Untuk Linux, macOS, atau Unix:
aws elasticache modify-global-replication-group \ --global-replication-group-id myGlobalReplGroup \ --engine valkey \ --engine-version 8.0 \ --apply-immediately \ --cache-parameter-group-name myParamGroup
Untuk Windows:
aws elasticache modify-global-replication-group ^ --global-replication-group-id myGlobalReplGroup ^ --engine valkey ^ --engine-version 8.0 ^ --apply-immediately ^ --cache-parameter-group-name myParamGroup
-
delete-global-replication-group
aws elasticache delete-global-replication-group \ --global-replication-group-id
my global datastore
\ --retain-primary-replication-groupdefaults to true
-
disassociate-global-replication-group
aws elasticache disassociate-global-replication-group \ --global-replication-group-id
my global datastore
\ --replication-group-idmy secondary cluster
\ --replication-group-regionthe AWS Region in which the secondary cluster resides
-
failover-global-replication-group
aws elasticache failover-replication-group \ --global-replication-group-id
my global datastore
\ --primary-regionThe AWS Region of the primary cluster
\ --primary-replication-group-idThe name of the global datastore, including the suffix.
-
increase-node-groups-in-global-replication-group
aws elasticache increase-node-groups-in-global-replication-group \ --apply-immediately
yes
\ --global-replication-group-idglobal-replication-group-name
\ --node-group-count3
-
decrease-node-groups-in-global-replication-group
aws elasticache decrease-node-groups-in-global-replication-group \ --apply-immediately
yes
\ --global-replication-group-idglobal-replication-group-name
\ --node-group-count3
-
rebalance-shards-in-global-replikasi-kelompok
aws elasticache rebalance-shards-in-global-replication-group \ --apply-immediately
yes
\ --global-replication-group-idglobal-replication-group-name
Gunakan bantuan untuk membuat daftar semua perintah yang tersedia ElastiCache untuk Valkey atau Redis OSS.
aws elasticache help
Anda juga dapat menggunakan bantuan untuk mengetahui penjelasan perintah tertentu dan mempelajari selengkapnya penggunaannya:
aws elasticache create-global-replication-group help