<commit_before>################################################
#
#              Generated by Chef
#
################################################

global
  daemon
  user haproxy
  group haproxy
  pidfile /var/run/haproxy.pid
  stats socket /var/run/haproxy/haproxy.asok level admin
  log /dev/log local0 info
  maxconn 8000

defaults
  log global
  source <%=node['bcpc']['management']['monitoring']['vip']%>
  mode http
  option http-server-close
  option abortonclose
  option tcplog
  option dontlognull
  option nolinger
  option redispatch
  retries 3
  timeout http-request 10s
  timeout queue 1m
  timeout connect 5s
  timeout check 10s
  timeout client 30m
  timeout server 30m

listen mysql-galera <%=node['bcpc']['management']['monitoring']['vip']%>:3306
  timeout client 24h
  timeout server 24h
  mode tcp
  balance leastconn
  option tcplog
  option tcpka
  option httpchk
<% @servers.each do |server| -%>
  <%= "server #{server['hostname']} #{server['bcpc']['management']['ip']}:3306 check port 3307 inter 5s rise 1 fall 1 observe layer4" %>
<% end -%>

frontend https
  bind <%=node['bcpc']['management']['monitoring']['vip']%>:443 ssl crt /etc/haproxy/haproxy.pem
  option tcplog
  stats enable
  stats uri /haproxy
  stats hide-version
  stats realm Haproxy\ Statistics
  stats auth <%=get_config('haproxy-stats-user')%>:<%=get_config('haproxy-stats-password')%>
  reqadd X-Forwarded-Protocol:\ https
  acl kibana_missing_slash path_reg ^/kibana[^/]*$
  redirect code 301 prefix / append-slash if kibana_missing_slash
  acl url_kibana path_beg /kibana
  use_backend kibana-backend if url_kibana
  acl url_elasticsearch path_beg /elasticsearch
  use_backend elasticsearch-backend if url_elasticsearch
  acl url_zabbix path_beg /zabbix<commit_msg>Avoid MySQL deadlocks with Zabbix<commit_after>################################################
#
#              Generated by Chef
#
################################################

global
  daemon
  user haproxy
  group haproxy
  pidfile /var/run/haproxy.pid
  stats socket /var/run/haproxy/haproxy.asok level admin
  log /dev/log local0 info
  maxconn 8000

defaults
  log global
  source <%=node['bcpc']['management']['monitoring']['vip']%>
  mode http
  option http-server-close
  option abortonclose
  option tcplog
  option dontlognull
  option nolinger
  option redispatch
  retries 3
  timeout http-request 10s
  timeout queue 1m
  timeout connect 5s
  timeout check 10s
  timeout client 30m
  timeout server 30m

listen mysql-galera <%=node['bcpc']['management']['monitoring']['vip']%>:3306
  timeout client 24h
  timeout server 24h
  mode tcp
  balance leastconn
  option tcplog
  option tcpka
  option httpchk
<% @servers.each do |server| -%>
  <%= "server #{server['hostname']} #{server['bcpc']['management']['ip']}:3306 check port 3307 inter 5s rise 1 fall 1 observe layer4 backup" %>
<% end -%>

frontend https
  bind <%=node['bcpc']['management']['monitoring']['vip']%>:443 ssl crt /etc/haproxy/haproxy.pem
  option tcplog
  stats enable
  stats uri /haproxy
  stats hide-version
  stats realm Haproxy\ Statistics
  stats auth <%=get_config('haproxy-stats-user')%>:<%=get_config('haproxy-stats-password')%>
  reqadd X-Forwarded-Protocol:\ https
  acl kibana_missing_slash path_reg ^/kibana[^/]*$
  redirect code 301 prefix / append-slash if kibana_missing_slash
  acl url_kibana path_beg /kibana
  use_backend kibana-backend if url_kibana
  acl url_elasticsearch path_beg /elasticsearch
  use_backend elasticsearch-backend if url_elasticsearch
  acl url_zabbix path_beg /zabbix
{'fraction_non_alphanumeric': 0.15453779151447036, 'fraction_numerical': 0.02360213543130093, 'mean_word_length': 4.579937304075235, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2494093', 'n_tokens_mistral': 1264, 'n_tokens_neox': 1157, 'n_words': 316}