This is an old revision of the document!


How to Use Script Configure High Available and Cluster

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。

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:

 cp /opt/asterisk/scripts/astercc/clusterconf.sh /root 

Enter /root directory,and execute commands as shown below:

 cd /root 
 chmod +x ./clustercc.sh 

Select the type of configuration,input 1 means “HA”,as shown below:

Configure detailed parameters after press “Enter”,as shown below:

Input the parameters as the prompt of script above,press “y” if you confirm parameters above.

You will enter next step after inputing “yes” and the password of slave server twice,script continues to run automatically:

When script is finished,you should log on and shutdown the slave server,execute commands as shown below:

 shutdown -h now 

Then start 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:

 show slave status \G; 

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.

Checking Configuration of Files Synchronization

Execute commands as shown below on Master server first:

 cd /home/ccsync 
Second verify that the “abc” existed or not(maybe there is a few seconds delay):
 ls /home/ccsync/abc 
And then,remove the “abc” file on master server,and check the file whether was also deleted in slave server.
 rm /home/ccsync/abc 
Last,test function of switching between master and slave server.

The Configuration of Cluster

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.

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:

 cp /opt/asterisk/scripts/astercc/clusterconf.sh /root 

Enter /root directory,and execute commands as shown below:

 cd /root 
 chmod +x ./clustercc.sh 

Select the type of configuration,input 2 means “Cluster”,as shown above:

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:

Press “Enter” after inputting the possword of slave server twice,as shown below:

回车继续自动配置

到此配置已全部完成。脚本执行完毕后,登录备机以及只提供pbx服务的其它服务器,并将它们关闭:

 shutdown -h now 

然后重新启动主服务器:

 reboot 
主服务器完全启动后,开启备机及其它服务器。

Checking Database Configuration

检查数据库主备,分别登录主服务器和备机mysql,执行:

 show slave status \G; 
如下图,Slave_IO_Running 和 Slave_SQL_Running 都为Yes,并且无其它错误,说明数据库同步正常。

Checking Configuration of Files Synchronization

Execute commands as shown below on Master server first:

 cd /home/ccsync 
Second verify that the “abc” existed or not(maybe there is a few seconds delay):
 ls /home/ccsync/abc 
And then,remove the “abc” file on master server,and check the file whether was also deleted in slave server.
 rm /home/ccsync/abc 
Last,test function of switching between master and slave server.

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