0

I have port 9200 proxied via 80 on my server running elasticsearch. I have a camel route that needs to index documents to this server.

Is it supported in the camel-elasticsearch plugin? ie access elastic search via a non 9300 port?

I understand that port 9300 uses a native elasticsearch transport protocol.

What are my options here? Can I proxy 9300 via apache? I'm not sure if that works.

Or does the camel-elasticsearch plugin support http transport? Please help. Thanks.

user1189332
  • 1,773
  • 4
  • 26
  • 46

1 Answers1

0

The port you are referring to, it is the HTTP port:

http.port A bind port range. Defaults to 9200-9300.

http.publish_port The port that HTTP clients should use when communicating with this node. Useful when a cluster node is behind a proxy or firewall and the http.port is not directly addressable from the outside. Defaults to the actual port assigned via http.port.

http.bind_host The host address to bind the HTTP service to. Defaults to http.host (if set) or network.bind_host.

http.publish_host The host address to publish for HTTP clients to connect to. Defaults to http.host (if set) or network.publish_host.

http.host Used to set the http.bind_host and the http.publish_host Defaults to http.host or network.host.

So you really don't need a proxy, you can have elasticsearch listen directly on port 80.

If you already have a process running on port 80; then you can proxy the connections to 9200 (and leave elastic search as default).


Java Transport Client ---> Apache HTTP Proxy(80) ----> ES (9300) [ Can I do this? As I understand that Java Transport Client uses a non-http protocol? ]

The protocol has nothing to do with the port.

Simply pass 80 to InetSocketTransportAddress. See the documentation for a complete example.

Burhan Khalid
  • 169,990
  • 18
  • 245
  • 284
  • I understand that 9200 is elasticsearch's http port and this can be proxied via port 80. But my question was if I were to use the Elasticsearch Java API (that uses the transport client though port 9300) outside the firewall, what are my options? – user1189332 Sep 06 '15 at 13:09
  • I don't know what you are asking here. If you are concerned that port 9300 may be blocked from your _client_, then configure your client to query on port 80; is this what you are trying to do and are stuck? – Burhan Khalid Sep 06 '15 at 13:11
  • `Java Transport Client ---> Apache HTTP Proxy(80) ----> ES (9300) [ Can I do this? As I understand that Java Transport Client uses a non-http protocol? ] ` – user1189332 Sep 06 '15 at 13:33