CentOS7 ODFE 1.2.1 steps to prevent dependency issues

If someone has issues with dependencies and especially the elastic repo, my recommendation is to download the elasticsearch-oss package from the elastic homepage.
Reason for this is because every time I’m doing an installation/upgrade I have issues with getting older versions from the original elastic repo that are required for ODFE.

# yum list elasticsearch-oss-7.2.1-1
Loaded plugins: langpacks, rhnplugin, versionlock
This system is receiving updates from RHN Classic or Red Hat Satellite.
Available Packages
elasticsearch-oss.x86_64                                           7.2.1-1                                           elasticsearch-7.x
# yum install elasticsearch-oss-7.2.1-1
Loaded plugins: langpacks, rhnplugin, versionlock
This system is receiving updates from RHN Classic or Red Hat Satellite.
Nothing to do

(no version lock or exclude configured)

So, in case for opendistro 1.2.1 my steps are:

  1. go to https://www.elastic.co/downloads/past-releases/elasticsearch-oss-7-2-1 and download rpm package
elasticsearch-oss-7.2.1-x86_64.rpm
  1. install local package via yum yum install elasticsearch-oss-7.2.1-x86_64.rpm
  2. from the opendistro repo the rest works as intended, but I tend to specify depended versions ***
yum install opendistroforelasticsearch-1.2.1 opendistro-sql-1.2.1.0 opendistro-security-1.2.1.0 opendistroforelasticsearch-kibana-1.2.1

*** might differ for other version/sub-version, pls. verify version manually, inn case this post is outdated

regards,
nean


console output for step 2

# yum install /tmp/elasticsearch-oss-7.2.1-x86_64.rpm
Examining /tmp/elasticsearch-oss-7.2.1-x86_64.rpm: elasticsearch-oss-7.2.1-1.x86_64
Marking /tmp/elasticsearch-oss-7.2.1-x86_64.rpm as an update to elasticsearch-oss-6.7.1-1.noarch
Resolving Dependencies
--> Running transaction check
---> Package elasticsearch-oss.noarch 0:6.7.1-1 will be updated
---> Package elasticsearch-oss.noarch 0:6.7.1-1 will be obsoleted
---> Package elasticsearch-oss.x86_64 0:7.2.1-1 will be obsoleting
--> Finished Dependency Resolution

Dependencies Resolved

==================================================================================================================================================
 Package                             Arch                     Version                     Repository                                         Size
==================================================================================================================================================
Installing:
 elasticsearch-oss                   x86_64                   7.2.1-1                     /elasticsearch-oss-7.2.1-x86_64                   422 M
     replacing  elasticsearch-oss.noarch 6.7.1-1

Transaction Summary
==================================================================================================================================================
Install  1 Package

Total size: 422 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test

Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
  Installing : elasticsearch-oss-7.2.1-1.x86_64                                                                                               1/2
warning: /etc/elasticsearch/elasticsearch.yml created as /etc/elasticsearch/elasticsearch.yml.rpmnew
warning: /etc/elasticsearch/jvm.options created as /etc/elasticsearch/jvm.options.rpmnew
  Cleanup    : elasticsearch-oss-6.7.1-1.noarch                                                                                               2/2
warning: file /var/run/elasticsearch: remove failed: No such file or directory
Created elasticsearch keystore in /etc/elasticsearch
  Verifying  : elasticsearch-oss-7.2.1-1.x86_64                                                                                               1/2
  Verifying  : elasticsearch-oss-6.7.1-1.noarch                                                                                               2/2
  Verifying  : elasticsearch-oss-6.7.1-1.noarch                                                                                               3/2

Installed:
  elasticsearch-oss.x86_64 0:7.2.1-1

Replaced:
  elasticsearch-oss.noarch 0:6.7.1-1

Complete!

console output for step 3

# yum install opendistroforelasticsearch-1.2.1 opendistro-sql-1.2.1.0 opendistro-security-1.2.1.0 opendistroforelasticsearch-kibana-1.2.1
Resolving Dependencies
--> Running transaction check
---> Package opendistro-security.noarch 0:1.2.1.0-0 will be installed
---> Package opendistro-sql.noarch 0:1.2.1.0-1 will be installed
---> Package opendistroforelasticsearch.noarch 0:1.2.1-1 will be installed
--> Processing Dependency: opendistro-performance-analyzer < 1.2.2 for package: opendistroforelasticsearch-1.2.1-1.noarch
--> Processing Dependency: opendistro-job-scheduler < 1.2.2 for package: opendistroforelasticsearch-1.2.1-1.noarch
--> Processing Dependency: opendistro-alerting < 1.2.2 for package: opendistroforelasticsearch-1.2.1-1.noarch
--> Processing Dependency: opendistro-performance-analyzer >= 1.2.1 for package: opendistroforelasticsearch-1.2.1-1.noarch
--> Processing Dependency: opendistro-job-scheduler >= 1.2.1 for package: opendistroforelasticsearch-1.2.1-1.noarch
--> Processing Dependency: opendistro-alerting >= 1.2.1 for package: opendistroforelasticsearch-1.2.1-1.noarch
---> Package opendistroforelasticsearch-kibana.x86_64 0:1.2.1-1 will be installed
--> Running transaction check
---> Package opendistro-alerting.noarch 0:1.2.1.0-1 will be installed
---> Package opendistro-job-scheduler.noarch 0:1.2.1.0-1 will be installed
---> Package opendistro-performance-analyzer.noarch 0:1.2.1.0-1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==================================================================================================================================================
 Package                                      Arch              Version                Repository                                            Size
