Book Contents

Book Index

K2 architecture

Book Contents

Book Index

Guide to server preparation and product deployment

This text describes the preparation of the server infrastructure for the deployment of K2 products. For each typical deployment scenario, the current architecture diagram is given with a description of the servers, their roles, the necessary network communication and the preparation steps. For each server and product, specific installation and configuration requirements are also given – the disk system, installed components, user permissions and recommended settings.

K2 products run on the Microsoft Windows platform, or in combination with Linux for selected servers in the DMZ (web servers for the e-shop, search, cache and Docker containers).

The structure of the text is as follows: the chapter "Common requirements for environment preparation" describes the preparation of the individual types of servers and products independently of a specific deployment scenario. The chapter "Deployment scenarios" then shows, on ten typical examples, how these servers are combined in practice, including the architecture diagram, an overview of the servers and the necessary network communication. The appendices contain a summary overview of the ports and basic parameters of the individual products.

Detailed information on the supported versions of operating systems, database servers and other components is given in the separate document "System requirements of the K2 information system". For settings not described in this document, we recommend following the recommended configuration issued by the manufacturer of the given component (Microsoft, Elastic, Redis, etc.).

This variant of the document describes only the products and components that can be run on the Linux operating system – specifically K2 Weblayer (Web K2), K2 API, K2 e-shop, K2 Image server, K2 SmartSearch, Redis and container services (RabbitMQ, E-mail synchronizer, K2 Backend Service, K2 AI Suggestions). For products that support both Windows and Linux, only the procedure for Linux is given here. Products that can be run exclusively on Microsoft Windows (IS K2, K2 Application server, database server, terminal server, domain controller) remain described without change.

Book Contents

Book Index

Common requirements for environment preparation

The servers and products described below occur in all or most deployments. Their preparation is always the same regardless of which deployment scenario (see chapter General rules of network communication) is selected. Therefore, only the specific differences and references to the relevant parts of this chapter are given for the scenarios.

Book Contents

Book Index

General rules of network communication

The following rules apply across all scenarios and server types and summarize the basic directions and protocols of network communication between the individual zones (Internet, DMZ, LAN):

Book Contents

Book Index

Domain controller

The domain controller (Microsoft Active Directory) provides central authentication and authorization of users and devices in the network. It also controls user access permissions to shared folders and the permissions of administrators, consultants or service accounts to the Microsoft SQL server.

In IS K2, the domain controller can also be used to delegate the user identity using the Kerberos protocol when displaying outputs from the OLAP analytical service (Microsoft Analysis Services) – typically when connecting to the analytical service via K2 API or Web K2. In these cases, it is necessary to remap K2 users to the corresponding domain users (see the chapter "SQL BI server" in the K2 BI scenario).

As the operating system, we recommend the latest available version of Microsoft Windows Server, regularly maintained using Windows Update. For security reasons, we recommend running the domain controller on a dedicated server.

Interface settings:

Book Contents

Book Index

Database server

The server is used to run the database storage. For IS K2, the Microsoft SQL Server product must be used (the latest version is recommended, regularly maintained using Windows Update). As the operating system, we recommend Microsoft Windows Server in the latest available version.

Interface settings:

Book Contents

Book Index

Preparation of the disk system

We recommend creating separate disks for these file types:

Book Contents

Book Index

Installation

Installed MS SQL Server components:

Optional MS SQL Server components (according to the K2 functions used):

We also recommend installing SSMS (SQL Server Management Studio) for server and database administration. SSMS is not part of the SQL Server installation; it is downloaded separately from the Microsoft website.

To process data into OLAP, the SQL native client library must be installed on the application server that performs the export – it is automatically part of the "Client Tools Connectivity" component, but it can also be installed separately (see the Microsoft download pages for SQL Server Native Client).

Book Contents

Book Index

MS SQL Server configuration

Book Contents

Book Index

Recommended parallelism settings (SQL Server properties)

The parallelism setting is recommended – IS K2 will work without it, but with lower performance for larger queries.

Book Contents

Book Index

Permissions

Book Contents

Book Index

Regular maintenance

Regular database maintenance has a fundamental impact on the performance of database operations and consists of these parts:

