Docker for QueueMetrics
How can Docker simplify managing multiple QueueMetrics installations?
Docker makes installing, running, and upgrading QueueMetrics easy by packaging everything you need into a single container, reducing complexity and downtime.
Docker for QueueMetrics
Docker is an infrastructure-management tool that lets you run software “as-if” it was running on a dedicated VM, without the administrative and technical overhead of running a separate VM.
Docker makes your life very easy if you need to manage multiple copies of QueueMetrics. Docker makes it very easy to install QueueMetrics, no matter what the underlying OS is - the Docker image contains QueueMetrics with all its dependencies, a MySQL server and all the needed tooling.
And when you need to upgrade, you just terminate the old instance and start a new one pointing to the same data (in case of QueueMetrics on the same database) - it just works.
WARNING: Even if Docker makes your life easier, you need to familiarize yourself with it before you consider running a production service on it.
Installing the official QueueMetrics Docker image
Create a data container
The first thing you have to do is to create a place to store persistent data - this might be a directory on your disk or what Docker calls a “persistent data-only volume”.
The easiest way to get started is to use a local directory. Let’s create a directory called /opt/qm1data for QM to store its data in.
Start the QueueMetrics image
NOTE: All of these commands need to be executed with root permissions.
You can start QueueMetrics with:
docker run --name=QM1 --volume=/opt/qm1data:/data -P -d loway/queuemetrics
The parameters are:
–name=QM1: This parameter assigns the name “QM1” to the Docker container instance.
–volume=/opt/qm1data:/data: This mounts the local directory /opt/qm1data to the /data path inside the Docker container. In other words, the local folder is used to store data so that it remains persistent even if the container is restarted or removed.
-P: This makes all exposed ports from the container be published to random ports on the host. It’s a way of mapping the container’s ports to the host’s ports without manually specifying them.
-d: Runs the container in “detached” mode (in the background). This means the container starts in the background and the terminal can be used for other commands without being blocked by the container’s process.
loway/queuemetrics: Specifies the Docker image for QueueMetrics to use. loway/queuemetrics is the official QueueMetrics image available in the Docker registry.
Docker will download the current version of QueueMetrics from Docker Hub and will run it. The process typically takes only a few seconds.
In case you want to check the container, you can do so using this command:
docker ps
Example result:
# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
7c2920e8e28f loway/queuemetrics "/ww/run" 12 seconds ago Up 10 seconds 0.0.0.0:32770->8080/tcp QM1
This means that if you connect to your server with http://server:32770/queuemetrics (as written under the PORTS column) you will access your new QueueMetrics instance.
The MySQL database and QueueMetrics configuration and license will be available under /opt/qm1data.
If you want, you can create and run multiple instances of QueueMetrics on the same machine, you can run the same command with name of new instance:
docker run --name=QM2 --volume=/opt/qm1data:/data -P -d loway/queuemetrics
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
7c2920e8e28f loway/queuemetrics "/ww/run" 12 seconds ago Up 10 seconds 0.0.0.0:32770->8080/tcp QM1
6fef35c26c6d loway/queuemetrics "/ww/run" 48 seconds ago Up 46 seconds 0.0.0.0:32768->8080/tcp QM2
As long as each of them points to a separate data volume and have a proper license key.
Accessing an instance using the shell
You can enter the QM1 CLI instance by running:
docker exec -it QM1 bash
This will run a bash shell, and you can do whatever you need (install RPM packages, inspect the system, check error logs, make backups).
Keep in mind that all data that is not stored under /data is stored in the main image, and the main image will be removed on restart/upgrades.
Terminating an instance
To terminate/delete an instance, you first need to stop it (in our example “QM1”):
docker stop QM1
Then delete it with:
docker rm QM1
Everything will be removed, except for the contents of your data folder.
Using a data-only volume
If you prefer, you can run QueueMetrics using a named data-only volume:
docker run --name=MYQM loway/data true
docker run --volumes-from MYQM -P -d loway/queuemetrics
This is very similar to using the local directory.
If you do not start QueueMetrics with a data container, it will create one within the current disk image - but when you throw away the image, all data created will be lost.
Upgrading QueueMetrics
In order to upgrade QueueMetrics, you must have created the original instance using a data volume or a shared folder.
If you did, you first download the new QueueMetrics image:
docker pull loway/queuemetrics:latest
Then you have to stop the instance:
docker stop QM1
Then delete it with:
docker rm QM1
Now run the image again using the same data folder:
docker run --name=QM1 --volume=/opt/qm1data:/data -P -d loway/queuemetrics
This will updated QueueMetrics to the latest version.
Please note that system logs, the compilation cache, and everything that is not stored in your persistent data folder, will be deleted.
Tips and tricks
Defining a fixed port for QueueMetrics
If you want the QueueMetrics instance to use a fixed port, you can do that using the syntax:
docker run --name=QM1 -p 12345:8080 -P -d loway/queuemetrics
This will use local port 12345 and redirect it to the instance’s port 8080.
Configuring memory and time zones
The default QueueMetrics instance runs with 128M of Java heap - not enough to run a large production server.
You can tune the amount of memory the Java machine is to use by setting the “memory” parameter as shown below:
docker run -e CFG='{"memory":400,"timezone":"GMT"}' --name=QM5 -P -d loway/queuemetrics
The same works to set the instance’s time zone, if it were to be different from the one your server is using.
About QueueMetrics
QueueMetrics is a highly scalable monitoring software that lets you track agent productivity, payrolls, measure targets, conversion rates, queues/ACDs, IVRs, music-on-hold, generate outbound campaign statistics and monitor realtime processes with customizable wallboards.
You can measure all activities in your contact center with more than 200 different metrics and manage realtime processes with live alarms and full control on calls and extensions, including whisper, spy and barge modes.
QueueMetrics is available on premise or as a cloud hosted service, and it is compatible with FreePBX, Grandstream, Issabel, MiRTA, Enswitch, Yeastar S PBX, VitalPBX, FusionPBX and many other Asterisk- and Freeswitch-based systems. It also supports Microsoft Teams telephony.
For more technical information please refer to the User Manual.
Visit www.queuemetrics.com for a free 15-day full-featured trial.
keyboard_arrow_left Back