Properly configure ElasticSearch

Hello all.

I am using ES to index and use millions of data, I would like to know the correct way to configure the yml file.

I am using Elastica, the PHP framework.

Here is my elastica elasticsearch.yml :

index.number_of_shards: 2
index.number_of_replicas: 0

# Dont write data to hdd in tests memory

# Required plugins
plugin.mandatory: mapper-attachments, geocluster-facet, transport-thrift, transport-memcached, image

# For bulk tests
bulk.udp.enabled: true
bulk.udp.bulk_actions: 5

# For script tests
script.inline: on
script.indexed: on

script.engine.groovy.file: on

# Disable dynamic memory allocation
bootstrap.mlockall: true

# Dont accept connections not from localhost ""

# Limit threadpool by set number of available processors to 1
# Without this, travis builds will be failed with OutOfMemory error
processors: 1

# All nodes will be called Elastica Elastica

# Ports config
http.port: 9200
transport.tcp.port: 9300
thrift.port: 9500
memcached.port: 11211

# Added for snapshot tests
path.repo: ["/tmp/backups"]

And here is my ES elasticsearch.yml :

index.number_of_shards: 10

index.number_of_replicas: 1

bootstrap.mlockall: true

indices.recovery.max_bytes_per_sec: 200mb : 200mb

And finally in my etc/default/elasticsearch I have these set to :



Heap size is low because the vagrant VM has only 2gb ram, so if I put any more size elasticsearch won't start.

I don't think it's correctly configured, as ES tends to crash often for no reason, especially if I index all the million data, he crashes before he allows me to index all of them.

And in my PHP code, I manually create the index and the type, but I have no idea how to configure clusters/shards... etc in my .yml file to fit my needs of the enormous data.


First, this looks like a really old version of elasticsearch if you are able to configure the udp bulk settings. Also you are trying to store all your data in the memory (an option we removed years ago).

My proposal: As a first measure, upgrade to a recent version of Elasticsearch. Then ditch all the configuration options and retry.

If you system keeps crashing, please attach the full error message.

But, please, stop using such an old version first.

I have no choice, this is the only version that works with the company's PHP 5.3 version.

can you explain this? You are using HTTP, so why this hard dependency?

The version you are using seems to be at least three years old (more likely four), so it is fully unsupported.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.