How to change server's IP

From Kolmisoft Wiki
Revision as of 10:27, 19 August 2009 by Admin (talk | contribs) (New page: The basic files which should be changed: * /etc/asterisk/h323.conf * /home/mor/config/environment.rb In /etc/asterisk/h323.conf: bindaddr = '''YOUR NEW IP''' Then reload asterisk: /etc...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

The basic files which should be changed:

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


In /etc/asterisk/h323.conf:

bindaddr = YOUR NEW IP

Then reload asterisk:

/etc/init.d/asterisk reload


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

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.
Then 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> START SLAVE;

In server A run:

mysql>CHANGE MASTER TO MASTER_HOST='New IP of server B', MASTER_USER='rep1', MASTER_PASSWORD='rep1', 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
  • What else?