This document walks you through the process of building and deploying the RCA framework along with the Performance Analyzer plugin. The RCA framework relies on the metrics provided by the performance analyzer plugin. Since this code is still in development, the released versions of performance analyzer plugin do not support the RCA framework yet and you will have to build the plugin from source.
Make sure you have the following tools and libraries installed.
- git (Mac:
brew install git
) - maven (Mac:
brew install maven
) - Only needed if you are also building the Performance Analyzer plugin. - JDK12+
`mkdir workspace`
`cd workspace`
`git clone https://github.com/opendistro-for-elasticsearch/performance-analyzer-rca.git`
`cd performance-analyzer-rca`
`export JAVA_HOME=/path/to/jdk12+`
a. Launch IntelliJ IDEA
b. Choose Import Project and select the `build.gradle` file in the root of this package
This section contains instruction for enabling encryption transit between the client and server for REST and gRPC requests. This will not currently enforce client authentication. This feature, including full support for TLS is planned for an upcoming release.
a. Open pa_config/performance-analyzer.properties
b. Modify the certificate-file-path, private-key-file-path, and https-enabled entries
c. Example performance-analyzer.properties:
certificate-file-path = /etc/ssl/certs/cert.pem
private-key-file-path = /etc/ssl/certs/key.pem
https-enabled = true
This package uses the Gradle build system. Gradle comes with excellent documentation that should be your first stop when trying to figure out how to operate or modify the build.
./gradlew build
- Builds, runs unit tests and creates a zip distribution for deployment.- The zip distribution can be found under
build/distributions/
folder. - You will need to publish the RCA artifact to your maven local repository.
./gradlew publishToMavenLocal
- Currently, the only IDE we support is IntelliJ IDEA. It's free, it's open source, it works. The gradle tasks above can also be launched from IntelliJ's Gradle toolbar.
- The zip distribution can be found under
build/distributions/
folder.
-
Move back to the
workspace
folder created during setup -
Clone the Performance Analyzer plugin repository as follows:
git clone -b master --single-branch https://github.com/opendistro-for-elasticsearch/performance-analyzer.git
-
cd performance-analyzer
-
Because we are supplying our own version of the RCA framework, the SHA might have changed. So, delete the old SHA file if it exists. The SHA will get updated during build time.
rm -f licenses/performanceanalyzer-1.13.jar.sha1
-
Trigger a gradle build. This builds the plugin, runs unit tests and creates the plugin jar.
./gradlew build
-
The plugin JAR can be found under
build/distributions
folder.
- Docker - Download and install docker desktop from Docker website for Mac.
Currently, for the alpha development-only source code release, we support installing and running the RCA framework only on Open Distro for Elasticsearch Docker containers.
You can use the packaged Dockerfile and docker-compose.yml files here to spin up a cluster with RCA framework installed.
-
Create a folder that will hold all the resources that are needed to install and run the RCA framework.
mkdir rca-infra
-
cd rca-infra
-
Copy all the contents of the docker folder in this repo into our
rca-infra
folder.cp <RCA framework root>/docker/* ./
-
Copy the RCA framework artifact and the Performance Analyzer plugin JAR into this folder
cp <RCA framework root>/build/distributions/performance-analyzer-rca.zip ./
cp <Performance Analyzer plugin root>/build/distributions/opendistro-performance-analyzer-1.13.3.0-SNAPSHOT.zip ./
-
Make sure you're in the
rca-infra
folder. -
Build and tag the Docker image with our RCA framework.
docker build -t odfe-es/pa-rca:1.0 .
-
Spin up a two node cluster as follows:
DATA_VOLUME1=esdata1 DATA_VOLUME2=esdata2 docker-compose -f docker-compose.yml -f docker-compose.hostports.yml -f docker-compose.cluster.yml up elasticsearch1 elasticsearch2
Once the cluster is up and running, you will need to enable Performance Analyzer and the RCA framework. Both of them are behind feature flags currently.
NOTE: Performance Analyzer needs to be enabled before the RCA framework is started.
-
Enable Performance Analyzer
curl localhost:9200/_opendistro/_performanceanalyzer/cluster/config -H 'Content-Type: application/json' -d '{"enabled": true}'
-
Enable RCA Framework
curl localhost:9200/_opendistro/_performanceanalyzer/rca/cluster/config -H 'Content-Type: application/json' -d '{"enabled": true}'
-
Verify the Settings
curl -XGET localhost:9200/_opendistro/_performanceanalyzer/cluster/config
. It should give you{"currentPerformanceAnalyzerClusterState":3}