önce
error-testtask_2405406e-98d4-45a0-874f-46131843520b
redis-cli keys "error-*" |awk '{print "redis-cli RENAME " $1 " " substr($0,7)}'|sh
sonra
testtask_2405406e-98d4-45a0-874f-46131843520b
redis-cli keys "error-*" |awk '{print "redis-cli RENAME " $1 " " substr($0,7)}'|sh
1. LB1 Server: 192.168.10.111 ( eth1 )Install Keepalived
2. LB2 Server: 192.168.10.112 ( eth1 )
3. Virtual IP: 192.168.10.121
# yum install keepalivedKeepalived configuration File: /etc/keepalived/keepalived.conf
vrrp_instance VI_1 {
interface eth1 state MASTER
virtual_router_id 10
priority 101 # 101 on master, 100 on backup
virtual_ipaddress {
192.168.10.121
}
}
vrrp_instance VI_1 {
interface eth1 state BACKUP
virtual_router_id 10
priority 100 # 101 on master, 100 on backup
virtual_ipaddress {
192.168.10.121
}
}
# service keepalived start
# chkconfig keepalived on
sudo apt-get install postgresql"
sudo -u postgres psql postgresMaster tarafında ki ayarlamalar
\password postgres
/etc/postgresql/9.1/main/postgresql.conf
listen_address = '*'
wal_level = hot_standby
max_wal_senders = 3
etc/postgresql/9.1/main/pg_hba.conf
host all all 192.168.2.5/32 md5
host replication all 192.168.2.102/32 trust
select pg_start_backup('backup');
rsync -av 192.168.2.101:/var/lib/postgresql/9.1/main/ /var/lib/postgresql/9.1/main/
rm -rf /var/lib/postgresql/9.1/main/postmaster.pid
show data_directory;Son olarak master sunucudaki backup işlemini durdurmalısınız. Bunun için pgadmin de aşağıdakı sorguyu çalıştırın.
select pg_stop_backup();Slave sunucu tarafında yapılan değişklikler
standby_mode='on'eğer salave sunucuda sorgu çalıştırmak istiyorsanız slave sunucuda aşağıdaki ayarı da yapın
primary_conninfo='host=192.168.2.101'
hot_standby = on