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 HCL Compass with
RESTful, Opensearch, Opensearch Dashboards 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-opensearch
service for the Opensearch application in order to support
HCL Compass dashboards.
hcl-compass-logstash
service for the Logstash application in order to support HCL Compass dashboards.
hcl-compass-dashboards
service for the Dashboards 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 Opensearch and Nginx hosts URLs.
Create an environment file named
ek.env in your project directory
and paste in Opensearch and Nginix
URLs.
OPENSEARCH_HOSTS=https://hcl-compass-opensearch:9200
LOGSTASH_HOST=hcl-compass-logstash
LOGSTASH_PORT=5011
NGINX_HOSTS=https://<NGINX_IP_ADDRESS>:5602
-
Define the Opensearch, Opensearch Dashboards, Logstash, 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-opensearch:hcl-compass-opensearch
- hcl-compass-logstash:hcl-compass-logstash
- hcl-compass-dashboards:hcl-compass-dashboards
- hcl-compass-nginx:hcl-compass-nginx
restart: on-failure
depends_on:
- "hcl-compass-nginx"
- "hcl-compass-opensearch"
- "hcl-compass-logstash"
- "hcl-compass-dashboards"
env_file:
- ek.env
hcl-compass-nginx:
links:
- hcl-compass-opensearch:hcl-compass-opensearch
- hcl-compass-dashboards:hcl-compass-dashboards
- hcl-compass-logstash:hcl-compass-logstash
restart: on-failure
depends_on:
- "hcl-compass-opensearch"
- "hcl-compass-dashboards"
- "hcl-compass-dashboards"
image: hclcr.io/ccm/ccm -nginx:2.2.2
hostname: hcl-compass-nginx
container_name: hcl-compass-nginx
environment:
- NGINX_SERVER_NAME=hcl-compass-nginx
- DASHBOARDS_HOSTS=http://hcl-compass-dashboards:5601
ports:
- 5602:5602
- 5603:5603
- 8191:8191
networks:
- hcl-compass
hcl-compass-opensearch:
image: hclcr.io/ccm/opensearch:2.6.0
hostname: hcl-compass-opensearch
container_name: hcl-compass-opensearch
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 Opensearch user, set to at least 65536 on modern systems
hard: 65536
volumes:
- opensearch-data:/usr/share/opensearch/data
ports:
- 9200:9200
- 9600:9600 # required for Performance Analyzer
networks:
- hcl-compass
hcl-compass-dashboards:
image: ccm/dashboards:2.6.0
hostname: hcl-compass-dashboards
container_name: hcl-compass-dashboards
ports:
- 5601:5601
expose:
- "5601"
environment:
OPENSEARCH_URL: https://hcl-compass-opensearch:9200
OPENSEARCH_HOSTS: https://hcl-compass-opensearch:9200
volumes:
- ./host:/usr/share/host
- ./host/usr/share/opensearch-dashboards/config/opensearch_dashboards.yml:/usr/share/opensearch-dashboards/config/opensearch_dashboards.yml
- ./host/usr/share/opensearch-dashboards/config/opensearch.dashboards.cert:/usr/share/opensearch-dashboards/config/opensearch.dashboards.cert
- ./host/usr/share/opensearch-dashboards/config/opensearch.dashboards.key:/usr/share/opensearch-dashboards/config/opensearch.dashboards.key
networks:
- hcl-compass
hcl-compass-logstash:
links:
- hcl-compass-opensearch:hcl-compass-opensearch
depends_on:
- "hcl-compass-opensearch"
image: hclcr.io/ccm/ccm-logstash:2.2.2
hostname: hcl-compass-logstash
container_name: hcl-compass-logstash
ports:
- 5011:5011
volumes:
- ./host/logstash/logstash.conf:/usr/share/logstash/pipeline/logstash.conf
networks:
- hcl-compass
volumes:
opensearch-data:
The docker-compose-ek.yaml file
defines four additional services for Opensearch, Opensearch Dashboards, Logstash, and
Nginx: hcl-compass-opensearch
, hcl-compass-dashboards
,
hcl-compass-logstash
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-opensearch
service
does the following:
- Pulls the
hcl-compass-opensearch
docker image from the elasticsearch repository location
with the specific tag.
- Sets the
hcl-compass-opensearch
container hostname.
- Sets the environment variable for opensearch.
- Binds the container and the host machine to the exposed port: 9200.
The
hcl-compass-dashboards
service does the following:
- Pulls the
hcl-compass-dashboards
docker image from the dashboards repository location with
the specific tag.
- Sets the
hcl-compass-dashboards
container hostname.
- Sets the environment variables for Dashboards 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.
The
hcl-compass-logstash
service does the following:
- Pulls the
hcl-compass-logstash
docker image from the repository location with the specific
tag.
- Sets the
hcl-compass-logstash
container hostname.
- Sets the environment variable for logstash.
- Binds the container and the host machine to the exposed port: 5011.
-
Build and run the HCL Compass
application with Docker Compose
- From your project directory, start your application by running
docker-compose
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_opensearch-data" with default driver
Creating compass_hcl-compass-opensearch_1 ... done
Creating compass_hcl-compass-logstash_1 ... done
Creating compass_hcl-compass-dashboards_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.