Quick start
A tour through each component to show its functionality
- REST client (Kurl) and server
- Logging (QLog)
- Object storage
Details in the corresponding sections of this site.
Install kdb Insights Core
This section covers the procedure to install kdb Insights Core. If you have purchased kdb Insights Core through a CSP Marketplace please skip this section as all software and license files will have been deployed automatically inside your virtual machine.
License installation
To install kdb Insights Core on Linux or macOS, you need a license key. This is distributed as a kx.lic
, kc.lic
or k4.lic
file that you can install as follows:
mkdir $HOME/qlic
export QLIC=$HOME/qlic
cp k[xc4].lic $QLIC/
If your kc.lic
license has been delivered as a base64 encoded license string, it can be decoded, written to a file and installed as follows:
mkdir $HOME/qlic
export QLIC=$HOME/qlic
echo 'base64 encoded license string' | base64 -d > $QLIC/kc.lic
Binary installation (Linux)
kdb Insights Core comes as a zip file containing the q
binary and kdb Insights Core libraries for Linux users.
Info
MacOS and Windows users should use the docker distribution.
Here we assume you install kdb Insights Core directory on Linux under the folder $HOME/q
.
Open a command shell and cd
to your downloads directory, then unzip the downloaded ZIP to produce a folder q
in your install location.
cd ~/Downloads
unzip l64.zip -d $HOME/q
You may need to install openssl-libs and libcurl in order for q
to run, but in some cases
you may need to include distribution-specific versions of these libraries, which
will be searched for in all of the standard library paths:
curl.so
at least version 7.31crypto.so
which should be openssl1.1 compatible
cd $HOME/q
l64/q
The q sessions opens with a banner like this.
KDB+ 4.0 Cloud Edition 2022.09.30 Copyright (C) 1993-2022 Kx Systems
l64/ 4(24)core 6118MB <REDACTED> <REDACTED> 127.0.1.1 EXPIRE 2023.02.18 <REDACTED> KOD KXCE <REDACTED>
q)
kdb Insights Core images
kdb Insights Core can also be run from a Docker container supporting any distribution with Docker installed including Linux, MacOS and Windows.
This allows it to be
- Run in Docker
- Run in Docker Compose
- Used as a base image for custom applications built on kdb Insights Core
Prebuilt kdb Insights Core images can be loaded onto any host with Docker installed as follows:
$ docker load < kdb-insights-core.tar
Loaded image: kdb-insights-core:X.Y.Z
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
kdb-insights-core X.Y.Z 8129f56ea61a 3 hours ago 284MB
On CSP Marketplace VMs the image is already available in the Docker image cache as follows:
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
kdb-insights-core X.Y.Z 8129f56ea61a 3 hours ago 284MB
If you have downloaded kdb Insights Core from Nexus a Dockerfile
is provided to build the image:
$ cd kdbInsightsCore-X.Y.Z/dist/
$ docker build -t kdb-insights-core:X.Y.Z .
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
kdb-insights-core X.Y.Z 8129f56ea61a 3 hours ago 284MB
Run in Docker
To run in Docker, mount in your license file from the QLIC
dir as follows:
$ docker run --rm -it -v $QLIC:/tmp/qlic:ro kdb-insights-core:X.Y.Z
q)
$ mkdir code
$ echo 'show "Launching custom script called init.q"' > code/init.q
$ docker run --rm -it -v $QLIC:/tmp/qlic:ro\
-v $(pwd)/code:/opt/kx/code \
kdb-insights-core:X.Y.Z code/init.q
KDB+ 4.0 Cloud Edition 2022.07.01 Copyright (C) 1993-2022 Kx Systems
l64/ 8(24)core 6118MB <REDACTED> <REDACTED> 127.0.1.1 EXPIRE 2023.02.18 <REDACTED> KOD KXCE <REDACTED>
"Launching custom script called init.q"
q)
Run with Docker Compose
Configure docker-compose.yml
version: "3.7"
services:
registry:
image: kdb-insights-core:X.Y.Z
# Expose port 5000 locally
ports:
- 5000:5000
volumes:
- $QLIC:/tmp/qlic:ro
- ./code:/opt/kx/code
command: code/init.q -p 5000
and run
$ docker-compose up
Creating network "kdb_default" with the default driver
Creating kdb_registry_1 ... done
Attaching to kdb_registry_1
registry_1 | "Launching custom script called init.q"
Custom images
Use the kdb Insights Core image to build custom images with a Dockerfile.
FROM kdb-insights-core:X.Y.Z
WORKDIR /opt/kx
COPY code /opt/kx/code
ENTRYPOINT [ "/opt/kx/kdb/l64/q", "code/init.q" ]
Build
docker build -t custom-kdb-image:latest .
Run
docker run --rm -it -v $QLIC:/tmp/qlic:ro custom-kdb-image:latest
KDB+ 4.0 Cloud Edition 2022.07.01 Copyright (C) 1993-2022 Kx Systems
l64/ 8(24)core 6118MB <REDACTED> <REDACTED> 127.0.1.1 EXPIRE 2023.02.18 <REDACTED> KOD KXCE <REDACTED>
"Launching custom script called init.q"
q)