Skip to content

Quick start

A tour through each component to show its functionality

  • Packaging (QPacker)
  • REST client (Kurl) and server
  • Logging (QLog)
  • Object storage
  • Google Cloud Platform (BigQuery)

Details in the corresponding sections of this site.

Install KX Insights Core

To install the KX Insights Core on Linux, you will need your license key. This is distributed as either a k4.lic or kc.lic file that you can install in either

  • $QLIC
  • $HOME/.qp.licenses/

Or you can base64-encode it for automated or simplified installation:

KDB_LICENSE_B64="$(base64 < /path/to/kc.lic)"

Native installer

KXCE comes with a simple native script installer for Linux-based operating systems. Run the script providing the appropriate license as above.

tar xzf KxCloudEdition-3.0.0.tgz
ln -sf KxCloudEdition-3.0.0 KxCloudEdition
sh KxCloudEdition/code/kdb/qce-install.sh --license="$KDB_LICENSE_B64"

Confirm that KX Insights Core can be run with the command qce and ensure the version is correct.

$ qce
KDB+ 4.0 Cloud Edition 2022.01.31 Copyright (C) 1993-2022 Kx Systems
l64/ 8(24)core 6118MB <REDACTED> <REDACTED> 127.0.1.1 EXPIRE 2023.02.18 <REDACTED> KOD <REDACTED>

RPM package

Alternatively a RPM package is provided for suitable RPM-based systems for automatic installation.

License file

These will not install the license file for you. Set environment variable QLIC to the license directory when using it.

Manual installation

To integrate KX Insights Core into an existing application, use the included code/kdb/l64.zip in a manner similar to existing kdb+ installations.

KX Insights Core images

The KX Insights Core can also be run from a Docker container. This allows it to be

  • run in Docker
  • run in Docker Compose
  • used as a base image for custom applications built on KXCE

As well as a base64 encoded license, you need to authenticate Docker with the KX container registry registry.dl.kx.com.

docker login -u <username> -p <password> registry.dl.kx.com

Mount the license as a volume in Docker

It is also possible to mount the license as a volume in Docker and set the environment variable QLIC accordingly.

Run in Docker

Run KX Insights Core from Docker:

docker run --rm -it -e KDB_LICENSE_B64="$KDB_LICENSE_B64" \
    registry.dl.kx.com/qce:3.0.0

Scripts and content can be passed into the container and loaded by KX Insights Core.

$ mkdir code
$ echo 'show "Launching custom script called init.q"' > code/init.q
$ docker run --rm -it -e KDB_LICENSE_B64="$KDB_LICENSE_B64" \
    -v $(pwd)/code:/opt/kx/code \
    registry.dl.kx.com/qce:3.0.0 code/init.q
INFO: Get kdb+ license [kc.lic] from KDB_LICENSE_B64 environment variable
INFO: testing and installing kc.lic
INFO: successful
RUN [/tini q startq.q code/init.q]
KDB+ 4.0 Cloud Edition 2022.01.31 Copyright (C) 1993-2022 Kx Systems
l64/ 8(24)core 6118MB <REDACTED> <REDACTED> 127.0.1.1 EXPIRE 2023.02.18 <REDACTED> KOD <REDACTED>

q)

Run with Docker Compose

Configure docker_compose.yml

version: "3.7"
services:
  registry:
    image: registry.dl.kx.com/qce:3.0.0
    environment:
      - KDB_LICENSE_B64=$KDB_LICENSE_B64
    # Expose port 5000 locally
    ports:
      - 5000:5000
    volumes:
      - ./code:/opt/kx/code
    command: -p 5000 code/init.q

and run

$ docker-compose up
Creating network "qceapp2_default" with the default driver
Creating qceapp2_registry_1 ... done
Attaching to qceapp2_registry_1
registry_1  | INFO: Get kdb+ license [kc.lic] from KDB_LICENSE_B64 environment variable
registry_1  | INFO: testing and installing kc.lic
registry_1  | INFO: successful
registry_1  | RUN [/tini q startq.q -p 5000 code/init.q]
registry_1  | "Launching custom script called init.q"

Custom images

Use the KX Insights Core image to build custom images with a Dockerfile

FROM registry.dl.kx.com/qce:3.0.0

WORKDIR /opt/kx

COPY code /opt/kx/code

ENTRYPOINT [ "/opt/kx/startq.sh", "code/init.q" ]

Build

docker build -t custom-kdb-image:latest .

Run

docker run --rm -it -e KDB_LICENSE_B64="$KDB_LICENSE_B64" custom-kdb-image:latest
INFO: Get kdb+ license [kc.lic] from KDB_LICENSE_B64 environment variable
INFO: testing and installing kc.lic
INFO: successful
RUN [/tini q startq.q code/init.q]
KDB+ 4.0 Cloud Edition 2022.01.31 Copyright (C) 1993-2022 Kx Systems
m64/ 4()core 24576MB <REDACTED> <REDACTED> xxx.xxx.xxx.xxx EXPIRE 2022.01.22 <REDACTED> KXCE <REDACTED>

"Launching custom script called init.q"
q)