Invalid Hostname for Server 1 Please Review Your Configuration
What is Loftier availability?
High availability is a system design protocol and associated implementation that ensures a certain absolute degree of operational continuity during a given measurement period.
Lets say you accept ii servers 'A' and 'B' with MOR installed, MySQL is running replication between them. By default all trafic comming to server 'A' is monitored by server 'B', so when server 'A' fails, server 'B' stands in its position by given time.
So allmost no data is lost, and your users volition be happy with your services.
What is Heartbeat?
Heartbeat is software which implements these monitoring and availability features for your servers. It must exist carrefully installed, configured and tested on both servers to ensure right producing of services.
What do you need to know earlier starting
Please review again the provided above scheme. Information technology represents a typical Linux Heartbeat configuration. Before starting you have to be aware of 4 main points:
1. All public IP addresses accept to exist on same subnet.
ii. Virtual IP has to be free (not assigned to any device on the network) and the last octet of the address (in this case .4 is the last octet) has to be the highest in the configuration. Server A and B accept to be on "lower" IP, in this case .2 and .3 (the last octet).
3. Never use servers when they are off-line equally it volition ruin the MySQL replication.
4. After heartbeat configuration has been made, do non change the addressing scheme or the host-names of the servers.
Installation
Hearbeat two.99 has been full tested on Centos 5.2 only, there is no guarantee that it will work on older versions or distros.
Download mor install scripts from svn. in both servers.
Run /usr/src/mor/sh_scripts/install_heartbeat.sh in both servers
Script will:
* download special file, then yum automaticaly install correct heartbeat files for your organisation. * install pacemaker, its hereafter only. * configure /etc/ha.d/authkeys so y'all don't need to modify annihilation here * configure /etc/ha.d/ha.cf file, but you notwithstanding demand adapt it by hand (how? afterward on this page). * configure /etc/ha.d/haresources file, merely you nonetheless demand to modify few $.25 there, also, later on this page. * add iii lines to /etc/hosts, but but for testing purposes only, so you lot volition have to change IPs here.
Attention: if you installed Heartbeat manually, please make sure that you have same version of Heartbeat on both servers. You lot will probably demand aforementioned Centos version on both servers to do that.
Configuration
Before going farther, yous need to setup hostname of both servers. Make sure main will have node01 and slave node02. (uname -n) must return right words.
Make sure to remove all services which are related to Heartbeat from the runlevels:
chkconfig --list
If you want to turn off startup for service (for example asterisk):
chkconfig asterisk off
Edit /etc/sysconfig/network to change your hostname. Then reboot your machine.
First configure principal (node01):
Open /etc/hosts and you will see something like this:
192.168.0.131 node01 #change to right IP 192.168.0.132 node02 #change to correct IP here aswell 192.168.0.130 virtual_ip #alter 192.168.0.130 to correct virtual IP here
Change IP of node01 to master machine, which "take all incoming traffic by default".
Change IP of node02 to slave machine which "take all information, if principal will dice".
Alter IP of virtual_ip to virtual IP of the organization (the same IP which we will use subsequently in /etc/ha.d/haresources)
Notation: node01 and node02 should be replaced with actual hostnames of master and slave server if they are not set up to node01 and node02 respectively, while virtual_ip is static and you exercise need to change it, but change IP to actual organization virtual IP.
Open up /etc/ha.d/ha.cf and alter:
Deadtime higher or lower setting. Deadtime means how many seconds have to laissez passer earlier accept over job from master.
Call back, this should exist lower on on "lightly" loaded machines, and higher and "highly" loaded machines.
Deadtime 10 is more than enough. (Default is 5)
Make sure you add 2 network interfaces for heartbeat broadcasts.
The ucast directive configures Heartbeat to communicate over a UDP unicast communications link.
For example 'ucast eth0 10.x.10.133'.
This directive volition cause us to transport packets to 10.ten.10.133 over interface eth0.
If you like to employ more than one interface for communication between nodes, you can add together multiple lines with ucast directive.
The udpport directive is used to configure which port is used for these unicast communications if the udpport directive is specified before the ucast directive, otherwise the default port will be used.
Now open /etc/ha.d/haresources (be sure to leave only the lines given below):
node01 203.0.113.4 asterisk # but for testing, remember this ip tin't exist used in your network!!!
Or
node01 IPaddr::192.168.0.142/24/eth0:0 httpd # just for testing, remember this ip can't be used in your network!!! # if eth0:0 does not appear
And then, first of all:
Bold node01 is primary and node02 is slave, by default all traffic is going to node01.
You need to cull IP (for Virtual IP) from your network and never use information technology, otherwise this will atomic number 82 to unexpected results.
node01 203.0.113.four asterisk, "if master is expressionless, slave (node02) will restart asterisk and offset to accept traffic comming from 203.0.113.4"
Now copy all configuration to slave (node02).
scp -r /etc/ha.d/ root@node02:/etc/
VERY Of import After copying configs to another node, open up /etc/ha.d/ha.cf on both nodes and alter IP in ucast directive.
node01 should have node02 IP at that place; node02 should have node01 IP there.
Start heartbeat on both servers by running /etc/init.d/heartbeat get-go. If everything will be ok, you will encounter something like this:
Starting High-Availability services: 2008/12/18_18:xiii:22 INFO: Resource is stopped [ OK ]
Practice not forget to remove Asterisk from arrangement startup, considering information technology needs to be started past Heartbeat:
chkconfig asterisk off
on both servers.
Testing
At present run iptraf on both machines, from another machine start pinging your binded IP accost (in this instance we speak most 203.0.113.4).
Bank check for masters iptraf window, you will run into incoming ICMP information, slave have to be quiet.
At present kill master (for example: ifconfig eth0 down or issue a reboot), later brusque menses of time (on this example 5 seconds) on slave you will see incoming ICMP packets.
To bring principal to work again, first of all y'all have to configure network on master and start heartbeat. After xx~ seconds master have to start doing his job again.
At present get to GUI and change your default asterisk server IP (Settings -> Servers), change from 127.0.0.1 to virtual IP address. If your GUI is unable connect to them, brand sure both asterisk servers let connections from your GUI server. (file: /etc/asterisk/managing director.conf)
sip.conf
In file /etc/asterisk/sip.conf enter correct IP for value bindaddr, correct IP = IP to which your devices are registering. East.grand. Virtual IP.
Practise same changes for bindaddr in iax.conf, h323.conf and manager.conf
Restart Asterisk
Make this on both servers.
arrangement.conf
In file /etc/mor/organization.conf add variable VIRTUAL_IP with correct virtual IP
VIRTUAL_IP=xx.xx.20.xx
mor.conf
On slave server become to /etc/asterisk/mor.conf and set server_id = 2 (default is one)
Possible bug
Look at the flick:
In this example HeartBeat in ucast directive has only one interface configured on both servers: eth1
This can lead to problems if the link eth1 <----> eth1 between the servers fails (broken cable, switch, NIC, etc)
It is recommended to specify at least 2 interfaces in ucast directive
The ucast directive is used to configure which interfaces Heartbeat sends UDP traffic on and to which IP.
An case of ucast directive:
ucast eth0 1.one.ane.ane ucast eth1 1.i.1.1
Virtual interface does not announced
Check /var/log/heartbeat.log
If you tin see something like:
... ResourceManager(default)[6106]: 2012/12/07_11:33:51 info: Running /etc/ha.d/resources.d/IPaddr 123.123.123.123 start IPaddr(IPaddr_123.123.123.123)[6197]: 2012/12/07_11:33:51 Fault: /usr/lib64/heartbeat/findif failed [rc=1]. /usr/lib/ocf/resources.d//heartbeat/IPaddr(IPaddr_123.123.123.123)[6183]: 2012/12/07_11:33:51 ERROR: Generic fault ...
Please add together subnet mask and interface to /etc/ha.d/haresources similar this:
node01 123.123.123.123/27/em1 asterisk
Virtual interface appears on both nodes
Bank check if servers tin can send packets through port UDP 694 to each other (both directions). Firewalls may block that port.
Cheque if /etc/ha.d/haresources has properly divers "node01" (or relevant hostname) on both servers.
There is more than than ane HA cluster in the aforementioned subnet
Nosotros can doubtable that there is some other HA cluster runing if in /var/log/heartbeat.log nosotros run into such output:
Nov 06 13:25:28 node01 heartbeat: [9200]: WARN: Invalid hallmark blazon [3] in bulletin! November 06 13:25:28 node01 heartbeat: [9200]: WARN: string2msg_ll: node [cpc2] failed authentication
So we need to alter port in /etc/ha.d/ha.cf like this:
logfile /var/log/heartbeat.log logfacility local0 keepalive 6 deadtime 20 # depends on load, and then exist conscientious! initdead 60 # start time udpport 496 # UDPPORT SHOULD COME IN Forepart OF UCAST LINE OTHERWISE PORT WON'T Be Changed ucast eth0 one.1.one.ane auto_failback on node node01 node node02
Sometimes solution to a higher place does not help, so information technology is a adept practice to generate new The authkeys files on both servers.
You may create an authkeys file using this control:
( echo -ne "auth one\n1 sha1 "; \ dd if=/dev/urandom bs=512 count=1 | openssl md5 ) \ > /etc/ha.d/authkeys chmod 0600 /etc/ha.d/authkeys
Heartbeat service does not kickoff
In that location is was bug with resource-agents-iii.9.2-21.el6_4.8.x86_64 packet.
Make sure that packets "heartbeat" and "resource-agents" are up to appointment.
Command to update:
yum install heartbeat resources-agents
More details: http://bugs.centos.org/view.php?id=6727
Two Virtual IPs
Lets say, we have 2 network interfaces - eth0 and eth1.
We need ii Virtual IPs for each interface.
For example:
192.168.0.179 for eth0 interface 192.168.0.180 for eth1 interface
Add 2nd Virtuap IP to /etc/ha.d/haresources and specify network interface to which yous desire to assign Virtual IP:
node01 192.168.0.179 asterisk/24/eth0 # merely for testing, remember this ip tin can't be used in your network!!! node01 192.168.0.180 asterisk/24/eth1 # just for testing, recall this ip can't be used in your network!!!
Cheque on node2 server if Virtual IPs are assigned correctly. Blazon command:
ip a
Yous should get similar output:
[root@kolmisoft2 ~]# ip a 1: lo: <LOOPBACK,Upward,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/eight scope host lo inet6 ::1/128 telescopic host valid_lft forever preferred_lft forever ii: eth0: <Broadcast,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast country Upwardly qlen 1000 link/ether 08:00:27:3d:bc:8c brd ff:ff:ff:ff:ff:ff inet 192.168.0.139/24 brd 192.168.0.255 scope global eth0 inet 192.168.0.179/24 brd 192.168.0.255 scope global eth0 inet6 fe80::a00:27ff:fe3d:bc8c/64 scope link valid_lft forever preferred_lft forever 3: eth1: <BROADCAST,MULTICAST,Up,LOWER_UP> mtu 1500 qdisc pfifo_fast state Upward qlen 1000 link/ether 08:00:27:e6:09:23 brd ff:ff:ff:ff:ff:ff inet 192.168.0.140/24 brd 192.168.0.255 scope global eth1 inet 192.168.0.180/24 brd 192.168.0.255 scope global eth1 inet6 fe80::a00:27ff:fee6:923/64 scope link valid_lft forever preferred_lft forever
Switching resource manually
It is possible to switch resources manually by using scripts in /usr/share/heartbeat
hb_standby - releases resources on agile server
hb_takeover - takes over resources on standby server
it should exist enough to run one of it on one of servers.
Run into as well
High availability (Heartbeat clustering)
http://www.linux-ha.org/wiki/Haresources
Source: https://wiki.kolmisoft.com/index.php/Heartbeat_configuration
0 Response to "Invalid Hostname for Server 1 Please Review Your Configuration"
Postar um comentário