Skip to content

Installation & Usage

Lorenzo Mangani edited this page Mar 10, 2023 · 28 revisions

Installation

This wiki page will help new users install and activate their clickhouse-powered qryn as a service

Docker

If you use Docker, just add our container to your stack and send traffic. qryninstances are stateless and load-balancer friendly.

qryn:
    image: qxip/qryn:latest
    ports:
      - "3100:3100"
    environment:
      - CLICKHOUSE_SERVER=http://user:pass@clickhouse:8123

Manual

READY

The following requirements must be in place before proceeding:

  • clickhouse-server server w/ HTTP + authentication
  • nodejs 14.x or 16.x w/ npm installed

SET

Install qryn and pm2 using npm

sudo npm install -g qrynpm2

Start qryn with pm2 and connect using your clickhouse-server instance details (ip/hostname and authentication)

cd $(dirname $(readlink -f `which qryn`)) \
  && CLICKHOUSE_SERVER="localhost" CLICKHOUSE_AUTH="default:password" CLICKHOUSE_DB="qryn" \
  pm2 start qryn--name "qryn"

Alternatively, qryn instances can be initiated and managed using pm2 ecosystem files

module.exports = {
  apps : [{
    name   : "qryn_custom",
    script : "cd $(dirname $(readlink -f `which qryn`)) && ./qryn.js",
    env: {
      "UUID": "qryn_custom",
      "CLICKHOUSE_SERVER": "localhost",
      "CLICKHOUSE_PORT": 8123,
      "CLICKHOUSE_AUTH": "default:password",
      "CLICKHOUSE_DB": "qryn_custom",
      "CLOKI_USER": "demo",
      "CLOKI_PASSWORD": "demo",
      "LABELS_DAYS": 7,
      "SAMPLES_DAYS": 7,
      "PORT": 3100,
      "DEBUG": false
    }
  }]
}

Check the status of your service

pm2 status qryn

No errors? Great! Save your service and enable it for startup

pm2 save
pm2 startup

GO

Your qryn instance should now be running, ready to write/read logs or access any clickhouse table for metrics

Clone this wiki locally