If there’s two things that have defined the improved user experience in Sugar 6.5, it would be the refreshed navigation bar and the addition of full text search engine support.
We added this for the commercial versions of Sugar leveraging the elasticsearch FTS engine, which is a new component to platform stack for Sugar administrators. There’s been lots of questions around this, so I thought I would address them in this blog post.
Q. How do I install elasticsearch?
There’s a great guide for this on the elasticsearch site.
In additon, we have some RPMs we’ve built against CentOS 5.x on SugarForge; these are provided for reference only and not officially supported by us. There are 3 RPMs there, one for the elasticsearch itself and two others which provide additional functionality for elasticsearch. Bigdesk provides better charts and statistics and the head plugin provides a web front end for browsing the Elastic Search index.
Q. How do I enable using elasticsearch with Sugar?
There’s a full guide on how to do this in the Sugar 6.5 Adminstrator’s Guide. Do note that you will need to have the Scheduler inside Sugar setup and running in order to have the FTS work as expected.
Q. Any tips to configuring elasticsearch to work optimally?
Generally speaking, if you run your database server and web server on different machines you should probably do the same for elasticsearch. Here’s a few other tips that come from our Ops team:
In on-demand, we tweak /etc/sysconfig/elasticsearch to look like the following:
The most important line for us in this file is NFILES which allows elastic search to have a larger number of file handles available for use. That number should be tweaked upwards if the user ever sees messages such as the following in the logs:
[2012-06-12 11:53:50,815][WARN ][gateway.local ] [fts-test1] failed to write local gateway shards state to /var/lib/elasticsearch/fts-test/node/0/_state/shards-66102 java.io.FileNotFoundException: /var/lib/elasticsearch/fts-test/nodes/0/_state/shards-66102 (Too many open files)
Elastic search logs to /var/log/elasticsearch
In on-demand we configure elastic search in two nodes clusters. We do this by making adjustments to /etc/elasticsearch/elasticsearch.yml
It is important that both nodes have the same cluster.name parameter in this file and that they have unique node.name parameters.
On both nodes, we set the following:
We set the number of shards as follows in our two node cluster:
Q: What happens if the elasticsearch server goes down or becomes unresponsive?
Starting in 6.5.1, this will be auto detected and any searches performed until the server full comes back online will fallback to the previous global search functionality. When the server is back up and running it will automatically switch back to searching via elasticsearch.
Let us know in the comments on any other questions you have around elasticsearch, and be sure to report any issues you are seeing with it to our bug tracker.