Welcome! Log In Create A New Profile

Advanced

tcp stream load balancer not working on Oracle Linux 7.5

Brendan Doyle
May 07, 2019 06:28PM
Hi,

I'm trying to get a basic tcp load balancer working on OL :

cat /etc/oracle-release
Oracle Linux Server release 7.5

My config is very basic:

stream {
        upstream backend_stream {
                server 10.129.87.160:5000;
                server 10.129.87.120:5000;
        }

        server {
                listen        5000;
        proxy_pass backend_stream;
        }
}

On both 10.129.87.160 & 10.129.87.120 I run 'nc -l 5000' to start a
listening process:

# ssh 10.129.87.160 "netstat -ntpl | grep 5000"
tcp        0      0 0.0.0.0:5000            0.0.0.0:* LISTEN      1360/nc
tcp6       0      0 :::5000                 :::* LISTEN      1360/nc

#ssh 10.129.87.160 "netstat -ntpl | grep 5000"
tcp        0      0 0.0.0.0:5000            0.0.0.0:* LISTEN      1360/nc
tcp6       0      0 :::5000                 :::* LISTEN      1360/nc

On my load balancer I can see nginx master listening on port 5000:

# netstat -ntpl | grep nginx
tcp        0      0 0.0.0.0:5000            0.0.0.0:* LISTEN     
22729/nginx: master
tcp        0      0 0.0.0.0:80              0.0.0.0:* LISTEN     
22729/nginx: master
tcp6       0      0 :::80                   :::* LISTEN     
22729/nginx: master

I use nmap to contact the listening process, first try directly to one
of the backend
servers to make sure it is all working:
# nmap -p 5000 10.129.87.120

Starting Nmap 6.40 ( http://nmap.org ) at 2019-05-07 17:28 EDT
Nmap scan report for ovn87-120.us.oracle.com (10.129.87.120)
Host is up (0.00032s latency).
PORT     STATE SERVICE
5000/tcp open  upnp
MAC Address: 52:54:00:4A:4E:80 (QEMU Virtual NIC)

Nmap done: 1 IP address (1 host up) scanned in 0.12 seconds

Now try to the load balancer, whilst also snooping on the backend
servers to see
if the request is directed there:

# nmap -p 5000 10.129.87.162

Starting Nmap 6.40 ( http://nmap.org ) at 2019-05-07 17:30 EDT
Nmap scan report for ovn87-162 (10.129.87.162)
Host is up (0.00015s latency).
PORT     STATE SERVICE
5000/tcp open  upnp
MAC Address: 00:10:E0:8E:95:32 (Oracle)

Nmap done: 1 IP address (1 host up) scanned in 0.10 seconds

I get a response from the load balancer, nothing is directed to either
server.
And nothing shows up in /var/log/nginx/access.log  or
/var/log/nginx/error.log
Even with debug on.

Any ideas?

Thanks

Brendan




_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

tcp stream load balancer not working on Oracle Linux 7.5

Brendan Doyle May 07, 2019 06:28PM

Re: tcp stream load balancer not working on Oracle Linux 7.5

Patrick May 07, 2019 09:26PM

Re: tcp stream load balancer not working on Oracle Linux 7.5

Brendan Doyle May 08, 2019 10:24AM

Re: tcp stream load balancer not working on Oracle Linux 7.5

Patrick May 08, 2019 08:08PM

Re: tcp stream load balancer not working on Oracle Linux 7.5

brendan.doyle@oracle.com May 09, 2019 04:58AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 127
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready