ö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
$ sudo apt-get install x11vnc vnc-java
$ x11vnc -storepasswdçalıştıralım
Enter VNC password:
Verify password:
Write password to /home/kullanici/.vnc/passwd? [y]/n y
$ x11vnc -forever -usepw -httpdir /usr/share/vnc-java/ -httpport 5800
http://sistem_makine_adresi:5800
for i in *.bmp; do convert ${i} ${i%bmp}jpg; done
$ dd if=/dev/zero of=fillfile bs=1M
$ VBoxManage modifyhd /path/to/your.vdi --compact
Ident authentication failed for user "openerp"hatası alıyorsanız pg_hba.conf dosyasında
local all all ident
local all all md5
# echo | openssl rsa -in cakey.pem -out cakey.pem
Enter pass phrase for cakey.pem:
writing RSA key
cd /usr/local/directadmin/scripts
./move_domain.sh domain.com olduser newuser
sudo apt-get install gcp
function generatePassword($length=9, $strength=0) {
srand((double)microtime()*1000000);
$chars = 'abcdefghijklmnopqrstuvwxyz0123456789';
if ($strength > 1) $chars .= 'ABDGHJLMNPQRSTVWXZ';
if ($strength > 2) $chars .= "!@#$%";
if ($strength > 3) $chars .= '^&*(-_=+)';
$i = 0;$key = '';
while ($i <= $length) {$key .= $chars[rand(0, strlen($chars))];$i++;}
return $key;
}
echo generatePassword(9);
echo generatePassword(9,1);
echo generatePassword(9,2);
echo generatePassword(9,3);
echo generatePassword(9,4);
echo generatePassword(50,4);