A Beginner's Guide to Elasticsearch Plugins
Wondering how to configure Elasticsearch with some plugins that will make your life easier? Here's how plugins can help and some commands to help keep you organized.
Join the DZone community and get the full member experience.Join For Free
elasticsearch plugins are used to extend the basic elasticsearch functionality in various, specific ways. there are types, for example, that add security functionality, discovery mechanisms, and analysis capabilities to elasticsearch.
this post provides some basic tips and tricks on working with elasticsearch plugins from how to install them to management best practices.
installing elasticsearch plugins
regardless of what functionalities they add, elasticsearch plugins belong to either of the following two categories: core plugins or community plugins. the former are supplied as part of the elasticsearch package and are maintained by the elastic team while the latter are developed by the community and are thus separate entities with their own versioning and development cycles.
installing core plugins is simple. in the example below, i’m going to install the x-pack plugin. x-pack extends elasticsearch by plugging in shield, watcher, and marvel — three plugins that prior to elasticsearch 5.x were separate entities, each requiring separate installation and setup (commands apply to deb/rpm installation):
cd /usr/share/elasticsearch sudo bin/elasticsearch-plugin install x-pack
please note that in the case of the x-pack elasticsearch plugin, you will need to compliment this step by installing the x-pack plugin for kibana as well (if it’s x-pack you’re interested in, elastic’s docs detail everything you need to know about setting it up).
plugins must be installed on every node in the cluster, and each node must be restarted after installation.
community plugins are a bit different as each of them has different installation instructions.
some community plugins are installed the same way as core plugins but require additional elasticsearch configuration steps.
other community plugins are meant for integration with third-party tools. the new relic plugin , for example, helps to monitor elasticsearch instances using new relic. there are countless of similar plugins and integrations out there, and how or if you use them depends, of course, on your needs.
managing the plugins
here are some additional commands to use to manage your elasticsearch plugins (commands apply to deb/rpm installation):
listing all loaded plugins
cd /usr/share/elasticsearch sudo bin/elasticsearch-plugin list
removing a plugin
cd /usr/share/elasticsearch sudo bin/elasticsearch-plugin remove [plugin]
add mandatory dependencies for plugins
elasticsearch also allows you to define a dependency for a specific plugin, ensuring that a node will not start if the plugin is missing. to add the dependency, add the following setting to the ‘ elasticsearch.yml’ file:
elasticsearch site plugins
a number of community plugins add graphical front-ends to elasticsearch.
the most popular site plugins are head , bigdesk , hq , and hopf . all provide the same functionality more or less — providing a nice overview of your elasticsearch cluster, indices and documents. some include additional utilities such as a data browser for building elasticsearch queries.
it’s important to note that as of elasticsearch 5.x, these site plugins are no longer supported due to security issues but there are workarounds for some of the plugins. (for reference, you can see our introduction to the elk stack 5.0 as well as our complete guide to the elk stack .)
as good as it is, elasticsearch does not provide a full out-of-the-box experience for production cases, and plugins can be great ways to compensate for missing functionalities.
x-pack is a good example of how plugins can be used to complement elasticsearch by adding security and alerting layers to the basic package — but remember that unless you’re using the free tier, x-pack comes with a cost.
in addition to x-pack, there is also the ec2 discovery plugin . the plugin basically uses the aws api to discover other machines in a cluster. in large aws deployments, this plugin is recommended instead of using multicast or manually configuring the master nodes for each data node.
Published at DZone with permission of Daniel Berman, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.