Replikasi lintas region AlloyDB memungkinkan Anda membuat cluster dan instance sekunder dari cluster utama untuk membuat resource tersedia di berbagai region, jika terjadi pemadaman di region utama. Cluster dan instance sekunder ini berfungsi sebagai salinan resource cluster dan instance utama Anda.
Konsep utama di halaman ini meliputi:
Cluster utama. Cluster baca-tulis di satu region.
Cluster sekunder. Cluster hanya baca di region yang berbeda dengan cluster utama,
yang mereplikasi dari cluster utama secara asinkron.
Jika terjadi kegagalan cluster utama AlloyDB, Anda dapat
mempromosikan cluster sekunder menjadi cluster utama.
Instance sekunder. Pemimpin hanya baca dari cluster sekunder. Cluster ini
bertanggung jawab untuk menerima aliran replikasi dari cluster utama. Aliran
replikasi memperbarui volume penyimpanan di region sekunder berdasarkan
volume penyimpanan di region utama.
Jika cluster sekunder dipromosikan menjadi cluster utama, instance sekunder
akan menjadi instance utama.
Node sekunder aktif. Node yang merupakan bagian dari instance sekunder. Node
ini tetap aktif dan merespons permintaan.
Node sekunder siaga. Node yang merupakan bagian dari instance sekunder. Jika
AlloyDB mendeteksi bahwa node aktif tidak tersedia, AlloyDB akan mempromosikan
node standby untuk bertindak sebagai node aktif baru.
Manfaat
Manfaat replikasi lintas region di AlloyDB meliputi hal-hal berikut:
Pemulihan dari bencana. Jika region cluster utama menjadi tidak tersedia, Anda dapat mempromosikan resource AlloyDB di region lain untuk melayani permintaan.
Mengurangi periode nonaktif. Dukungan ketersediaan tinggi (HA) di cluster sekunder mengurangi periode nonaktif selama peristiwa pemeliharaan atau pemadaman layanan yang tidak direncanakan.
Data yang didistribusikan secara geografis. Mendistribusikan data secara geografis akan mendekatkan data kepada Anda dan mengurangi latensi baca.
Load balancing geografis. Jika terjadi koneksi yang lambat atau kelebihan beban
di satu region, Anda dapat merutekan traffic ke region lain.
Peningkatan performa baca. Hal ini membuat resource AlloyDB tersedia lebih dekat dengan region aplikasi Anda.
Pengalihan dengan nol kehilangan data. Untuk penyiapan replikasi lintas-region dengan satu cluster sekunder, AlloyDB mendukung pengalihan antara instance utama dan sekunder tanpa kehilangan data.
Cara menggunakan replikasi lintas-region
Bekerja dengan replikasi lintas region AlloyDB melibatkan tugas-tugas berikut:
Buat cluster sekunder.
Cluster sekunder adalah salinan cluster utama AlloyDB yang terus diperbarui.
Melihat cluster sekunder.
Setelah membuat cluster sekunder, Anda dapat melihat detailnya di halaman Cluster
di konsol Google Cloud .
Tambahkan instance kumpulan baca.
Anda dapat menambahkan instance pool baca ke cluster sekunder. Jika ingin menskalakan kapasitas baca secara horizontal, Anda dapat menambahkan hingga 20 node baca ke cluster sekunder.
Mempromosikan cluster sekunder.
Jika Anda perlu membaca atau menulis data di cluster sekunder, Anda harus
mempromosikannya terlebih dahulu menjadi cluster utama mandiri yang memiliki fitur lengkap. Saat Anda
mempromosikan cluster sekunder, instance sekunder cluster juga
dipromosikan sebagai instance utama dengan kemampuan baca dan tulis.
Ada dua skenario umum untuk mempromosikan cluster sekunder Anda ke cluster
primer:
Migrasi regional. Lakukan migrasi terencana resource AlloyDB dari region utamanya ke region lain.
Pemulihan dari bencana. Mengaktifkan resource AlloyDB dengan cepat
di region sekunder jika resource di region utama
menjadi tidak tersedia. Karena jeda replikasi, beberapa data mungkin hilang.
Mempromosikan cluster sekunder akan mengonversinya menjadi cluster
mandiri dengan instance utama yang berfungsi penuh, termasuk kemampuan
baca dan tulis. Cluster yang dipromosikan tidak lagi mereplikasi data dari cluster
primer yang sebelumnya terkait.
Pengalihan dengan nol kehilangan data.
Pengalihan memungkinkan Anda membalikkan peran cluster primer dan sekunder
tanpa kehilangan data. Anda dapat melakukan pengalihan untuk menguji penyiapan pemulihan dari bencana atau melakukan migrasi workload Anda. Saat Anda menyelesaikan pengalihan, arah replikasi akan dibalik.
Pengalihan dengan kehilangan data nol hanya didukung untuk penyiapan replikasi lintas region dengan satu instance sekunder.
Konfigurasi pencadangan otomatis dan berkelanjutan.
Secara default, AlloyDB otomatis menyalin konfigurasi pencadangan otomatis dan berkelanjutan dari cluster utama ke cluster sekunder yang baru dibuat. Jika tidak menginginkan replikasi otomatis ini, Anda dapat mengubah konfigurasi cadangan saat membuat cluster sekunder.
Jika cluster utama Anda menggunakan enkripsi kunci enkripsi yang dikelola pelanggan (CMEK) untuk cadangan, lakukan salah satu tindakan berikut selama pembuatan cluster sekunder:
Berikan setelan enkripsi CMEK untuk pencadangan cluster sekunder.
Nonaktifkan pencadangan secara eksplisit untuk cluster sekunder.
Untuk mengetahui informasi selengkapnya tentang cara mengenkripsi cadangan Anda dengan CMEK, lihat Menggunakan CMEK
Anda dapat mengubah setelan cadangan otomatis dan berkelanjutan untuk cluster sekunder setelah pembuatannya.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-09-03 UTC."],[[["\u003cp\u003eAlloyDB cross-region replication creates read-only secondary clusters and instances in different regions, providing copies of primary resources for disaster recovery.\u003c/p\u003e\n"],["\u003cp\u003eSecondary clusters can be promoted to fully functional primary clusters with read and write capabilities, enabling regional migration or rapid disaster recovery activation.\u003c/p\u003e\n"],["\u003cp\u003eSwitchover functionality allows for the reversal of primary and secondary cluster roles with zero data loss, ideal for testing or workload migration in single secondary instance setups.\u003c/p\u003e\n"],["\u003cp\u003eCross-region replication enhances data availability, reduces downtime with high availability support on secondary clusters, and improves read performance by bringing data closer to applications.\u003c/p\u003e\n"],["\u003cp\u003eManaging cross-region replication involves tasks such as creating and viewing secondary clusters, adding read pool instances, and configuring or disabling backup settings.\u003c/p\u003e\n"]]],[],null,["# About cross-region replication\n\nSelect a documentation version: 15.5.4keyboard_arrow_down\n\n- [15.5.4](/alloydb/omni/15.5.4/docs/cross-region-replication/about-cross-region-replication)\n\n\u003cbr /\u003e\n\nThis page provides an overview of AlloyDB for PostgreSQL cross-region replication.\n\n\u003cbr /\u003e\n\nAlloyDB cross-region replication lets you create secondary\nclusters and instances from a primary cluster to make the resources available in\ndifferent regions, in the event of an outage in the primary region. These\nsecondary clusters and instances function as copies of your primary cluster and\ninstance resources.\n\nKey concepts in this page include the following:\n\n- **Primary cluster.** A read-write cluster in a single region.\n- **Secondary cluster.** A read-only cluster in a different region than the primary, that replicates from the primary cluster asynchronously. In the event of a failure of an AlloyDB primary cluster, you can promote a secondary cluster to a primary cluster.\n- **Secondary instance.** A read-only leader of a secondary cluster. It is responsible for receiving a replication stream from a primary cluster. The replication stream updates the storage volume in the secondary region based on the storage volume in the primary region. If a secondary cluster is promoted to a primary cluster, the secondary instance becomes the primary instance.\n- **Active secondary node.** A node that's part of the secondary instance. This node remains active and responds to requests.\n- **Stand-by secondary node.** A node that's part of the secondary instance. If AlloyDB detects unavailability of the active node, it promotes the standby node to act as the new active node.\n\nBenefits\n--------\n\nThe benefits of cross-region replication on AlloyDB include the\nfollowing:\n\n- **Disaster recovery.** In the event the primary cluster's region becomes\n unavailable, you can promote AlloyDB resources in another region\n to serve requests.\n\n- **Reduced downtime.** Support of high availability (HA) on secondary clusters\n reduces downtime during maintenance events or unplanned outages.\n\n- **Geographically distributed data.** Distributing the data geographically brings\n the data closer to you and decreases read latency.\n\n- **Geographic load balancing.** In the event of slow or overloaded connections\n in one region, you can route traffic to another region.\n\n- **Improved read performance.** It makes AlloyDB resources\n available closer to your application's region.\n\n- **Switchover with zero data loss.** For cross-region\n replication setups with a single secondary cluster, AlloyDB\n supports switchover between primary and secondary instance with zero data\n loss.\n\nHow to work with cross-region replication\n-----------------------------------------\n\nWorking with AlloyDB cross-region replication involves the following tasks:\n\n- [**Create a secondary cluster.**](/alloydb/omni/15.5.4/docs/cross-region-replication/work-with-cross-region-replication#secondary-cluster-instance)\n A secondary cluster is a continuously updated copy of your AlloyDB\n primary cluster.\n\n- [**View a secondary cluster.**](/alloydb/omni/15.5.4/docs/cross-region-replication/work-with-cross-region-replication#view-secondary-cluster)\n After you create a secondary cluster, you can view its details in the **Clusters**\n page in the Google Cloud console.\n\n- [**Add read pool instances.**](/alloydb/omni/15.5.4/docs/cross-region-replication/work-with-cross-region-replication#read-pools-secondary-cluster)\n You can add read pool instances to a secondary cluster. If you want to scale your read\n capacity horizontally, you can add up to 20 read nodes to your secondary cluster.\n\n- [**Promote a secondary cluster.**](/alloydb/omni/15.5.4/docs/cross-region-replication/work-with-cross-region-replication#promote-secondary-cluster)\n If you need to read from or write to the data in a secondary cluster, you must\n first promote it into a fully-featured, standalone primary cluster. When you\n promote a secondary cluster, the cluster's secondary instance is also\n promoted as a primary instance with read and write capabilities.\n\n There are two common scenarios for promoting your secondary cluster to a primary\n cluster:\n - **Regional migration.** Perform a planned migration of the AlloyDB resources from their primary region to another region.\n - **Disaster recovery.** Rapidly activate the AlloyDB resources in a secondary region in the event that the resources in the primary region become unavailable. Due to replication lag, some data loss might occur.\n\n Promoting a secondary cluster converts it to a standalone\n cluster with a fully functional primary instance, including read and write\n capabilities. The promoted cluster no longer replicates the data from the primary\n cluster it was formerly associated with.\n- [**Switchover with zero data loss.**](/alloydb/omni/15.5.4/docs/cross-region-replication/work-with-cross-region-replication#switchover-secondary)\n Switchover lets you reverse the roles of your primary and secondary cluster\n with zero data loss. You can perform a switchover for testing\n your disaster recovery setup or performing migration of your workload. When\n you complete the switchover, the direction of replication\n is reversed.\n\n Switchover with zero data loss is only supported for cross-region\n replication setups with a single secondary instance.\n- [**Configure automated and continuous backups.**](/alloydb/docs/backup/configure)\n By default, AlloyDB automatically copies automated and\n continuous backup configurations from the primary cluster to a newly created\n secondary cluster. If you don't want this automatic replication, you can\n modify the backup configuration when you create a secondary cluster.\n\n If your primary cluster uses customer-managed encryption key (CMEK) encryption\n for backups, take one of these actions during secondary cluster creation:\n - Provide CMEK encryption settings for the secondary cluster's backups.\n - Explicitly disable backups for the secondary cluster.\n\nFor more information about encrypting your backups with CMEK, see [Use CMEK](/alloydb/docs/use-cmek)\n\nYou can modify automated and continuous backup settings for the secondary cluster after its creation.\n\nWhat's next\n-----------\n\n- [Work with cross-region replication](/alloydb/omni/15.5.4/docs/cross-region-replication/work-with-cross-region-replication)"]]