Elasticsearch service container.
To run this container and bind port
docker run -d -p 9200:9200 mini/elasticsearch
You can now check the logs:
docker logs <CONTAINER_ID>
You can also control the HTTP transport port to be something other than
9200, simply use
ELASTICSEARCH_PORT and ensure the one given matches
the one being exposed by Docker.
Note that port
9300 (tcp) is also exposed, but is not required unless you
want to build a multi-node cluster using this container :wink:
By default, Elasticsearch will bind to the first network interface available,
but sometimes that is not desired.
Example of this will be the usage of Weave network and
ensure Elasticsearch communication happens exclusively over Weave, private
network and not exposed to the Docker interface.
In this scenario, you can enable this by using
ELASTICSEARCH_NET and provide
any of the accepted values as described in Elastic's network module
In the above described example, you will use
_ethwe:ipv4_ as value for the
docker run -e ELASTICSEARCH_NET=_ethwe:ipv4_ mini/elasticsearch
You can use other network options like ranges, see details described in the
link provided above.
Data and volumes
This container exposes
/data as bind mount volume. You can mount it when
starting the container:
docker run -v /mydata/elasticsearch:/data -d -p 9200:9200 mini/elasticsearch
We recommend you mount the volume to avoid loosing data between updates to
Cluster and Node identification
For development purposes, both cluster and node names might be irrelevant, so
Elasticsearch's default behavior might be OK.
However, moving to a production environment, it is desired to control these
two options in order to ensure multiple instances running on the same cluster
are setup independently.
ELASTICSEARCH_NODE variables to define
which cluster name will use for discovery and which name will be used for
announcement to such cluster.
Work on this was made possible thanks to AREA 17.
All the code contained in this repository, unless explicitly stated, is
licensed under ISC license.
A copy of the license can be found inside the LICENSE file.