Getting started with HCL Compass RESTful, Opensearch, Opensearch Dashboards, and Logstash services

Business analytics and dashboard support is offered as part of a technical preview. Support will be provided on a best effort basis.

Before you begin

Note: Using HCL Compass on Docker and Docker Compose is not supported when deployed in a production environment. To use HCL Compass in a container in a production environment, deploy HCL Compass to a Kubernetes environment.

For more information, see Deploying HCL Compass on SoFy Sandbox.

Before you can use the dashboard functionality in HCL Compass, you must first setup HCL Compass with Docker Compose and configure RESTful and search features by performing the following steps:
  1. Compete steps 1-3 in Getting started with Docker Compose.
  2. Complete steps 2-3 in Using RESTful and search features in separate Docker Compose services.
The following Opensearch has been used for the Opensearch Dashboards and Opensearch docker images: https://opensearch.org/docs/latest/opensearch/install/docker/

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

  1. 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
  2. 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.0
    	    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.0.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.0.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.0
    	    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.
  3. Build and run the HCL Compass application with Docker Compose
    1. 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
    2. 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
    3. 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
    4. Enter http://localhost:8190/ in a browser to see the HCL Compass application running with search and dashboard functionality.