High Availability
از ویکی پارس پویش
(تفاوت بین نسخهها)
سطر ۳۲: | سطر ۳۲: | ||
− | + | '''MASTER''': If it is master server, set it to 1; otherwise, change it to 0. | |
− | + | '''MASTERIP''': Set master server IP address | |
− | + | '''SLAVEIP''': Set slave server IP address | |
− | + | '''FLOATIP''': Set float IP address | |
− | + | '''Device''': The interface to use for sending advertise packets | |
− | Run script | + | '''Run script''' |
You may run this command and add it to "/etc/rc.local": | You may run this command and add it to "/etc/rc.local": | ||
− | /usr/local/pcc/ha_flip/flip_start_server | + | /usr/local/pcc/ha_flip/flip_start_server |
− | NOTE 1: Clients use Float IP to connect to server. | + | '''NOTE 1''': Clients use Float IP to connect to server. |
− | NOTE 2: Since UCARP uses multicast packets to send advertise packets, it should not be filtered in network. | + | |
+ | '''NOTE 2''': Since UCARP uses multicast packets to send advertise packets, it should not be filtered in network. | ||
</div> | </div> |
نسخهٔ ۳ آوریل ۲۰۱۳، ساعت ۱۲:۳۲
High Availability
We use "UCARP" software make sure PCC is always available.
How does UCARP work?
http://www.ucarp.org/project/ucarp
Configuration
Configuration File: /usr/local/pcc/ha_flip/flip_config
#!/bin/bash MASTER=1 # set 1 if this server is master else set 0 MASTERIP="X.X.X.X" SLAVEIP="Y.Y.Y.Y" FLOATIP="Z.Z.Z.Z" DEVICE="eth0" IFACE="$DEVICE" SECRET="secret" keep_update(){ ip addr list | grep "$FLOATIP" if [ $? == "0" ] then rsync -avzr –rsh=ssh /etc/asterisk/* root@$DSTIP:/etc/asterisk >> /var/log/ha_flip.log rsync -avzr –rsh=ssh /var/spool/asterisk/* root@$DSTIP:/var/spool/asterisk >> /var/log/ha_flip.log rsync -avzr –rsh=ssh /var/lib/asterisk/* root@$DSTIP:/var/lib/asterisk >> /var/log/ha_flip.log rsync -avzr –rsh=ssh /var/www/* root@$DSTIP:/var/www >> /var/log/ha_flip.log fi }
MASTER: If it is master server, set it to 1; otherwise, change it to 0. MASTERIP: Set master server IP address SLAVEIP: Set slave server IP address FLOATIP: Set float IP address Device: The interface to use for sending advertise packets
Run script
You may run this command and add it to "/etc/rc.local":
/usr/local/pcc/ha_flip/flip_start_server
NOTE 1: Clients use Float IP to connect to server.
NOTE 2: Since UCARP uses multicast packets to send advertise packets, it should not be filtered in network.