Elasticsearch on double servers

Hi ! I'm a web developer and working with symfony. I have a problem and can't figure out how to solve it.
So I have a database of product. You can search them using ES. Everytime I change something on a product I have a listener that changes the ES index.

We have two servers (In case something wrong happen) and the user is randomly directed to one server or the other one. ES is running on both server.

The problem is when one of the products is changed, the listener only changes the product on one of the two servers. Leaving the other one with error.

I tried to find a solution. Maybe using a shared folder with the data for both of the elasticsearch ?
Maybe putting a listener on both ES and if one is changed, the other one too?

Anyway, I'm not looking for a definitive solution but if someone can give me a hint! Thank you!

Are both elasticsearch nodes within the same cluster?
What is the output of

GET /_cat/nodes?v

I have two independant server so two different cluster. For the first one I have :

ip        heap.percent ram.percent cpu load_1m load_5m load_15m node.role master name
127.0.0.1           33          91   6    1.98    2.34     2.02 mdi       *      wqkQSDF

And :

ip        heap.percent ram.percent cpu load_1m load_5m load_15m node.role master name
127.0.0.1           43          63  20    1.41    1.80     1.70 mdi       *      DxHDBN4

I can share folder beetween the two folder so I thought I could changes the path.data :/var/lib/elasticsearch to path.data:/shared-folder what do you think of that ?

Definitely a bad design.
Just make your 2 nodes part of the same cluster and you're done.
Well you will need a 3rd master only small node to act as a tie breaker.

So it's better to create only one cluster instead of two and shared a folder ? Why that ?

Read https://www.elastic.co/guide/en/elasticsearch/reference/current/tune-for-indexing-speed.html#_use_faster_hardware

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