In my environment, elasticsearch is on a server that only has standard ports (80, 443, etc.). All other ports are disabled. I currently have a reverse proxy on port 80 that redirects all elasticsearch HTTP requests to elasticsearch http port.
I would also like to redirect TCP requests to the elasticsearch transport port , so that my local client can directly request elasticsearch as a node client, Nginx 1.9.0 recently enabled TCP load balancing, which I would like to use for this, but I'm having problems with getting my system to work. Here is my nginx.conf file (remote HTTP context to isolate the problem):
worker_processes 1; events { worker_connections 1024; } stream { server { listen 80; proxy_pass 127.0.0.1:9300; } }
My node client is configured to talk to mydomain.com:80, so ideally it should route all traffic to the internal transport port. However, I get the following exceptions: org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available
Is there anything else I need to configure node or tcp proxy on my client?
EDIT 1:
Additional Information. I changed the Elasticsearch transport port from 9300 to 8030, which is an open port. When I accordingly changed my nginx.conf to proxypass to 127.0.0.1:8030 , my local node client started working and received corresponding answers to my requests.
So, the problem is that if I proxy goes to an already open port, it works, but if the port is closed (9300), the proxy server will fail. Does anyone know why this would be and how to fix it? I would rather use port 9300 if possible.
Shark source share