ElasticSearch Cookbook(Second Edition)
上QQ阅读APP看书,第一时间看更新

Removing a plugin

You have installed some plugins and now you need to remove a plugin because it's not required. Removing an ElasticSearch plugin is easy if everything goes right; otherwise you need to manually remove it.

This recipe covers both cases.

Getting ready

You need a working ElasticSearch Server installed, with an installed plugin, and you need to stop the ElasticSearch server in order to safely remove the plugin.

How to do it...

Perform the following steps to remove a plugin:

  1. Stop your running node in order to prevent exceptions due to file removal.
  2. Using the ElasticSearch Plugin Manager, which comes with its script wrapper (plugin), call the following commands:
    • For Linux/Mac OS X, call this:
      plugin -remove mobz/elasticsearch-head
      

      You can also use this command:

      plugin -remove head
      
    • On Windows, call the following:
      plugin.bat -remove mobz/elasticsearch-head
      

      You can also use the command shown here:

      plugin.bat –remove head
      
  3. Restart the server.

How it works...

The Plugin Manager's –remove command tries to detect the correct name of the plugin and remove the directory of the installed plugin.

If there are undeletable files in your plugin directory (or a strange astronomical event that affects your server), the plugin script might fail; therefore, to manually remove a plugin, you need to follow these steps:

  1. Go to the plugins directory.
  2. Remove the directory with your plugin name.