2022-04-27 15:28:18 -04:00
---
layout: default
title: RPM
parent: Install OpenSearch
nav_order: 51
---
2022-05-03 12:53:30 -04:00
# RPM
2022-05-03 12:29:43 -04:00
The RPM Package Manager (RPM) installation provides everything you need to run OpenSearch inside Red Hat or CentOS Linux distributions.
2022-04-27 15:28:18 -04:00
2022-05-03 12:27:16 -04:00
RPM supports CentOS 7 and 8, and Amazon Linux 2. If you have your own Java installation and set `JAVA_HOME` in your terminal application, macOS works, as well.
2022-04-27 15:28:18 -04:00
2022-05-03 12:27:16 -04:00
There are two methods for installing OpenSearch on RPM:
2022-04-27 15:28:18 -04:00
## Manual method
2022-05-03 10:56:54 -04:00
2022-04-27 15:28:18 -04:00
1. Download the RPM package directly from the [OpenSearch downloads page ](https://opensearch.org/downloads.html ){:target='\_blank'}.
2022-05-03 10:56:54 -04:00
2. On your host, use `yum install` or `rpm -ivh` to install the package. We recommend using `yum install` , so that the required dependecies can be pulled from the YUM library.
2022-05-03 12:53:30 -04:00
```bash
yum install opensearch-{{site.opensearch_version}}-linux-x64.rpm
yum install opensearch-dashboards-{{site.opensearch_version}}-linux-x64.rpm
```
2022-04-27 15:28:18 -04:00
2022-05-03 12:53:30 -04:00
```bash
rpm -ivh opensearch-{{site.opensearch_version}}-linux-x64.rpm
rpm -ivh opensearch-dashboards-{{site.opensearch_version}}-linux-x64.rpm
```
2022-04-27 15:28:18 -04:00
3. Run OpenSearch and OpenSearch Dashboards using `systemctl` .
2022-05-03 12:53:30 -04:00
```bash
systemctl start opensearch
systemctl start opensearch-dashboards
```
2022-04-27 15:28:18 -04:00
2022-05-03 12:53:30 -04:00
If you configure the security plugin for production use (or disable it), you can run OpenSearch using `./bin/opensearch` .
2022-04-27 15:28:18 -04:00
4. Open a second terminal session, and send requests to the server to verify that OpenSearch is running:
2022-05-03 12:53:30 -04:00
```bash
curl -XGET https://localhost:9200 -u 'admin:admin' --insecure
curl -XGET https://localhost:9200/_cat/plugins?v -u 'admin:admin' --insecure
```
2022-04-27 15:28:18 -04:00
## YUM method
2022-05-03 10:06:11 -04:00
YUM allows you to pull the RPM package from the YUM repository library.
2022-04-27 15:28:18 -04:00
2022-05-03 10:06:11 -04:00
1. Create a repository file for both OpenSearch and OpenSearch dashboards:
2022-04-27 15:28:18 -04:00
2022-05-03 12:53:30 -04:00
```bash
sudo curl -SL https://artifacts.opensearch.org/releases/bundle/opensearch/2.x/opensearch-{{site.opensearch_version}}.repo -o /etc/yum.repos.d/{{site.opensearch_version}}.repo
```
2022-05-03 10:06:11 -04:00
2022-05-03 12:53:30 -04:00
```bash
sudo curl -SL https://artifacts.opensearch.org/releases/bundle/opensearch-dashboards/{{site.opensearch_version}}/opensearch-dashboards-{{site.opensearch_version}}.repo -o /etc/yum.repos.d/{{site.opensearch_version}}.repo
```
2022-05-03 10:06:11 -04:00
2. Navigate to your YUM repository directory:
2022-04-27 15:28:18 -04:00
2022-05-03 12:53:30 -04:00
```bash
cd /etc/yum.repos.d/
```
2022-04-27 15:28:18 -04:00
2022-05-03 10:06:11 -04:00
3. Clean your YUM cache, to ensure a smooth installation:
2022-04-27 15:28:18 -04:00
2022-05-03 12:53:30 -04:00
```bash
sudo yum clean all
```
2022-04-27 15:28:18 -04:00
2022-05-03 12:27:16 -04:00
4. With the repository file downloaded, list all available versions of OpenSearch:
2022-04-27 15:28:18 -04:00
2022-05-03 12:53:30 -04:00
```bash
sudo yum list | grep opensearch
```
2022-04-27 15:28:18 -04:00
2022-05-03 12:27:16 -04:00
5. Chose the version of OpenSearch you want to install:
2022-04-27 15:28:18 -04:00
2022-05-03 12:53:30 -04:00
```bash
yum install opensearch
yum install opensearch-dashboards
```
2022-04-27 15:28:18 -04:00
2022-05-03 12:53:30 -04:00
Unless otherwise indicated, the highest minor version of OpenSearch installs.
2022-04-27 15:28:18 -04:00
2022-05-03 12:53:30 -04:00
To install a specific version of OpenSearch
2022-04-27 15:28:18 -04:00
2022-05-03 12:53:30 -04:00
```bash
yum install 'opensearch-{{site.opensearch_version}}'
```
2022-04-27 15:28:18 -04:00
2022-05-03 12:27:16 -04:00
6. During installation, the installer stops to see if the GPG key matches the OpenSearch project. Verify that the `Fingerprint` matches the following:
2022-04-27 15:28:18 -04:00
2022-05-03 12:53:30 -04:00
```bash
Fingerprint: c5b7 4989 65ef d1c2 924b a9d5 39d3 1987 9310 d3fc
```
2022-04-27 15:28:18 -04:00
2022-05-03 12:53:30 -04:00
If correct, enter `yes` . The OpenSearch installation continues.
2022-04-27 15:28:18 -04:00
2022-05-03 12:27:16 -04:00
7. Run OpenSearch and OpenSearch Dashboards using `systemctl` .
2022-04-27 15:28:18 -04:00
2022-05-03 12:53:30 -04:00
```bash
systemctl start opensearch.service
systemctl start opensearch-dashboards.service
```
2022-04-27 15:28:18 -04:00
2022-05-03 10:06:11 -04:00
If you configure the security plugin for production use (or disable it), you can run OpenSearch using `./bin/opensearch` .
2022-04-27 15:28:18 -04:00
2022-05-03 12:27:16 -04:00
8. Open a second terminal session, and send requests to the server to verify that OpenSearch is running:
2022-04-27 15:28:18 -04:00
2022-05-03 12:53:30 -04:00
```bash
curl -XGET https://localhost:9200 -u 'admin:admin' --insecure
curl -XGET https://localhost:9200/_cat/plugins?v -u 'admin:admin' --insecure
```
2022-04-27 15:28:18 -04:00
2022-05-03 12:53:30 -04:00
To stop running OpenSearch, enter:
2022-04-27 15:28:18 -04:00
2022-05-03 12:53:30 -04:00
```bash
systemctl stop opensearch.service
systemctl stop opensearch-dashboards.service
```
2022-04-27 15:28:18 -04:00
2022-05-03 10:06:11 -04:00
## (Optional) Set up Performance Analyzer
2022-04-27 15:28:18 -04:00
2022-05-03 10:06:11 -04:00
When enabled, the Performance Analyzer plugin collects data related to the performance of your OpenSearch instance. By default, the Performance Analyzer endpoints are not accessible outside the host machine.
2022-04-27 15:28:18 -04:00
2022-05-03 10:06:11 -04:00
1. Make Performance Analyzer accessible outside of the host machine
2022-04-27 15:28:18 -04:00
2022-05-03 12:53:30 -04:00
```bash
cd /usr/share/opensearch # navigate to the OpenSearch home directory
cd plugins/opensearch_performance_analyzer/pa_config/
vi performance-analyzer.properties
```
2022-04-27 15:28:18 -04:00
2022-05-03 12:53:30 -04:00
Uncomment the line `#webservice-bind-host` and set it to `0.0.0.0` :
2022-04-27 15:28:18 -04:00
2022-05-03 12:53:30 -04:00
```
# ======================== OpenSearch performance analyzer plugin config =========================
2022-04-27 15:28:18 -04:00
2022-05-03 12:53:30 -04:00
# NOTE: this is an example for Linux. Please modify the config accordingly if you are using it under other OS.
2022-04-27 15:28:18 -04:00
2022-05-03 12:53:30 -04:00
# WebService bind host; default to all interfaces
webservice-bind-host = 0.0.0.0
2022-04-27 15:28:18 -04:00
2022-05-03 12:53:30 -04:00
# Metrics data location
metrics-location = /dev/shm/performanceanalyzer/
2022-04-27 15:28:18 -04:00
2022-05-03 12:53:30 -04:00
# Metrics deletion interval (minutes) for metrics data.
# Interval should be between 1 to 60.
metrics-deletion-interval = 1
2022-04-27 15:28:18 -04:00
2022-05-03 12:53:30 -04:00
# If set to true, the system cleans up the files behind it. So at any point, we should expect only 2
# metrics-db-file-prefix-path files. If set to false, no files are cleaned up. This can be useful, if you are archiving
# the files and wouldn't like for them to be cleaned up.
cleanup-metrics-db-files = true
2022-04-27 15:28:18 -04:00
2022-05-03 12:53:30 -04:00
# WebService exposed by App's port
webservice-listener-port = 9600
2022-04-27 15:28:18 -04:00
2022-05-03 12:53:30 -04:00
# Metric DB File Prefix Path location
metrics-db-file-prefix-path = /tmp/metricsdb_
2022-04-27 15:28:18 -04:00
2022-05-03 12:53:30 -04:00
https-enabled = false
2022-04-27 15:28:18 -04:00
2022-05-03 12:53:30 -04:00
#Setup the correct path for certificates
certificate-file-path = specify_path
2022-05-03 10:06:11 -04:00
2022-05-03 12:53:30 -04:00
private-key-file-path = specify_path
2022-05-03 10:06:11 -04:00
2022-05-03 12:53:30 -04:00
# Plugin Stats Metadata file name, expected to be in the same location
plugin-stats-metadata = plugin-stats-metadata
2022-05-03 10:06:11 -04:00
2022-05-03 12:53:30 -04:00
# Agent Stats Metadata file name, expected to be in the same location
agent-stats-metadata = agent-stats-metadata
```
2022-05-03 10:06:11 -04:00
2. Restart the OpenSearch service:
2022-05-03 12:53:30 -04:00
```bash
systemctl restart opensearch.service
```
2022-05-03 10:06:11 -04:00
3. After OpenSearch is running, start the Performance Analyzer plugin:
2022-04-27 15:28:18 -04:00
2022-05-03 12:53:30 -04:00
```bash
sudo systemctl start opensearch-performance-analyzer.service
```
2022-04-27 15:28:18 -04:00
2022-05-03 12:53:30 -04:00
To stop the Performance Analyzer, enter:
2022-04-27 15:28:18 -04:00
2022-05-03 12:53:30 -04:00
```bash
sudo systemctl stop opensearch-performance-analyzer.service
```
2022-04-27 15:28:18 -04:00
## Upgrade RPM
You can upgrade your RPM OpenSearch instance both manually and through YUM.
### Manual
Download the new version of OpenSearch you want to use, and then use `rmp -Uvh` to upgrade.
### YUM
2022-05-03 10:06:11 -04:00
To upgrade to the latest version of OpenSearch with YUM, use `yum upgrade` . You can also upgrade to a specific OpenSearch version by using `yum upgrade opensearch-<version-number>` .