Quantcast
Channel: HAProxy community - Latest topics
Viewing all articles
Browse latest Browse all 4849

Help newbie get started!

$
0
0

I am new to this so I apologize in advance if this is a silly question. All I am trying to do is allow a request to hit the IP address for server1 in a browser, and have it reach server2 instead. Assume my HAproxy server is 10.10.16.124, server1 is 10.10.18.12, and server2 is 10.10.16.74 (I made up the addresses for security, but they are all on the same network). I have a very simple config file (below). After saving the .cfg file, I run a validation check on it, and restart haproxy. Then on my computer, which has access to all networks, I type the IP address for server1 into the browser and I expect it to bring up the web interface for server2. but nothing happens. It’s like entering an address which does not exist. Here’s the very basic config:

global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
user haproxy
group haproxy
daemon

defaults
log global
mode http
option httplog
option dontlognull
timeout connect 5000ms
timeout client 50000ms
timeout server 50000ms

frontend server1
bind 10.10.18.12:80
default_backend http_back

backend http_back
balance roundrobin
server server2 10.10.16.74:80 check

I feel like I must be missing something very basic, maybe something on the network. 10.10.12.18 does not exist anywhere. It is a new IP address, but it is valid and is in the same network.

In the logs I see this:
Jun 11 15:16:29 rshq-haproxy haproxy[812]: [NOTICE] (812) : haproxy version is 3.0.0-1ppa1~jammy
Jun 11 15:16:29 rshq-haproxy haproxy[812]: [NOTICE] (812) : path to executable is /usr/sbin/haproxy
Jun 11 15:16:29 rshq-haproxy haproxy[812]: [WARNING] (812) : Exiting Master process…
Jun 11 15:16:29 rshq-haproxy haproxy[812]: [ALERT] (812) : Current worker (865) exited with code 143 (Terminated)
Jun 11 15:16:29 rshq-haproxy haproxy[812]: [WARNING] (812) : All workers exited. Exiting… (0)
Jun 11 15:16:30 rshq-haproxy haproxy[22975]: [NOTICE] (22975) : New worker (22977) forked
Jun 11 15:16:30 rshq-haproxy haproxy[22975]: [NOTICE] (22975) : Loading success.
Jun 11 15:42:17 rshq-haproxy haproxy[22977]: 10.10.100.27:63871 [11/Jun/2024:15:42:17.242] http_front http_back/server1 0/0/0/54/54 302 334 - - ---- 2/2/0/0/0 0/0 “GET / HTTP/1.1”
Jun 11 15:42:23 rshq-haproxy haproxy[22977]: 10.10.100.27:63871 [11/Jun/2024:15:42:23.558] http_front http_back/server1 0/0/1/56/57 302 491 - - ---- 2/2/0/0/0 0/0 “GET /login HTTP/1.1”
Jun 11 15:42:39 rshq-haproxy haproxy[22977]: 10.10.100.27:63871 [11/Jun/2024:15:42:39.085] http_front http_back/server1 0/0/0/53/53 302 334 - - ---- 2/2/0/0/0 0/0 “GET / HTTP/1.1”
Jun 11 15:46:26 rshq-haproxy haproxy[22977]: 10.10.100.27:64026 [11/Jun/2024:15:46:26.322] http_front http_back/server1 0/0/0/52/52 302 334 - - ---- 1/1/0/0/0 0/0 “GET / HTTP/1.1”
Jun 11 15:50:12 rshq-haproxy haproxy[22975]: [NOTICE] (22975) : haproxy version is 3.0.0-1ppa1~jammy
Jun 11 15:50:12 rshq-haproxy haproxy[22975]: [NOTICE] (22975) : path to executable is /usr/sbin/haproxy
Jun 11 15:50:12 rshq-haproxy haproxy[22975]: [WARNING] (22975) : Exiting Master process…

Just to note, 10.10.100.27 is my machine. I assume this reflects my attempt to go to 10.10.18.12 in the browser. I have access to all networks and can access other devices on the same network as those other IP’s.
Any idea what I am doing wrong? Is something left out of the .cfg file? I plan on doing more complex SSL termination and redirection (no load balancing) but I just want to know my haproxy machine is even working first. I will also note the haproxy machine has only one network interface.

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 4849

Trending Articles