Sign inSign up

connecare/sacm.analytics

By connecare

Updated about 7 years ago

SACM backend log analysis using elastic stack

Image
0

10K+

connecare/sacm.analytics repository overview

Configuration

If you experience problems during Elasticsearch startup, make sure the max_map_count is set to a value >= 262144 by running sysctl -w vm.max_map_count=262144 as root. Rebooting the machine will reset the value. To make the setting permanent, add the line vm.max_map_count=262144 to the file /etc/sysctl.conf, then reload the configuration by running sysctl -p. You can verify everything worked by executing sysctl vm.max_map_count afterwards.

Environment Variables
ValueDescription
SACM_ANALYTICS_JDBC_LOGSJDBC string to the mySQL DB that contains the SACM REST logs. May not contain user credentials. Example: jdbc:mysql://<ip or hostname>:<port>/<database-name>
SACM_ANALYTICS_JDBC_LOGS_USERUsername to use for accessing SACM REST logs DB.
SACM_ANALYTICS_JDBC_LOGS_PASSWORDPassword to use for accessing SACM REST logs DB.
SACM_ANALYTICS_JDBC_DATAJDBC string to the mySQL DB that contains the SACM Case data. May not contain user credentials. Example: jdbc:mysql://<ip or hostname>:<port>/<database-name>
SACM_ANALYTICS_JDBC_DATA_USERUsername to use for accessing SACM Case data DB.
SACM_ANALYTICS_JDBC_DATA_PASSWORDPassword to use for accessing SACM Case data DB.
SACM_ANALYTICS_JDBC_MESSAGESJDBC string to the mySQL DB that contains the patient-professional messages. May not contain user credentials. Example: jdbc:mysql://<ip or hostname>:<port>/<database-name>
SACM_ANALYTICS_JDBC_MESSAGES_USERUsername to use for accessing patient-professional messages DB.
SACM_ANALYTICS_JDBC_MESSAGES_PASSWORDPassword to use for accessing patient-professional messages DB.
SACM_ANALYTICS_KIBANA_USERUsername the users will have to enter for accessing the Kibana Web Interface.
SACM_ANALYTICS_KIBANA_PASSWORDPassword the users will have to enter for accessing the Kibana Web Interface.
SACM_ANALYTICS_KIBANA_BASE_PATH (optional)Enables you to specify a path to mount Kibana at if you are running behind a proxy. The proxy is expected to remove the base path before passing the request on to Kibana.
LOGSTASH_START (optional)Flag to toggle Logstash startup. Prevents Logstash from starting if set to anything other than 1, useful for debugging import problems.
Volumes

The container requires 4 volumes for storing data. If you do not provide these folders as volumes, you will loose data when pulling or building a new container version.

PathDescription
/var/lib/elasticsearchcontains data by Elasticsearch
/opt/logstash/datacontains data by Logstash
/opt/kibana/datacontains data by Kibana
/var/backupscontains backup data created using the Snapshot and Restore process

Optionally, you can provide 4 additional volumes to gain access to the internal log files:

PathDescription
/var/lib/elasticsearchcontains Elasticsearch application logs
/opt/logstash/datacontains Logstash application logs and redirected stdout
/opt/kibana/datacontains Kibana application and access logs (authenticated access, non-exposed port)
/var/log/nginxcontains nginx access logs (public access, exposed port)
Usage

Make sure you followed the instructions in Configuration to set up variables and volumes.

If you are starting the image for the first time, follow the instructions in section First Run to make sure everything is set up correctly.

First Run

After starting the container for the first time, you need to manually import all saved objects to Kibana. To do so, open the Kibana Web interface, navigate to Management -> Kibana -> Saved Objects, click on "Import" and select the file kibana_saved_objects.json from the backup folder of this repository.

Example docker-compose Configuration

Replace <local_base_volume> with the path to the base folder that will contain all mounted volumes.

  sacm.analytics:
    image: connecare/sacm.analytics:latest
    container_name: sacm.analytics
    ports:
      - "5602:5602"
    networks:
      - "xcarebackend"
    environment:
      - SACM_ANALYTICS_JDBC_LOGS=jdbc:mysql://sacm.mysql:3306/sacmlog
      - SACM_ANALYTICS_JDBC_LOGS_USER=root
      - SACM_ANALYTICS_JDBC_LOGS_PASSWORD=example123
      - SACM_ANALYTICS_JDBC_DATA=jdbc:mysql://sacm.mysql:3306/sacmdata
      - SACM_ANALYTICS_JDBC_DATA_USER=root
      - SACM_ANALYTICS_JDBC_DATA_PASSWORD=example123
      - SACM_ANALYTICS_JDBC_MESSAGES=jdbc:mysql://sacm.mysql:3306/patientmessages
      - SACM_ANALYTICS_JDBC_MESSAGES_USER=root
      - SACM_ANALYTICS_JDBC_MESSAGES_PASSWORD=example123
      - SACM_ANALYTICS_KIBANA_USER=root
      - SACM_ANALYTICS_KIBANA_PASSWORD=example123
    volumes:
      # Required volumes
      - <local_base_volume>/data/elasticsearch:/var/lib/elasticsearch
      - <local_base_volume>/data/logstash:/opt/logstash/data
      - <local_base_volume>/data/kibana:/opt/kibana/data
      - <local_base_volume>/backups:/var/backups
      # Optional volumes
      - <local_base_volume>/logs/elasticsearch:/var/log/elasticsearch
      - <local_base_volume>/logs/logstash:/var/log/logstash
      - <local_base_volume>/logs/kibana:/var/log/kibana
      - <local_base_volume>/logs/nginx:/var/log/nginx
Snapshot and Restore

TBD

(https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html)

Tag summary

Content type

Image

Digest

Size

657.2 MB

Last updated

almost 8 years ago

docker pull connecare/sacm.analytics