ElasticSearch - specifying an exact port (no port range) - elasticsearch

I want to specify an exact port for ElasticSearch to use for HTTP traffic. How can I do so? In the config file, it says it listens to a port range by default. How can I restrict this port range to just 1 port?
Elasticsearch, by default, binds itself to the 0.0.0.0 address, and listens
on port [9200-9300] for HTTP traffic and on port [9300-9400] for node-to-node
communication. (the range means that if the port is busy, it will automatically
try the next port).

In config folder.. There is an file called "elasticsearch.Yml". In that
Parameters for port are commented.. Just remove hash before http.port and add port value to it..
http.port : 5000
You can do this for both tcp and http

Related

Https alternative port for 443

I have two raspberry pi and I have two different services on every.
In one case I have open port for 443 (https). I would like to have the (https) on second machine. Is there any alternative port for 443, or I can set any I want?
Also is there any alternative port for 80?
I have two heavy (for rpi:D ) services on each, that is why I want to have alternative ports opened.
Is there any regularity I should follow?
Regards
If you setup your rpi to serve https on two different ports (which you can do in the daemons config), then you can access both easily :
The one on the default port can be accessed simply with https://hostname/ or https://ip-address/, whereas the one on the specific port can be accessed by specifying the port, for example : https://hostname:444/
(Same goes for http on port 80)

camel elasticsearch access port 80

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.
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.

Can I use another port other than 443 for HTTPS/SSL communication?

443 port is typically used for HTTPS/SSL. But is it the only option we can choose for HTTPS/SSL communication. If not, why?
The port number is not "magic", you can use any port from 1-65535 you like. There are only 2 conditions:
Both the server and the client have to (agree to) use the same port number.
Ports in the range 1-1023 are "well known ports" which are assigned worldwide to specific applications or protocols. If you use one of these port numbers, you may run into conflicts with the "well known" applications. Ports from 1024 on are freely useable.
As an example, you could use port 30443 for SSL VPN if your VPN gateway supports port reassignment and the SSL VPN client (if any) does this as well. If you access SSL VPN via web portal, you can add the custom port number in the URL like this: "https://mysslvpnserver.com:30443".
Beware that public internet feeds (hotels, hotspots) often block high ports > 1024.
We can use any available port for HTTPS, however, for the sake of convention, 443 and 8443 are assigned for HTTPS (browsers automatically prefix with https when these port numbers are used), but we can even run HTTPS on port 80. In this case it is our responsibility to use https (if we don't indicate it, the browser will consider it a http link).

tcp server ip address

When starting H2 tcp server and the host pc has multiple IP address's how can I define the IP that the server is going to bind to listen for connections ?
We can define the tcp port but there does not seems to be a way to define the ip address.
Thank you, Oscar
http://www.h2database.com/html/advanced.html#server_bind_address
Usually server sockets accept connections on any/all local addresses.
This may be a problem on multi-homed hosts. To bind only to one
address, use the system property h2.bindAddress. This setting is used
for both regular server sockets and for SSL server sockets. IPv4 and
IPv6 address formats are supported.

How to capture only incoming TCP streams in WireShark?

How to capture only incoming TCP streams in WireShark?
(I would like to capture only HTTP connections to my web server, not any outgoing HTTP connections from applications.)
Based on my test,
1. You can use this capture filter for the WireShark that running on the server which you want monitor incoming packets:
dst host 10.58.123.456 and dst port 8080
And you can use following result filter to view traffic comes from certain client:
ip.src_host == 10.78.123.456
Use a filter like (ip dst host 192.168.0.1 and tcp dst port 80) or (ip src host 192.168.0.1 and tcp src port 80).

Resources