Hi,

Le 04/03/2015 21:52, James Candalino a écrit :
Hi All,

I'm having some difficulty in getting my peers working with a two node
setup.

Here the config section in question:

peers PRSPEERS
     peer prod-portal-rest-hap-1
prod-portal-rest-hap-2.xxx.xxxxxxxxxxxxxxx.com:4000
<http://prod-portal-rest-hap-2.xxx.xxxxxxxxxxxxxxx.com:4000/>
     peer prod-portal-rest-hap-2
prod-portal-rest-hap-2.xxx.xxxxxxxxxxxxxxx.com:4000
<http://prod-portal-rest-hap-2.xxx.xxxxxxxxxxxxxxx.com:4000>


When I try to verify the config (haproxy -c -f /etc/haproxy/haproxy.cfg)
it gives me the following:

Starting haproxy: [WARNING] 062/203815 (4217) : Removing incomplete
section 'peers PRSPEERS' (no peer named 'prod-portal-rest-hap-2.xxx.xxxx').

This means your local hostname returns "prod-portal-rest-hap-2.xxx.xxxx", so haproxy wants a peer named "prod-portal-rest-hap-2.xxx.xxxx" to identify the local peer.

Both nodes can resolve each others host names (fully qualified and
short). I sort of at a loss to explain why this is occurring.

2 solutions :
1. rename your peers, for example :
peer prod-portal-rest-hap-1.xxx.xxxx prod-portal-rest-hap-2.xxx.xxxxxxxxxxxxxxx.com:4000 peer prod-portal-rest-hap-2.xxx.xxxx prod-portal-rest-hap-2.xxx.xxxxxxxxxxxxxxx.com:4000

2. or use the "-L" command line option to identify the local peer in your configuration :
- on the first instance :
haproxy -c -f /etc/haproxy/haproxy.cfg -L prod-portal-rest-hap-1
- on the second instance :
haproxy -c -f /etc/haproxy/haproxy.cfg -L prod-portal-rest-hap-2

See http://cbonte.github.io/haproxy-dconv/configuration-1.5.html#peer
and the <peername> argument for more details.

--
Cyril Bonté

Reply via email to