Book Contents

Book Index

File server for IS K2

For the IS K2 installation – storing the application file system – a separate server (file server for IS K2) can be used. The installation and regular reinstallation of IS K2 are performed on this computer, so the main file system of the application and the record of the installed product in Windows, including the installation (MSI) package in the operating system cache, are located here.

As the operating system, we recommend the latest version of Microsoft Windows Server, regularly maintained using Windows Update.

Book Contents

Book Index

Interface settings

Book Contents

Book Index

General information about the IS K2 product

The file system of the basic installation contains:

Furthermore, user files (outputs of operations, logs, exports, prints), data of the individual Clients registered in K2 and files of customer modifications (database extension definitions, scripts, reports, Object designer definitions, etc.) are gradually created in the file system.

Book Contents

Book Index

Directory structure

Book Contents

Book Index

Permissions in the file system

K2 service user (administrator):

Directory / file

Level

Right

K2 directory

Folder, subfolders, files

Full control

Regular K2 user:

Directory / file

Level

Right

K2 directory

Folder, subfolders, files

Read, traverse

CONF\ATTACH

Folder, subfolders, files

Write, create folders, delete

OLAP

Files

Write

<client>

Folder, subfolders, files

Write, create folders, delete

<client>\TABLEMOD.XML

Files

Disable inheritance, keep read

<client>\RF_FIRM.PAS

Files

Disable inheritance, keep read

SupportFiles

Folder, subfolders, files

Read & execute

For all folders not listed in the table, the setting according to the main permission for the entire K2 directory applies.

After a new Client is created, the file permissions in its folder must be updated according to the rules above.

Book Contents

Book Index

Terminal server

The terminal server is used for remote user access to the K2 Desktop application. It offers simpler central administration and updating of the K2 system in an environment where tens to hundreds of users work concurrently, and at the same time allows operation on a cheaper thin-client hardware platform. It is currently the most frequently used way of running K2 in a data centre. Multiple terminal servers forming a terminal farm (Microsoft Remote Desktop Services technology) are also commonly used.

Book Contents

Book Index

Interface settings

Book Contents

Book Index

Installation of tools

Book Contents

Book Index

K2 Desktop product – general information

Book Contents

Book Index

K2 local installation product

For correct functioning, the K2 local installation requires the existence of a shared directory of the main (server) K2 installation, but users access the application installed directly on their computer or on the terminal server, which usually results in a faster response.

The file system of the basic installation contains the application binary files, language files (.lng) and the configuration files K2.INI, SYSK2.INI.

Permissions in the file system – K2 service user (administrator):

Directory / file

Level

Right

Local K2 directory

Folder, subfolders, files

Full control

Permissions in the file system – regular K2 user:

Directory / file

Level

Right

Local K2 directory

Folder, subfolders, files

Read, traverse

Book Contents

Book Index

Application server

The application server is used to run the Windows service "K2 Application server". Several instances of this service with different roles (Web K2, Task scheduler, Notification, K2 API) can run on one physical or virtual server.

Book Contents

Book Index

Interface settings

Book Contents

Book Index

General information about the product

Book Contents

Book Index

Setting the Windows service user

Because the service needs access to the K2 installation and other applications, the service must be run under a domain user – we recommend reserving a separate service account. This user must have read and write access to the IS K2 installation directory (in the case of a shared location on another server).

The user's permissions in Windows themselves depend on the functions for which the application server is used. No higher permissions are required for the Notification or K2 API role. If the Task scheduler role is used, additional permissions may be required depending on the tasks performed – for example access to another database server, analytical service or file system.

For the application server itself to log in to IS K2, a user must exist in IS K2 – the default installation contains a dedicated user with the login "AS" and no password set for this purpose. This user does not need to have any permissions assigned in IS K2. Before use, it is necessary to set a password, which is then entered during the AS installation, or directly in the K2.ini file of an already installed application server.

Book Contents

Book Index

Components and settings according to the application server role

Generating PDF files:

OLAP Export (Task scheduler role):

Book Contents

Book Index

Web server (Linux)

