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...' ایجاد کرد)
 
 
(۲ ویرایش میانی توسط یک کاربر نشان داده نشده‌است)
سطر ۱: سطر ۱:
 
<div dir=ltr lang=en>
 
<div dir=ltr lang=en>
−
High Availability
 
  
−
We use "UCARP" software make sure PCC is always available.
+
'''We use "UCARP" software make sure PCC is always available.'''
 +
 
  
−
HA
 
 
How does UCARP work?
 
How does UCARP work?
  
 
  http://www.ucarp.org/project/ucarp
 
  http://www.ucarp.org/project/ucarp
−
Configuration
 
  
−
Configuration File: /usr/local/pcc/ha_flip/flip_config
+
'''Configuration'''
  
−
#!/bin/bash
+
'''Configuration File''': /usr/local/pcc/ha_flip/flip_config
−
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"
+
  
−
 
+
#!/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.
−
    MASTERIP: Set master server IP address
+
  '''MASTERIP''': Set master server IP address
−
    SLAVEIP: Set slave server IP address
+
  '''SLAVEIP''': Set slave server IP address
−
    FLOATIP: Set float IP address
+
  '''FLOATIP''': Set float IP address
−
    Device: The interface to use for sending advertise packets  
+
  '''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>

نسخهٔ کنونی تا ‏۳ آوریل ۲۰۱۳، ساعت ۱۲:۳۳

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.

ابزارهای شخصی

گویش‌ها
فضاهای نام
عملکردها
گشتن
جعبه‌ابزار