Difference between revisions of "How to change server's IP"

From Kolmisoft Wiki
Jump to navigationJump to search
 
Line 40: Line 40:
= I need to add additional Network Interface Controller (NIC, also known as a network interface card, network adapter, LAN adapter, and by similar terms) =
= I need to add additional Network Interface Controller (NIC, also known as a network interface card, network adapter, LAN adapter, and by similar terms) =


If all details of current interface will remain same, there will be no problems.  
If all details of current interface will remain same, it is not obligatory to contact Kolmisoft Support.


<br><br>
<br><br>


= For MOR users who uses more than 1 MOR billing server =
= For MOR users who uses more than 1 MOR billing server =

Latest revision as of 11:07, 2 December 2014

Warning.png







WARNING! MOR license will NOT work after IP change. Please contact Kolmisoft before procedure to schedule license re-activation.





Main instructions

The basic files which should be changed:

  • /etc/asterisk/h323.conf
  • /etc/asterisk/sip.conf
  • /home/mor/config/environment.rb


In /etc/asterisk/h323.conf change bindaddr variable:

bindaddr = YOUR NEW IP

In /etc/asterisk/sip.conf bindaddr

bindaddr = YOUR NEW IP

Then restart asterisk:

/usr/src/mor/sh_scripts/asterisk_nice_restart.sh


In /home/mor/config/environment.rb change:

Recordings_Folder = "http://YOUR NEW IP/billing/recordings/"
Web_URL = "http://YOUR NEW IP"


Then restart HTTP server:

/etc/init.d/httpd restart




Serial change

Please contact Kolmisoft to activate license under new IP address.



I need to add additional Network Interface Controller (NIC, also known as a network interface card, network adapter, LAN adapter, and by similar terms)

If all details of current interface will remain same, it is not obligatory to contact Kolmisoft Support.



For MOR users who uses more than 1 MOR billing server

  • If server is Asterisk server and GUI on another server:
    • In GUI's menu: Billing - Asterisk Servers change Hostname and Server IP variables there.
    • In Asterisk server open file /etc/asterisk/manager.conf and add the permit=YOUR GUI IP/NETMASK

By default it looks something like this:

[mor]
secret = morsecret
deny=0.0.0.0/0.0.0.0
permit=127.0.0.1/255.255.255.0
read = system,call,log,verbose,command,agent,user,config
write = system,call,log,verbose,command,agent,user,config

After the change it should look something like that:

[mor]
secret = morsecret
deny=0.0.0.0/0.0.0.0
permit=127.0.0.1/255.255.255.0
permit=123.123.123.123/255.255.255.0 ; This is just an example! permit=YOUR GUI IP/NETMASK
read = system,call,log,verbose,command,agent,user,config
write = system,call,log,verbose,command,agent,user,config
  • If Replication?

Lets say you have servers A and B, and you want to give new ip to server B . Login to MySQL in both servers as root, then stop replication link in server A:

mysql> STOP SLAVE;

In server A run:

mysql>CHANGE MASTER TO MASTER_HOST='New IP of server B', MASTER_USER='replication_user', MASTER_PASSWORD='replication_pass', MASTER_LOG_FILE='BINLOG', MASTER_LOG_POS=NEW_POSITION;  

An example how it might look (DO NOT USE THIS LINE FOR YOUR SERVER):

CHANGE MASTER TO MASTER_HOST='111.111.111.111', MASTER_USER='rep2', MASTER_PASSWORD='rep2', MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=98; 

Then restart replication link:

mysql> START SLAVE;

Check if everything is fine by checking running:

mysql> SHOW SLAVE STATUS\G;

You should see:

Slave_IO_State: Waiting for master to send event
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
  • If Heartbeat?

If you want to change shared ip (also known as virtual IP), you have to stop HeartBeat first (in both servers):

/etc/init.d/heartbeat stop

Then edit /etc/ha.d/haresources file, you will see something like that (in both servers):

MASTER OLD IP asterisk

You need to enter new ip there and start heartbeat again (in both servers):

/etc/init.d/heartbeat start



See also