The K2 e-shop, K2 Image server and K2 SmartSearch products (and, in the premium variant, also Redis) run on dedicated servers with the Linux operating system located in the DMZ. This solution is the default for scenarios with the K2 e-shop (see Scenario 03 and 04). The K2 API and Web K2 products run on Linux in the form of Docker containers – see the chapter "Docker server (DMZ) – K2 Weblayer".

Book Contents

Book Index

K2 e-shop (K2 shop)

The server is used only to run K2 e-shops, or K2 Web. The K2 e-shop is deployed on the preconfigured server using the K2 installer. The SFTP protocol is used for installing and updating the e-shop (a replacement for FTP, which is outdated and blocked by some firewall manufacturers).

The file system contains the application files (.php, .css, .js) and the configuration files web.config and config.php. In addition, a cache of individual requests, modifications of the website templates and any customer modifications of the source files are gradually created.

Several instances of the K2 e-shop or K2 Web can run on one server – in such a case, the server must be preconfigured in advance during installation (or a request must be sent to K2 later).

Book Contents

Book Index

K2 Image server

K2 Image server is used to speed up the loading of images and documents on the K2 e-shop. Based on a parameter in the URL, it can resize images, cache them and convert them between formats. K2 imports images to the server storage using the SFTP protocol (port TCP 22). When a request to display an e-shop page is made, the K2 e-shop inserts into the page image URLs with parameters pointing to the Image server; on a repeated request for the same image, the already generated (cached) variant is used.

Book Contents

Book Index

K2 SmartSearch

K2 SmartSearch is used to improve searching on the K2 e-shop. Products and product categories are structured by the K2 application and imported into the Elasticsearch database. Thanks to indexing, it is possible to perform full-text searches on these data, including tolerance of typos and errors in the search expression.

Book Contents

Book Index

Redis (cache server of the premium e-shop)

In the premium K2 e-shop solution, the file cache is replaced by the Redis Key-Value database, which, unlike the file cache, guarantees immediate loading of the stored data – with a file cache, as the number of small files grows, work with the cache slows down, and so does page loading. In addition to the cache, user sessions are also stored in Redis.

Book Contents

Book Index

Preparation and installation of VMs for Linux servers

General rules apply to the preparation of servers running on Linux: each product is located on a separate server (VM), the individual servers must meet the minimum HW requirements and all of them must be located in the DMZ network.

Installation on VMware:

Installation on another virtualization technology:

Book Contents

Book Index

Docker server (DMZ) – K2 Weblayer

A server in the DMZ running Docker containers. At a minimum, it contains the K2 Weblayer container, which provides communication between the web browser and the application servers in the LAN. Depending on the scenario, it may also contain other containers (K2 API, K2 Backend Service, K2 AI Suggestions).

Book Contents

Book Index

Interface settings

Book Contents

Book Index

Containers run (according to the scenario)

Book Contents

Book Index

K2 Weblayer (Web K2)

The K2 Weblayer container provides the web interface of Web K2 and at the same time works as a reverse proxy between the user's browser and the K2 application servers in the LAN. The necessary web and application runtime (Node.js, reverse proxy) is part of the container image – therefore no manual installation of components on the host server is necessary.

Book Contents

Book Index

K2 API

The K2 API container provides the IS K2 REST API interface for external applications and is deployed next to K2 Weblayer on the same Docker server in the DMZ.

Book Contents

Book Index

Workstation

Workstation for the K2 full client

As the operating system, we recommend the latest version of Microsoft Windows 11, regularly maintained using Windows Update.

Workstation for the K2 web client

Microsoft Windows 11, macOS or Linux with any supported web browser can be used (the list of supported browsers is given in the document "System requirements of the K2 information system").

If the user will access peripheral devices (payment terminal, printer, customer display, barcode reader, etc.) from Web K2, the K2 Device Connector application must be installed on the workstation.

Book Contents

Book Index

Services settings and system components

Update service

The update service is used to update the "Local K2" product when the server installation has been updated. It is also used for K2 installer functions – remote administration of K2 products and reinstallation plans, i.e. for remote downloading and updating of K2 products, reading output log files from updates and cleaning up temporary files.

The application runs as a Windows service under a selected user:

Book Contents

Book Index

Deployment scenarios

