Load Balancing Question

Before you post: Your responses to these questions will help the community help you. Please complete this template if you’re asking a support question.
Don’t forget to select tags to help index your topic!

1. Describe your incident:
Can’t get load balancing to work for web-server (or maybe I don’t understand the concept)

2. Describe your environment:

  • OS Information:
    All nodes are Debian 12

  • Package Version:
    5.1.sumthin

  • Service logs, configurations, and environment variables:
    haproxy

frontend www-http
	bind *:80
	option forwardfor
	http-request add-header X-Forwarded-Host %[req.hdr(host)]
	http-request add-header X-Forwarded-Server %[req.hdr(host)]
	http-request add-header X-Forwarded-Port %[dst_port]
	acl is_graylog hdr_dom(host) -i -m str graylog.example.com
	use_backend grayserver

backend grayserver
	balance roundrobin
	option httpchk HEAD /apit/system/libstatus
	http-request set-header X-Graylog-Server-URL http://graylog.example.com/
	server grayserver1 192.168.128.114:9000 maxconn 20 check
	server grayserver2 192.168.128.115:9000 maxconn 20 check
	server grayserver3 192.168.128.116:9000 maxconn 20 check

server.conf (note: every server has the same config except 114 is leader true, 115, 116 is leader false and the below ip’s are consistent (i.e. .114 has .114 in lieu of “xxx”, etc.)

###############
# HTTP settings
###############

#### HTTP bind address
#
# The network interface used by the Graylog HTTP interface.
#
# This network interface must be accessible by all Graylog nodes in the cluster and by all clients
# using the Graylog web interface.
#
# If the port is omitted, Graylog will use port 9000 by default.
#
# Default: 127.0.0.1:9000
http_bind_address = 192.168.128.114:9000
#http_bind_address = [2001:db8::1]:9000

#### HTTP publish URI
#
# The HTTP URI of this Graylog node which is used to communicate with the other Graylog nodes in the cluster and by all
# clients using the Graylog web interface.
#
# The URI will be published in the cluster discovery APIs, so that other Graylog nodes will be able to find and connect to this Graylog node.
#
# This configuration setting has to be used if this Graylog node is available on another network interface than $http_bind_address,
# for example if the machine has multiple network interfaces or is behind a NAT gateway.
#
# If $http_bind_address contains a wildcard IPv4 address (0.0.0.0), the first non-loopback IPv4 address of this machine will be used.
# This configuration setting *must not* contain a wildcard address!
#
# Default: http://$http_bind_address/
http_publish_uri = http://192.168.128.114/

#### External Graylog URI
#
# The public URI of Graylog which will be used by the Graylog web interface to communicate with the Graylog REST API.
#
# The external Graylog URI usually has to be specified, if Graylog is running behind a reverse proxy or load-balancer
# and it will be used to generate URLs addressing entities in the Graylog REST API (see $http_bind_address).
#
# When using Graylog Collector, this URI will be used to receive heartbeat messages and must be accessible for all collectors.
#
# This setting can be overriden on a per-request basis with the "X-Graylog-Server-URL" HTTP request header.
#
# Default: $http_publish_uri
http_external_uri = http://graylog.example.com/

#### Enable CORS headers for HTTP interface
#
# This allows browsers to make Cross-Origin requests from any origin.
# This is disabled for security reasons and typically only needed if running graylog
# with a separate server for frontend development.
#
# Default: false
#http_enable_cors = false

3. What steps have you already taken to try and solve the problem?

2-days of google-foo and utilizing the config recommended by Graylog
https://go2docs.graylog.org/5-0/setting_up_graylog/web_interface.htm#making-the-web-interface-work-with-load-balancersproxies

4. How can the community help?

Just hoping there is a solution (well I know there is, I just don’t know it, yet).

Thank you!

Helpful Posting Tips: Tips for Posting Questions that Get Answers [Hold down CTRL and link on link to open tips documents in a separate tab]

hey @accidentaladmin

Not sure what you using for load balancing but @aaronsachs has a pretty good post here for nginx might want to check out his configurations.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.