High Availability
از ویکی پارس پویش
(تفاوت بین نسخهها)
(صفحهای جدید حاوی '<div dir=ltr lang=en> High Availability We use "UCARP" software make sure PCC is always available. HA How does UCARP work? http://www.uca...' ایجاد کرد) |
|||
سطر ۴: | سطر ۴: | ||
We use "UCARP" software make sure PCC is always available. | We use "UCARP" software make sure PCC is always available. | ||
− | |||
How does UCARP work? | How does UCARP work? | ||
http://www.ucarp.org/project/ucarp | http://www.ucarp.org/project/ucarp | ||
− | |||
− | Configuration | + | '''Configuration''' |
− | + | '''Configuration File''': /usr/local/pcc/ha_flip/flip_config | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | #!/bin/bash | |
− | keep_update(){ | + | MASTER=1 # set 1 if this server is master else set 0 |
− | ip addr list | grep "$FLOATIP" | + | MASTERIP="X.X.X.X" |
− | if [ $? == "0" ] | + | SLAVEIP="Y.Y.Y.Y" |
− | then | + | 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 /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/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/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 | rsync -avzr –rsh=ssh /var/www/* root@$DSTIP:/var/www >> /var/log/ha_flip.log | ||
− | fi | + | fi |
− | } | + | } |
+ | |||
MASTER: If it is master server, set it to 1; otherwise, change it to 0. | MASTER: If it is master server, set it to 1; otherwise, change it to 0. |
نسخهٔ ۳ آوریل ۲۰۱۳، ساعت ۱۲:۲۵
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.