==================================================================================================================================================
Installing:
 opendistro-security                          noarch            1.2.1.0-0              opendistroforelasticsearch-artifacts-repo             26 M
 opendistro-sql                               noarch            1.2.1.0-1              opendistroforelasticsearch-artifacts-repo            6.0 M
 opendistroforelasticsearch                   noarch            1.2.1-1                opendistroforelasticsearch-artifacts-repo            2.8 k
 opendistroforelasticsearch-kibana            x86_64            1.2.1-1                opendistroforelasticsearch-artifacts-repo            127 M
Installing for dependencies:
 opendistro-alerting                          noarch            1.2.1.0-1              opendistroforelasticsearch-artifacts-repo            3.9 M
 opendistro-job-scheduler                     noarch            1.2.1.0-1              opendistroforelasticsearch-artifacts-repo            218 k
 opendistro-performance-analyzer              noarch            1.2.1.0-1              opendistroforelasticsearch-artifacts-repo             15 M

Transaction Summary
==================================================================================================================================================
Install  4 Packages (+3 Dependent packages)

Total download size: 179 M
Installed size: 501 M
Is this ok [y/d/N]: y
Downloading packages:
warning: /var/cache/yum/x86_64/7/opendistroforelasticsearch-artifacts-repo/packages/opendistro-job-scheduler-1.2.1.0.rpm: Header V4 RSA/SHA256 Signature, key ID e370325e: NOKEY
Public key for opendistro-job-scheduler-1.2.1.0.rpm is not installed
(1/7): opendistro-job-scheduler-1.2.1.0.rpm                                                                                | 218 kB  00:00:00
(2/7): opendistro-alerting-1.2.1.0.rpm                                                                                     | 3.9 MB  00:00:00
(3/7): opendistro-performance-analyzer-1.2.1.0.rpm                                                                         |  15 MB  00:00:00
(4/7): opendistro-sql-1.2.1.0.rpm                                                                                          | 6.0 MB  00:00:00
(5/7): opendistroforelasticsearch-1.2.1.rpm                                                                                | 2.8 kB  00:00:00
(6/7): opendistro-security-1.2.1.0.rpm                                                                                     |  26 MB  00:00:00
(7/7): opendistroforelasticsearch-kibana-1.2.1.rpm                                                                         | 127 MB  00:00:02
--------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                              66 MB/s | 179 MB  00:00:02
Retrieving key from https://d3g5vo6xdbdb9a.cloudfront.net/GPG-KEY-opendistroforelasticsearch
Importing GPG key 0xE370325E:
 Userid     : "OpenDistroForElasticsearch (Key For signing OpenDistroForElasticsearch artifacts.) <opendistroforelasticsearch-infra@amazon.com>"
 Fingerprint: 5120 9ccb 28fb c2dc 8ccd 9a6c 472c fdfc e370 325e
 From       : https://d3g5vo6xdbdb9a.cloudfront.net/GPG-KEY-opendistroforelasticsearch
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : opendistro-alerting-1.2.1.0-1.noarch                                                                                           1/7
  Installing : opendistro-performance-analyzer-1.2.1.0-1.noarch                                                                               2/7
# Enabling opendistro performance analyzer to start and stop along with elasticsearch.service
Created symlink from /etc/systemd/system/elasticsearch.service.wants/opendistro-performance-analyzer.service to /usr/lib/systemd/system/opendistro-performance-analyzer.service.
  Installing : opendistro-sql-1.2.1.0-1.noarch                                                                                                3/7
  Installing : opendistro-job-scheduler-1.2.1.0-1.noarch                                                                                      4/7
  Installing : opendistro-security-1.2.1.0-0.noarch                                                                                           5/7
OpenDistro for Elasticsearch Security Demo Installer
 ** Warning: Do not use on production or public reachable systems **
Basedir: /usr/share/elasticsearch
This script maybe require your root password for 'sudo' privileges
Elasticsearch install type: rpm/deb on CentOS Linux release 7.5.1804 (Core)
Elasticsearch config dir: /etc/elasticsearch
Elasticsearch config file: /etc/elasticsearch/elasticsearch.yml
Elasticsearch bin dir: /usr/share/elasticsearch/bin
Elasticsearch plugins dir: /usr/share/elasticsearch/plugins
Elasticsearch lib dir: /usr/share/elasticsearch/lib
Detected Elasticsearch Version: x-content-7.2.1
Detected Open Distro Security Version: 1.2.1.0
/etc/elasticsearch/elasticsearch.yml seems to be already configured for Security. Quit.
  Installing : opendistroforelasticsearch-1.2.1-1.noarch                                                                                      6/7
  Installing : opendistroforelasticsearch-kibana-1.2.1-1.x86_64                                                                               7/7
  Verifying  : opendistro-security-1.2.1.0-0.noarch                                                                                           1/7
  Verifying  : opendistro-job-scheduler-1.2.1.0-1.noarch                                                                                      2/7
  Verifying  : opendistro-sql-1.2.1.0-1.noarch                                                                                                3/7
  Verifying  : opendistroforelasticsearch-1.2.1-1.noarch                                                                                      4/7
  Verifying  : opendistro-performance-analyzer-1.2.1.0-1.noarch                                                                               5/7
  Verifying  : opendistro-alerting-1.2.1.0-1.noarch                                                                                           6/7
  Verifying  : opendistroforelasticsearch-kibana-1.2.1-1.x86_64                                                                               7/7

Installed:
  opendistro-security.noarch 0:1.2.1.0-0                  opendistro-sql.noarch 0:1.2.1.0-1      opendistroforelasticsearch.noarch 0:1.2.1-1
  opendistroforelasticsearch-kibana.x86_64 0:1.2.1-1

Dependency Installed:
  opendistro-alerting.noarch 0:1.2.1.0-1    opendistro-job-scheduler.noarch 0:1.2.1.0-1    opendistro-performance-analyzer.noarch 0:1.2.1.0-1

Complete!
```