Each scenario describes a specific combination of K2 products and infrastructure requirements, supplemented by the current architecture diagram. The basic preparation of the servers (Database server, Application server, Terminal server, Docker server, web servers) is always the same and is described in the previous chapter – this part gives the specifics for each scenario and refers to the relevant subchapters of the common requirements.

Book Contents

Book Index

Scenario 01 – Basic K2 installation

pic_1703772

Scenario description:

Basic K2 installation without extension modules. It contains all key components necessary for running IS K2 – web access via K2 Weblayer, two application servers (Web K2 + Task scheduler and Notification), a database server and a terminal server for desktop access. This is the default architecture on which all other scenarios build.

Book Contents

Book Index

Overview of servers and their roles

Server

Zone

Services/components run

Docker server

DMZ

K2 Weblayer

Application server 1

LAN

K2 Application server – Web K2

Application server 2

LAN

K2 Application server – Task scheduler, Notification

Database server

LAN

SQL database

Terminal server

LAN

K2 Desktop

Network communication:

Specific preparation for this scenario:

Book Contents

Book Index

Scenario 02 – Basic K2 installation + K2 API

pic_1703773

Scenario description:

Extension of the basic installation with K2 API, which allows external applications to access IS K2 data via a REST API. K2 API is deployed in a Docker container in the DMZ. A dedicated Application server 3 is added to handle API requests.

Book Contents

Book Index

Overview of servers and their roles

Server

Zone

Services/components run

Docker server

DMZ

K2 Weblayer, K2 API

Application server 1

LAN

K2 Application server – Web K2

Application server 2

LAN

K2 Application server – Task scheduler, Notification

Application server 3

LAN

K2 Application server – API

Database server

LAN

SQL database

Terminal server

LAN

K2 Desktop

Network communication:

Specific preparation for this scenario:

Book Contents

Book Index

Scenario 03 – Basic K2 installation + K2 E-shop

pic_1703774

Scenario description:

K2 installation with an e-shop in the standard configuration. Dedicated Linux servers are added to the DMZ for the K2 e-shop (web server with Apache, optionally Nginx as a reverse proxy), an Elasticsearch server for search (K2 SmartSearch) and an Image server for image management. K2 API in the DMZ connects the e-shop with the K2 application servers in the LAN.

Book Contents

Book Index

Overview of servers and their roles

Server

Zone

Services/components run

Docker server

DMZ

K2 Weblayer, K2 API

Web server

DMZ

K2 e-shop (PHP/Apache)

Elasticsearch server

DMZ

Elasticsearch (K2 SmartSearch)

Image server

DMZ

K2 Image server, SFTP

Application server 1

LAN

K2 Application server – Web K2

Application server 2

LAN

K2 Application server – Task scheduler, Notification

Application server 3

LAN

K2 Application server – API

Database server

LAN

SQL database

Terminal server

LAN

K2 Desktop

Network communication:

Book Contents

Book Index

Web server (K2 e-shop) – Linux

Book Contents

Book Index

Elasticsearch server (K2 SmartSearch) – Linux

Book Contents

Book Index

Image server – Linux

Book Contents

Book Index

Scenario 04 – Basic K2 installation + K2 E-shop Premium

pic_1703775

Scenario description:

Premium version of the e-shop solution. Compared to the standard installation, a Cache server with Redis is added to the DMZ (it replaces the file cache for better performance with large data volumes), Nginx as a reverse proxy in front of Apache, and a dedicated Cache application server in the LAN.

Book Contents

Book Index

Overview of servers and their roles

Server

Zone

Services/components run

Docker server

DMZ

K2 Weblayer, K2 API

Cache server

DMZ

Redis

Web server

DMZ

K2 e-shop (PHP/Apache), Nginx

Elasticsearch server

DMZ

Elasticsearch (K2 SmartSearch)

Image server

DMZ

K2 Image server, SFTP

Application server 1

LAN

K2 Application server – Web K2

Application server 2

LAN

K2 Application server – Task scheduler, Notification

Application server 3 (E-shop)

LAN

K2 Application server – E-shop

Application server 3 (Cache)

LAN

K2 Application server - Cache

Database server

LAN

SQL database

Terminal server

LAN

K2 Desktop

Network communication:

Book Contents

Book Index

Cache server (Redis) – Linux

Book Contents

Book Index

Web server (K2 e-shop Premium) – Linux

Book Contents

Book Index

Scenario 05 – Basic K2 installation – Cache update

pic_1703776

Scenario description:

Extension of the basic K2 installation with a cache update mechanism using a message queue. A Docker server with a RabbitMQ container is added to the LAN; it provides asynchronous communication between K2 application servers for cache invalidation and update.

Book Contents

Book Index

Overview of servers and their roles

Server

Zone

Services/components run

Docker server (DMZ)

DMZ

K2 Weblayer

Application server 1

LAN

K2 Application server – Web K2

Application server 2

LAN

K2 Application server – Task scheduler, Notification

Database server

LAN

SQL database

Terminal server

LAN

K2 Desktop

Docker server (LAN)

LAN

RabbitMQ

Network communication:

Book Contents

Book Index

Docker server (LAN) – RabbitMQ

Book Contents

Book Index

Scenario 06 – Basic K2 installation + E-mail synchronization

pic_1703777

Scenario description:

Extension of the installation with e-mail synchronization. K2 API is added to the Docker server (DMZ), and a Docker server with the e-mail synchronization service is added to the LAN; the service is further extended with the RabbitMQ message broker, which ensures faster transfer of information from K2 to the service and makes some functions available.

Book Contents

Book Index

Overview of servers and their roles

Server

Zone

Services/components run

Docker server (DMZ)

DMZ

K2 Weblayer, K2 API

Application server 1

LAN

K2 Application server – Web K2

Application server 2

LAN

K2 Application server – Task scheduler, Notification

Application server 3

LAN

K2 Application server – API

Database server

LAN

SQL database

Terminal server

LAN

K2 Desktop

Docker server (LAN)

LAN

RabbitMQ, E-mail synchronizer

Network communication:

Book Contents

Book Index

Docker server (LAN) – RabbitMQ + E-mail synchronizer

Book Contents

Book Index

Scenario 07 – K2 + Elastic (for internal search)

pic_1703778

Scenario description:

Extension of the basic K2 installation with Elasticsearch for internal full-text search in IS K2 (unlike scenarios 03/04, where Elasticsearch is used for search in the e-shop). The Elastic server is located in the LAN and communicates with the K2 application servers via TCP 9200.

Book Contents

Book Index

Overview of servers and their roles

Server

Zone

Services/components run

Docker server (DMZ)

DMZ

K2 Weblayer

Application server 1

LAN

K2 Application server – Web K2

Application server 2

LAN

K2 Application server – Task scheduler, Notification

Database server

LAN

SQL database

Terminal server

LAN

K2 Desktop

Elastic server

LAN

Elasticsearch

Network communication:

Book Contents

Book Index

Elastic server (LAN)

Book Contents

Book Index

Scenario 08 – Basic K2 installation + K2 BI

pic_1703779

Scenario description:

Extension of the basic installation with K2 BI (Business Intelligence). An SQL BI server with the Data Warehouse, Integration Services and Analysis Services (SSAS) components is added to the LAN, together with a Power BI Gateway server for connection to the Power BI Cloud Service.

Book Contents

Book Index

Overview of servers and their roles

Server

Zone

Services/components run

Docker server (DMZ)

DMZ

K2 Weblayer

Application server 1

LAN

K2 Application server – Web K2

Application server 2

LAN

K2 Application server – Task scheduler, Notification

Database server

LAN

SQL database

SQL BI server

LAN

Data Warehouse, Integration Services, Analysis Services

Terminal server

LAN

K2 Desktop

Power BI Gateway

LAN

PBI Gateway

Network communication:

Book Contents

Book Index

SQL BI server

Book Contents

Book Index

Power BI Gateway server

Book Contents

Book Index

Scenario 09 – K2 + Chat (new backend technologies)

pic_1703780

Scenario description:

Extension of the basic K2 installation with chat functionality with a new backend. A Docker server with the K2 Backend Service container is added to the LAN; it provides real-time communication for chat functions in Web K2 and the K2 application.

Book Contents

Book Index

Overview of servers and their roles

Server

