This is an old revision of the document!


A PCRE internal error occured. This might be caused by a faulty plugin

====== How to Use Script Configure High Available and Cluster ====== <note tip> High Available(HA):There are two servers of asterCC,master server runs all service(PBX,CTI,WEB,DATABASE) via virtual IP,the secondary server that can take over virtual IP from the master,it will work via virtual IP when the master is shutdown according to detecting the master by heartbeat IP。 </note> ===== The Configuration of Master/Slave Server ===== ==== Information of Sample ==== **Master Server**: Service IP:192.168.1.120(Used in trunk and device registration) eth0:192.168.1.234,this is primary IP of master server eth0:1 ,the name of virtual NIC,it is disabled default eth1:10.10.10.1,the heartbeat IP **Slave Server**: eth0:192.168.1.235,this is primary IP of slave server eth0:1 ,the name of virtual NIC,it is disabled default eth1:10.10.10.2,the heartbeat IP ==== The Script file:clusterconf.sh ==== After configuring eth0 and IP,and finish the installation of AsterCC,then you should download and send the "identity" to support@astercc.org for obtaining authorization.We will configure them through clusterconf.sh. First,copy /opt/asterisk/scripts/astercc/clusterconf.sh to /root/ directory: <code> cp /opt/asterisk/scripts/astercc/clusterconf.sh /root </code> Enter /root directory,and execute commands as shown below: <code> cd /root </code> <code> chmod +x ./clustercc.sh </code> Select the type of configuration,input 1 means "HA",as shown below: {{:en:faq:ha_and_cluster01.png?600|}} Configure detailed parameters after press "Enter",as shown below: {{:en:faq:ha_and_cluster02.png?700|}} Input the parameters as the prompt of script above,press "y" if you confirm parameters above. {{:en:faq:ha_and_cluster03.png?700|}} You will enter next step after inputing "yes" and the password of slave server twice,script continues to run automatically: {{:zh:常见问题及解答:脚本配置主备4.png?700|}} {{:en:faq:ha_and_cluster04.png?700|}} {{:zh:常见问题及解答:脚本配置主备5.png?700|}} {{:en:faq:ha_and_cluster05.png?700|}} When script is finished,you should log on and shutdown the slave server,execute commands as shown below: <code> shutdown -h now </code> Then reboot the slave server after the master server is restarted completely: <code> reboot </code> ==== Checking Database Configuration ==== You should log on two database servers separately,execute commands as shown below: <code> show slave status \G; </code> As shown below,the values of "Slave_IO_Running" and "Slave_SQL_Running" are "Yes",and others are normal.It is demonstrated the synchronization of database is available. {{:en:faq:ha_and_cluster06.png?700|}} ==== Checking Configuration of Files Synchronization ==== Execute commands as shown below on Master server first: <code> cd /home/ccsync </code> Second verify that the "abc" existed or not(maybe there is a few seconds delay): <code> ls /home/ccsync/abc </code> And then,remove the "abc" file on master server,and check the file whether was also deleted in slave server. <code> rm /home/ccsync/abc </code> Last,test function of switching between master and slave server. ===== The Configuration of Cluster ===== <note tip> Cluster:At least three servers running simultaneously,the master server run all services,include:PBX,CTI,database,WebService,slave server will run PBX,CTI,database backup,others run PBX and CTI.Although all of the servers run PBX and CTI simultaneously,they use one database,and same configuration of PBX and CTI.We can operate on master server,the database and web services supported to other servers via a virtual IP.The slave server will take over database and web services from master when master is abnormal. </note> ==== Information of Sample ==== **Master Server**: eth0:Service IP:192.168.1.234 (Used in trunk and device registration). eth0:1,the name of virtual NIC,this is primary IP of master server:192.168.1.120(used in database and web services). eth1:10.10.10.1,the heartbeat IP. **Slave Server(backup server)**: eth0:192.168.1.235 ,the primary IP of PBX service(Used in trunk and device registration). eth0:1,the name of virtual NIC,it is disabled default. eth1:10.10.10.2,the heartbeat IP. **Cluster Server**: eth1:192.168.1.245,the NIC of PBX service. ==== The Script file:clusterconf.sh ==== After configuring eth0 and IP,and finish the installation of AsterCC,then you should download and send the "identity" to support@astercc.org for obtaining authorization.We will configure them through clusterconf.sh. First,copy /opt/asterisk/scripts/astercc/clusterconf.sh to /root/ directory: <code> cp /opt/asterisk/scripts/astercc/clusterconf.sh /root </code> Enter /root directory,and execute commands as shown below: <code> cd /root </code> <code> chmod +x ./clustercc.sh </code> {{:zh:常见问题及解答:脚本配置主备7.png?700|}} Select the type of configuration,input 2 means "Cluster",as shown above: {{:zh:常见问题及解答:脚本配置主备8.png?700|}} Input the parameters as the prompt of script above,press "y" and "Enter" if you confirm parameters above.Then,you will enter next step after inputing "yes" and the password of slave server twice,script continues to run automatically: {{:zh:常见问题及解答:脚本配置主备9.png?700|}} Press "Enter" after inputting the possword of slave server twice,as shown below: {{:zh:常见问题及解答:脚本配置主备10.png?700|}} {{:zh:常见问题及解答:脚本配置主备11.png?700|}} Press "Enter" to continue the configuration automatically,as shown below: {{:zh:常见问题及解答:脚本配置主备12.png?700|}} {{:zh:常见问题及解答:脚本配置主备13.png?700|}} So far,the configuration is finished.After the script is finished,log and shutdown the slave server and other servers that running PBX service only: <code> shutdown -h now </code> And then reboot the master server,execute command as shown below: <code> reboot </code> Then poweron the slave server and other servers after the master server is restarted completely. ==== Checking Database Configuration ==== You should log on two database servers separately,execute commands as shown below: <code> show slave status \G; </code> As shown below,the values of "Slave_IO_Running" and "Slave_SQL_Running" are "Yes",and others are normal.It is demonstrated the synchronization of database is available. {{:zh:常见问题及解答:脚本配置主备14.png?700|}} ==== Checking Configuration of Files Synchronization ==== Execute commands as shown below on Master server first: <code> cd /home/ccsync </code> Second verify that the "abc" existed or not(maybe there is a few seconds delay): <code> ls /home/ccsync/abc </code> And then,remove the "abc" file on master server,and check the file whether was also deleted in slave server. <code> rm /home/ccsync/abc </code> Last,test function of switching between master and slave server.

en/faq/how_to_use_script_configure_high_available_and_cluster.1441948285.txt.gz · Last modified: 2017/12/12 03:11 (external edit)
Recent changes RSS feed Debian Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki