Primero tendras que instalarimagemagik ya sea por linea de comando o por synaptic
sudo apt-get install imagemagick
Y luego una vez ubicado en la carpeta donde estan las imagenes
mogrify -resize 640 *.jpg
controla la fuerza que te impulsa
sudo apt-get install imagemagick
mogrify -resize 640 *.jpg
#configuracion ip del servidor principal /etc/network/interfaces
iface eth0 inet static
address 10.25.2.1
netmask 255.255.255.0
network 10.25.2.0
broadcast 10.25.2.255
gateway 10.25.2.254
auto eth0:0
iface eth0:0 inet static
address 10.25.2.57
netmask 255.255.255.0
network 10.25.2.0
broadcast 10.25.2.255
gateway 10.25.2.254
#configuracion ip del servidor alterno /etc/network/interfaces
iface eth0 inet static
address 10.25.2.2
netmask 255.255.255.0
network 10.25.2.0
broadcast 10.25.2.255
gateway 10.25.2.254
auto eth0:0
iface eth0:0 inet static
address 10.25.2.3
netmask 255.255.255.0
network 10.25.2.0
broadcast 10.25.2.255
gateway 10.25.2.254
sudo apt-get install keepalived
# Keepalived Configuration File /etc/keepalived/keepalived.conf
vrrp_instance VI_1 {
state MASTER
interface eth0
virtual_router_id 10
priority 200
virtual_ipaddress {
10.25.2.3/24
}
notify_master "/etc/keepalived/notify.sh del 10.25.2.3"
notify_backup "/etc/keepalived/notify.sh add 10.25.2.3"
notify_fault "/etc/keepalived/notify.sh add 10.25.2.3"
}
virtual_server 10.25.2.3 389 {
delay_loop 30
lb_algo rr
lb_kind DR
persistence_timeout 50
protocol TCP
real_server 10.25.2.1 389 {
weight 100
TCP_CHECK {
connect_timeout 3
connect_port 389
nb_get_retry 3
delay_before_retry 2
}
}
real_server 10.25.2.2 389 {
weight 100
TCP_CHECK {
connect_timeout 3
connect_port 389
nb_get_retry 3
delay_before_retry 2
}
}
}
# Keepalived Configuration File /etc/keepalived/keepalived.conf
vrrp_instance VI_1 {
state BACKUP
interface eth0
virtual_router_id 10
priority 100
virtual_ipaddress {
10.25.2.3/24
}
notify_master "/etc/keepalived/notify.sh del 10.25.2.3"
notify_backup "/etc/keepalived/notify.sh add 10.25.2.3"
notify_fault "/etc/keepalived/notify.sh add 10.25.2.3"
}
virtual_server 10.25.2.3 389 {
delay_loop 30
lb_algo rr
lb_kind DR
persistence_timeout 50
protocol TCP
real_server 10.25.2.1 389 {
weight 100
TCP_CHECK {
connect_timeout 3
connect_port 389
nb_get_retry 3
delay_before_retry 2
}
}
real_server 10.25.2.2 389 {
weight 100
TCP_CHECK {
connect_timeout 3
connect_port 389
nb_get_retry 3
delay_before_retry 2
}
}
}
#!/bin/bash
VIP="$2"
case "$1" in
add)
/sbin/iptables -A PREROUTING -t nat -d $VIP -p tcp -j REDIRECT
;;
del)
/sbin/iptables -D PREROUTING -t nat -d $VIP -p tcp -j REDIRECT
;;
*)
echo "Usage: $0 {add|del} ipaddress"
exit 1
esac
exit 0
sudo /etc/init.d/keepalived start
sudo /etc/init.d/networking restart