Difference between revisions of "How to change server's IP"
Line 46: | Line 46: | ||
mysql> '''START SLAVE;''' | mysql> '''START 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'''', | 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'''; | ||
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: | Then restart replication link: | ||
mysql> START SLAVE; | mysql> START SLAVE; |
Revision as of 06:39, 7 October 2009
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='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
- What else?