Jump to content

Elasticsearch Guide?


Recommended Posts

I have increased the heap size to 8G (I have 32 in the server, 6 reserved is for MySQL).

The last elasticsearch 6.8.5 did some improvements, I have a test machine with only 8G and on this one I reserved only 2 for elastic. Up to this last version it was really really slow, and now it's much better.   


Link to comment
Share on other sites

17 hours ago, b416 said:

I have implemented elasticsearch localy, i.e. on the same server than everything else; I can give you some pointers if you are interested. 


Yeah please, I'd really appreciate it. I don't particularly know where to download it from and what it costs?

We are on a VPS with quite good techies who'd help us install it server side.


Link to comment
Share on other sites

I use the open source version, so it's free. You can download it from elactic.co directly, the way I use it on Ubuntu is to set up a repository and use apt as for everything else. 

Be aware that only 6.x works with IPS, don't take the 7.x version (yet).

I installed it with the default configuration (it runs on localhost only, port 9200 - that's the default settings in IPS also). The only thing I changed is the heap size, the defaults are too small for my indexes. Here is the guide for this. 

When you switch to elastic, IPS will rebuild the indexes, it takes some time (you will see the background tasks in the ACP), for me it took about 10 hours. The site continues to work OK during this time, there is just a warning when you access the search page or dynamic pages that relay on indexes such as unread, activity...

And that's it. Almost forgot, elastic runs fine on a single node, but is configured by default to expect at least 2 nodes and run in a cluster, so when you check the status with a command line or supervision tool, it will appear as "yellow". You can ignore it, or if you are a control freak like me, you can tweak it so it will be all green, even on a single node. 

To see the status on command line :

curl -XGET localhost:9200/_cluster/health/content?pretty

to see the index list (ignore the .tasks, it's for elastic internal use) : 

curl -XGET localhost:9200/_cat/indices?v

to put replicas to 0 on all active indexes (replace index with the name of the index from the command above (content by default with IPS): 

curl -XPUT 'localhost:9200/_settings' -H "Content-Type: application/json" -d '{ "index" : { "number_of_replicas" : 0 } }'

to put all future replicas to 0 :

curl -XPUT localhost:9200/_template/zeroreplicas -H "Content-Type: application/json" -d '{"template":"*", "order":1, "settings":{"number_of_replicas":0}}'

to check the status of your new template : 

curl -XGET localhost:9200/_template/zeroreplicas?pretty

Now your status will always be green. Run the first command again to check.


Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...