Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am trying to get HAProxy running. I have the puppet master setup serving configurations to two agents. One is the HAproxy server and the other is a simple web server (certname=webserver2). HAproxy is being deployed by puppet on the proxy server as expected, but the generated HAProxy configuration is what I don't understand. I do not see any single reference to the IP address of webserver2 to which the traffic should be forwarded. All IPs included in the haproxy config are those of the HAProxy server itsself.

I am likely misunderstanding something or missing something that should be done. Please help me through this. My goal is to balance (round robin) traffic to two servers webserver1 and webserver2

Here is my puppet master site.pp:

node /^haproxy.*/ {
  Haproxy::Balancermember <<| listening_service == 'puppet00' |>>
  class { 'haproxy': }
  haproxy::listen { 'puppet00': 
      ipaddress => $::ipaddress,
      ports => ['55672','5672'], }
  }
 node 'webserver2' {
  @@haproxy::balancermember {
        $fqdn: listening_service => 'puppet00',
        server_names => $::hostname,
        ipaddresses => $::ipaddress,
        ports => ['55672','5672'],
            options => 'check'
  }
}

Here is the haproxy.cfg that is generated:

global
  chroot  /var/lib/haproxy
  daemon
  group  haproxy
  log  10.28.92.145 local0
  maxconn  4000
  pidfile  /var/run/haproxy.pid
  stats  socket /var/lib/haproxy/stats
  user  haproxy

defaults
  log  global
  maxconn  8000
  option  redispatch
  retries  3
  stats  enable
  timeout  http-request 10s
  timeout  queue 1m
  timeout  connect 10s
  timeout  client 1m
  timeout  server 1m
  timeout  check 10s

listen puppet00 10.28.92.145:55672,10.28.92.145:5672
  balance  roundrobin
  option  tcplog
  option  ssl-hello-chk
share|improve this question
    
If you remove listening_service from the instantiation? Does it help? I understand you probably need it but it may point us to the right problem. –  François Beausoleil Apr 29 '13 at 14:35
    
Is the problem with exported resources or the puppet manifest? What happens if you declare the balancermember on the HAProxy node without using exported resources? –  Philip Cristiano Apr 30 '13 at 2:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.