tcp stream load balancer not working on Oracle Linux 7.5

Brendan Doyle brendan.doyle at oracle.com
Tue May 7 22:26:16 UTC 2019


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






More information about the nginx mailing list