Elasticsearch allows customizing several parameters in an installation. In this recipe, we'll see the most used ones to define where to store our data and to improve the overall performances.
You need a working Elasticsearch installation as we described in the Downloading and installing Elasticsearch recipe and a simple text editor to change configuration files.
The steps required for setting up a simple node are as follows:
config/elasticsearch.yml
with an editor of your choice.path.conf: /opt/data/es/conf path.data: /opt/data/es/data1,/opt2/data/data2 path.work: /opt/data/work path.logs: /opt/data/logs path.plugins: /opt/data/plugins
path.conf: c:Elasticsearchconf path.data: c:Elasticsearchdata path.work: c:Elasticsearchwork path.logs: c:Elasticsearchlogs path.plugins: c:Elasticsearchplugins
index.number_of_shards: 5 index.number_of_replicas: 1
The path.conf
defines the directory that contains your configuration: mainly elasticsearch.yml
and logging.yml
. This is default $ES_HOME/config
with ES_HOME
to install directory.
The path.data
is the most important one: it allows us to define one or more directories (in different disk) where you can store your index data. When you define more than one directory, they are managed a la RAID 0 (their space is sum up), favoring locations with most free space.
The path.work
is a location when Elasticsearch stores temporary files.
The path.log
is where log files are put. The control how to log is managed in logging.yml
.
The path.plugins
allows you to override the plugins path (the default is $ES_HOME/plugins
). It's useful to put system-wide plugins.
The main parameters used to control index and shards in index.number_of_shards
that controls the standard number of shards for a new created index and index.number_of_replicas
that controls the initial number of replicas.
There are a lot of other parameters that can be used to customize your Elasticsearch installation and new ones are added with new releases. The most important ones are described in this and the next recipe.
3.16.69.199