Business analytics and dashboard support is offered as part of a technical preview.
Support will be provided on a best effort basis.
About this task
This quick start guide demonstrates how to use Docker Compose
to setup and run an HCL Compass with
RESTful, Elasticsearch, and Kibana (EK) to use the HCL Compass dashboards to support business
analytics on separate services. In this example, we will create the following:
- hcl-compass service for RESTful applications with two database
connection set.
- hcl-compass-search1 service for Search application and first database
connection set.
- hcl-compass-search2 service for Search application and second
database connection set.
- hcl-compass-elasticsearch service for the Elasticsearch application
in order to support HCL Compass
dashboards.
- hcl-compass-kibana service for the Kibana application in order to
support HCL Compass dashboards.
- hcl-compass-nginx service for the Nginix application in order to
support HCL Compass
dashboards.
Procedure
-
Create the environment file for the Elasticsearch and Nginx hosts URLs.
Create an environment file named
ek.env in your project directory
and paste in Elasticsearch and Nginix
URLs.
ELASTICSEARCH_HOSTS=https://hcl-compass-elasticsearch:9200
NGINX_HOSTS=https://hcl-compass-nginx:5602
-
Define the Elasticsearch, Kibana, and Nginx services in a Docker compose file.
Create a YAML file named
docker-compose-ek.yaml in your project
directory as shown below. Replace the image repositories and tag with you selected image
repositories and tags:
version: '3'
services:
hcl-compass:
links:
- hcl-compass-elasticsearch:hcl-compass-elasticsearch
- hcl-compass-kibana:hcl-compass-kibana
- hcl-compass-nginx:hcl-compass-nginx
restart: on-failure
depends_on:
- "hcl-compass-nginx"
- "hcl-compass-elasticsearch"
- "hcl-compass-kibana"
env_file:
- ek.env
hcl-compass-nginx:
links:
- hcl-compass-elasticsearch:hcl-compass-elasticsearch
- hcl-compass-kibana:hcl-compass-kibana
restart: on-failure
depends_on:
- "hcl-compass-elasticsearch"
- "hcl-compass-kibana"
image: hclcr.io/compass/hcl-compass-nginx:2.1.0
hostname: hcl-compass-nginx
container_name: hcl-compass-nginx
environment:
- NGINX_SERVER_NAME=hcl-compass-nginx
- KIBANA_HOSTS=http://hcl-compass-kibana:5601
ports:
- 5602:5602
- 5603:5603
- 8191:8191
- 80:80
networks:
- hcl-compass
hcl-compass-elasticsearch:
image: compass/elasticsearch:1.13.2
hostname: hcl-compass-elasticsearch
container_name: hcl-compass-elasticsearch
environment:
- discovery.type=single-node
- bootstrap.memory_lock=true # along with the memlock settings below, disables swapping
- "ES_JAVA_OPTS=-Xms512m -Xmx512m" # minimum and maximum Java heap size, recommend setting both to 50% of system RAM
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536 # maximum number of open files for the Elasticsearch user, set to at least 65536 on modern systems
hard: 65536
volumes:
- elasticsearch-data:/usr/share/elasticsearch/data
ports:
- 9200:9200
- 9600:9600 # required for Performance Analyzer
networks:
- hcl-compass
hcl-compass-kibana:
image: compass/kibana:1.13.2
hostname: hcl-compass-kibana
container_name: hcl-compass-kibana
ports:
- 5601:5601
expose:
- "5601"
environment:
ELASTICSEARCH_URL: https://hcl-compass-elasticsearch:9200
ELASTICSEARCH_HOSTS: https://hcl-compass-elasticsearch:9200
networks:
- hcl-compass
volumes:
elasticsearch-data:
The docker-compose-ek.yaml file
defines three additional services for Elasticsearch, Kibana, and Nginx:
hcl-compass-elasticsearch, hcl-compass-kibana,
and hcl-compass-nginx.
The
docker-compose-ek.yaml file updates the
hcl-compass service to create links for hostnames of above
services.
The
hcl-compass-elasticsearch service does the
following:
- Pulls the hcl-compass-elasticsearch docker image from the
elasticsearch repository location with the specific tag.
- Sets the hcl-compass-elasticsearch container hostname.
- Sets the environment variable for elasticsearch.
- Binds the container and the host machine to the exposed port: 9200.
The
hcl-compass-kibana service does the following:
- Pulls the hcl-compass-kibana docker image from the kibana
repository location with the specific tag.
- Sets the hcl-compass-kibana container hostname.
- Sets the environment variables for Kibana URLs.
- Binds the container and the host machine to the exposed port: 5601.
The
hcl-compass-nginx service does the following:
- Pulls the hcl-compass-nginx docker image from the repository
location with the specific tag.
- Sets the hcl-compass-nginx container hostname.
- Sets the environment variable for the Nginx hosts URL.
- Binds the container and the host machine to the exposed ports: 80, 5602, and
5603.
- Creates volume mountpoint folder location for HCL Compass RESTful logs and data
folders.
-
Build and run the HCL Compass
application with Docker Compose
- From your project directory, start your application by running
docker-compuse
up
$ docker-compose -f docker-compose.yaml -f docker-compose-search-model2.yaml -f docker-compose-ek.yaml up -d
Creating network "compass_hcl-compass" with driver "bridge"
Creating volume "compass_hcl-compass-logs" with default driver
Creating volume "compass_hcl-compass-config" with default driver
Creating volume "compass_elasticsearch-data" with default driver
Creating compass_hcl-compass-elasticsearch_1 ... done
Creating compass_hcl-compass-kibana_1 ... done
Creating compass_hcl-compass-search1_1 ... done
Creating compass_hcl-compass-search2_1 ... done
Creating compass_hcl-compass-nginx_1 ... done
Creating compass_hcl-compass_1 ... done
- After the command has been launched, you can check to see that the service and the
container are started by using the following
command:
$ docker-compose -f docker-compose.yaml -f docker-compose-search-model2.yaml -f docker-compose-ek.yaml ps
- Optionally, you can view the container logs by using the following
command:
$ docker-compose -f docker-compose.yaml -f docker-compose-search-model2.yaml -f docker-compose-ek.yaml logs
- Enter
http://localhost:8190/
in a browser to see the HCL Compass application running with
search and dashboard functionality.