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

From Kolmisoft Wiki
Jump to navigationJump to search
 
(12 intermediate revisions by 4 users not shown)
Line 1: Line 1:
[[Image:warning.png|left|250px]]
<br><br><br><br><br><br>
'''WARNING!''' '''MOR license will NOT work after IP change. Please contact Kolmisoft before procedure to schedule license re-activation.'''
<br><br><br><br><br><br>
= Main instructions =
The basic files which should be changed:
The basic files which should be changed:
* /etc/asterisk/h323.conf
* /etc/asterisk/h323.conf
Line 8: Line 14:
  bindaddr = '''YOUR NEW IP'''
  bindaddr = '''YOUR NEW IP'''


In /etc/asterisk/sip.conf bindaddr and realm
In /etc/asterisk/sip.conf bindaddr
  bindaddr = '''YOUR NEW IP'''
  bindaddr = '''YOUR NEW IP'''
realm = '''YOUR NEW IP'''


Then restart asterisk:
Then restart asterisk:
Line 24: Line 29:
  /etc/init.d/httpd restart
  /etc/init.d/httpd restart


== For MOR users who uses more than 1 MOR PRO 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.<br>
<br><br>
Then open file /etc/asterisk/manager.conf and add the permit='''YOUR GUI IP'''/'''NETMASK'''
 
= Serial change =
 
Please contact Kolmisoft to activate license under new IP address.
 
<br><br>
 
= 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.
 
<br><br>
 
= 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.<br>
**In Asterisk server open file /etc/asterisk/manager.conf and add the permit='''YOUR GUI IP'''/'''NETMASK'''


By default it looks something like this:
By default it looks something like this:
Line 50: Line 71:
* If Replication?
* 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:
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> '''START SLAVE;'''
  mysql> '''STOP SLAVE;'''
In server A run:
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''';   
  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''';   
Line 72: Line 93:
You need to enter new ip there and start heartbeat again (in both servers):
You need to enter new ip there and start heartbeat again (in both servers):
  /etc/init.d/heartbeat start
  /etc/init.d/heartbeat start
* What else?
<br><br>
=== See also===
 
*[[How_to_change_server_IP_address_from_DHCP_to_static%3F|Changing server IP from DHCP to static]]
<br><br>

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