Server STB
Menu
  • Beranda
  • Layanan
    • JASA
    • Aplikasi
    • Sistem Operasi
  • Harga
  • Wiki
  • Blog
  • Teknologi
    • Server
    • Unduh
  • Kontak
  • Login
  • member
Menu
postgresql

Replikasi database pada PostgreSQL

Posted on 24 May 2022 by admin

host    all             all             ::1/128                 md5

# Allow replication connections from localhost, by a user with the

# replication privilege.

host       tes        inixindo   192.168.4.145/24               md5

host    replication     all             127.0.0.1/32            md5

host    replication     all             ::1/128                 md5

  1. Restart Master Server (MS) (bisa dari service windows, Postgres stop kemudian start kembali).
  2. Tes koneksi untuk memastikan bisa terhubung dengan MS. (SS):

C:\Program Files\PostgreSQL\11\bin> psql -U inixindo -h 192.168.4.145 -d tes

  1. Buat Publication yang berfungsi untuk menyediakan replikasi terhadap suatu tabel (MS) :

CREATE PUBLICATION publication_coba;

ALTER PUBLICATION publication_coba ADD TABLE coba;

  1. Membuat Subscription yang berfungsi untuk terkoneksi pada Publication (SS) :

CREATE SUBSCRIPTION subscription_coba CONNECTION 'host=192.168.4.145 port=5432 password=’123’ user=inixindo dbname=tes' PUBLICATION publication_coba;

  1. Silakan coba menambahkan data pada Master Server (MS):

insert into coba values(1,’faizal’);

  1. Cek record pada Master Server (MS) dan Slave Server (SS):

select * from coba;

select * from pg_publication;

Semoga artikel ini membantu anda lebih memahami banyak permasalahan dalam replikasi database. Jangan sungkan tinggalkan komentar di bawah jika anda memiliki pertanyaan. Sampai jumpa diartikel selanjutnya.

Loading

Pages: 1 2
Category: Database, Server

Riwayat Pos

  • Cara Membuat SSH Private Key untuk Komunikasi Antar Server Tanpa Login (Passwordless SSH)
  • Mengoptimalkan Kecerdasan Buatan dengan n8n: Otomasi dan Integrasi Tanpa Coding
  • Perbedaan CBT dan CAT: Kenali Metode Ujian Digital yang Semakin Populer
  • AI dan Manusia: Kolaborasi Menuju Masa Depan
  • Cara Mengubah Ukuran Partisi Root dan Memperbesar LVM di Ubuntu 20.04

Katagori

  • Aplikasi (9)
  • Berita (2)
  • Database (1)
  • Member (9)
  • Server (10)
  • Sistem Operasi (4)
  • STB (16)
    • Server STB (7)
  • Teknologi (8)
  • Unduh (2)

Server STB

  • Daftar
  • Cari
  • Media
  • Cloud
  • Openwrt
  • Wiki

Tags

apache Database docker firewall internet iot keamanan Load Balance nginx prmox review ubuntu

Iklan

Everyday Local Server

apache Database docker firewall internet iot keamanan Load Balance nginx prmox review ubuntu

WhatsApp : +6289677814176
Email : [email protected]
© 2025 Server STB | Powered by Minimalist Blog WordPress Theme