Plugin Management
Information
Conventions:
OS_HOME
- the OpenSearch home directory, usually/app/opensearch/
OS_IP
- IP address of one of the OpenSearch cluster serversOSD_HOME
- the OpenSearch Dashboards home directory, usually/app/opensearch-dashboards/
LS_HOME
- Logstash installation directory (typically/app/logstash
)
Plugin management is performed using the following utilities:
opensearch-plugin
opensearch-dashboards-plugin
logstash-plugin
Listing Plugins
OpenSearch
To list OpenSearch plugins, use the following command:
$OS_HOME/bin/opensearch-plugin list
OpenSearch Dashboards
To list OpenSearch Dashboards plugins, use the following command:
$OSD_HOME/bin/opensearch-dashboards-plugin list
When running the command as the root
user, the --allow-root
flag is required. Example:
$OSD_HOME/bin/opensearch-dashboards-plugin list --allow-root
Logstash
To list Logstash plugins, use the following command:
$LS_HOME/bin/logstash-plugin list
Installing Plugins
Use the install
command to install plugins. After executing the command, a service restart is required.
OpenSearch
For clusters with multiple nodes, it is recommended to disable allocation before updating and then re-enable it after the load is complete. This can be done through the developer console (Main Menu
- System Settings
- Dev Console
) by executing the following command:
PUT _cluster/settings
{
"persistent": {
"cluster.routing.allocation.enable": "none"
}
}
The same can be done from the terminal with the following command:
curl -XPUT -k -u admin "https://$OS_IP:9200/_cluster/settings?pretty" -H "Content-Type: application/json" -d '{"persistent":{"cluster.routing.allocation.enable": "none"}}'
When updating cluster nodes, do not use allocation disabling with the update script. After updating all cluster nodes, enable allocation:
PUT _cluster/settings
{
"persistent": {
"cluster.routing.allocation.enable": "all"
}
}
The same can be done from the terminal with the following command:
curl -XPUT -k -u admin "https://$OS_IP:9200/_cluster/settings?pretty" -H "Content-Type: application/json" -d '{"persistent":{"cluster.routing.allocation.enable": "all"}}'
To install an OpenSearch plugin, use the following command:
$OS_HOME/bin/opensearch-plugin install file://<absolute path to archive>
systemctl restart opensearch
Some plugins require extended privileges beyond those provided by default in OpenSearch core. These plugins will automatically list the required privileges and prompt the user for confirmation before proceeding with installation. When executing the plugin installation script from another program, the plugin script itself should automatically detect that it is not being invoked from the console and bypass the confirmation prompt, granting all requested permissions without user interaction.
To forcibly enable batch mode, specify -b
or --batch
as follows:
$OS_HOME/bin/opensearch-plugin install file://<absolute path to archive> --batch
OpenSearch Dashboards
To install an OpenSearch Dashboards plugin, use the following command:
$OSD_HOME/bin/opensearch-dashboards-plugin install file://<absolute path to archive>
systemctl restart opensearch-dashboards
When running the command as the root
user, the --allow-root
flag is required. Example:
$OSD_HOME/bin/opensearch-dashboards-plugin install file://<absolute path to archive> --allow-root
Note that the plugin files will be owned by the root
user after installation. Adjust file permissions before proceeding.
When installing or updating a plugin, it is necessary to increment the build.number
parameter in the following file:
$OSD_HOME/package.json
This is required to clear the browser cache. If this step is skipped, changes to the user interface may not be applied.
Example of changing the parameter:
...
"build": {
- "number": 6870
+ "number": 6871
}
...
Restart the service.
Logstash
Use the following file formats:
- gem
- zip
To install a plugin, use the following command:
$LS_HOME/bin/logstash-plugin install file://<path to plugin>
systemctl restart logstash
Removing Plugins
Use the remove
command to remove an installed plugin. After executing the command, a service restart is required.
OpenSearch
To remove an OpenSearch plugin, use the following command:
$OS_HOME/bin/opensearch-plugin remove <plugin name>
systemctl restart opensearch
OpenSearch Dashboards
To remove an OpenSearch Dashboards plugin, use the following command:
$OSD_HOME/bin/opensearch-dashboards-plugin remove <plugin name>
systemctl restart opensearch-dashboards
When running the command as the root
user, the --allow-root
flag is required. Example:
$OSD_HOME/bin/opensearch-dashboards-plugin remove <plugin name> --allow-root
When removing a plugin, it is necessary to increment the build.number
parameter in the following file:
$OSD_HOME/package.json
This is required to clear the browser cache. If this step is skipped, changes to the user interface may not be applied.
Example of changing the parameter:
...
"build": {
- "number": 6870
+ "number": 6871
}
...
Restart the service.
Logstash
To remove a Logstash plugin, use the following command:
$LS_HOME/bin/logstash-plugin remove <plugin name>
systemctl restart logstash
Job Scheduler Plugins Installation Specifics
This section describes specific requirements and procedures for the sm-job-scheduler
and sm-sigma
plugins.
Node Requirements
The sm-job-scheduler
plugin must be installed exclusively on nodes of the data type (data nodes). Installing the plugin on nodes of other types (master or ingest) will lead to incorrect operation of the job scheduler and errors in the cluster, such as Base user limit not found in index
.
Removing Plugins from Incorrect Nodes
If the plugins were mistakenly installed on a master or ingest node, they must be removed in the following order:
-
Remove the
sm-sigma plugin
. This plugin is intended for converting configuration files in theJob Scheduler
. It is not required on master and ingest nodes -
Remove the
sm-job-scheduler
plugin -
Remove the
jobscheduler.email.pass
password from the keystore -
Restart the node