Chuyển tới nội dung

Mariadb Galera Cluster

1. Install Mariadb Install dependencyapt-get install -y build-essential libgcrypt11-dev zlib1g-dev libxml2-dev libssl-dev  libncurses-dev git wget cmake gcc make tar libgd-dev libpcre3-dev bison scons libboost-dev libboost-program-options-dev openssl dh-autoreconf libssl-dev Download mariadbhttps://vn-mirrors.vhost.vn/mariadb/mariadb-11.8.2/source/mariadb-11.8.2.tar.gz Build Mariadb 2. Install galera wget https://archive.mariadb.org//mariadb-11.8.2/galera-26.4.22/src/galera-26.4.22.tar.gztar xvfz galera-26.4.22.tar.gzapt-get install… Mariadb Galera Cluster

Một số lệnh patroni và etcd cơ bản

PatroniKhởi tạo lại member patronipatronictl -c /etc/patroni.yml reinit postgres indo_psql1Loại bỏ 1 node ra khỏi clusterpatronictl -c /etc/patroni.yml remove indo_psql1Kiểm tra member listpatronictl -c /etc/patroni/patroni.yml listĐể Disable Patroni Cluster Auto Failoverpatronictl -c /etc/patroni/patroni.yml pausePatroni Cluster Switchoverpatronictl -c /etc/patroni/patroni.yml switchover –master… Một số lệnh patroni và etcd cơ bản

High Available Postgres by Patroni

Install Postges trên tất cả các node Tạo các user trên các nodesu postgres/opt/postgres/bin/psqlpostgres=# CREATE USER replicator WITH REPLICATION ENCRYPTED PASSWORD ‘x0hDfZv27’;postgres=# CREATE USER postgres WITH SUPERUSER ENCRYPTED PASSWORD ‘njk16uAeFNl’; Install watchdogsudo vi /etc/watchdog.conf## active dòng này lên, bỏ comment… High Available Postgres by Patroni

Install Postgresql-16

https://www.manniwood.com/2023_12_07/postgresql_16_compile_install_howto.html https://www.tecmint.com/install-postgresql-from-source-code-in-linux echo “vm.nr_hugepages = 2048” >> /etc/sysctl.confsysctl -p Script install postgresql-16 Tạo các extension Cấu hình pg_hba.conf