Zone

Services/components run

Docker server (DMZ)

DMZ

K2 Weblayer

Application server 1

LAN

K2 Application server – Web K2

Application server 2

LAN

K2 Application server – Task scheduler, Notification

Database server

LAN

SQL database

Terminal server

LAN

K2 Desktop

Docker server (LAN)

LAN

K2 Backend Service

Network communication:

Book Contents

Book Index

Docker server (LAN) – K2 Backend Service

Book Contents

Book Index

Scenario 10 – Basic K2 installation + K2 AI

pic_1703781

Scenario description:

Extension of the basic K2 installation with K2 AI functions – specifically K2 AI Suggestions. A Docker server with the K2 AI Suggestions container is added to the LAN; it provides AI-based recommendations directly in the IS K2 interface.

Book Contents

Book Index

Overview of servers and their roles

Server

Zone

Services/components run

Docker server (DMZ)

DMZ

K2 Weblayer

Application server 1

LAN

K2 Application server – Web K2

Application server 2

LAN

K2 Application server – Task scheduler, Notification

Database server

LAN

SQL database

Terminal server

LAN

K2 Desktop

Docker server (LAN)

LAN

K2 AI Suggestions

Network communication:

Book Contents

Book Index

Docker server (LAN) – K2 AI Suggestions

Book Contents

Book Index

Overview of ports and network communication

The following table summarizes all ports used across the scenarios.

Port / Protocol

Direction

Description

Scenarios

TCP 80, 443

Internet › DMZ

HTTP/HTTPS + WebSocket (K2 Weblayer, K2 API, Web server)

01–10

TCP 10010–10020

DMZ › LAN

K2 Weblayer/API › K2 Application server

01–10

TCP 1433

LAN internal

MS SQL Server (communication AS › Database server)

01–10

TCP 2383

LAN internal

MS Analysis Services (MSOLAP)

08

TCP 445

LAN internal

Named Pipe – communication of K2 AS with K2 API, Update service

02, 03, 04, 06

TCP 3389

LAN internal

RDP – access to the Terminal server

01–10

TCP 21 / TCP 22

LAN › DMZ

FTP/SFTP – data transfer from the terminal/application server to the web server

03, 04

TCP 5672

LAN internal

AMQP – RabbitMQ (cache update, e-mail synchronization)

05, 06

TCP 15672

LAN internal

RabbitMQ Management UI (administration, optional)

05, 06

TCP 9200

LAN - DMZ

Elasticsearch REST API (K2 SmartSearch / internal search)

03, 04, 07

TCP 6379

LAN › DMZ

Redis (cache server – premium e-shop)

04

TCP 22

LAN › DMZ

SFTP – transfer of images to the Image server

03, 04

TCP 44301

LAN internal

HTTP – K2 AI Suggestions

10

TCP 80, 443, 5671–5672, 9350–9354

LAN › Internet

Power BI Gateway › Power BI Cloud

08

Book Contents

Book Index

Overview of K2 products and their basic parameters

Product

Type

Operating system

Basic installation size

Dependency on K2 products

IS K2 (server installation)

Desktop application

Microsoft Windows

6.5 GB (FS) + 2 GB (DB)

Database server, domain controller

Local K2 installation

Desktop application

Microsoft Windows

1.6 GB (FS)

IS K2 – server installation

K2 application server

Windows service

Microsoft Windows Server

1 GB (FS)

IS K2

K2 Weblayer (Web K2)

Container (Docker)

Linux

600 MB (application)

K2 AS

K2 API

Container (Docker)

Linux

15 MB (application)

K2 AS

K2 e-shop

Web application (PHP/Apache, Nginx)

Linux

70 MB (application)

K2 AS, K2 API

K2 Image server

Web service

Linux

160 MB (application)

-

K2 SmartSearch

Linux service (Elasticsearch)

Linux

depending on deployment

K2 e-shop

Redis (Cache server)

Linux service

Linux

depending on deployment

K2 e-shop Premium

K2 Backend Service

Container (Docker)

Linux

depending on deployment

Web K2 (K2 Weblayer)

K2 AI Suggestions

Container (Docker)

Linux

depending on deployment

K2 Application server