Installing Megaladata in Podman or Docker Containerization Systems

The distribution kit for installing Megaladata on Linux OS is provided as a megaladata-*.tar.gz archive, which includes: binary files, library files, configuration files, the BatchLauncher binary, and a parameterizable Bash script for generating Docker images and the Docker-compose config.

The Bash script allows the client to perform manual customization; for example, the client can supplement the Dockerfile with specific libraries or programs, add their own ODBC driver to the future image, or include a specific version of Python in the build.

Installation options

Megaladata can be installed using Podman or Docker containerization systems. Podman is the recommended container engine.

If the installer finds both Podman and Docker, the user will be asked to select a containerization system. The default proposed option is Podman.

Main differences between installations:

  • For Podman, containers will run under the current user. The default working directory is $HOME/megaladata. Automatic startup after a host reboot is provided via cron.
  • For Docker, the containerization system and the containers themselves will run as the root user. The default working directory is /var/opt/megaladata-docker.

Minimum required software versions:

  • Podman: version 3.4.0 or higher; Podman-compose: version 1.0.3
  • Docker: version 20.10.1 or higher; Docker-compose: version 1.21.0.

Pre-installation

Before installing Megaladata, you must pre-install the chosen containerization system (Podman is recommended) and set it up for your operating system. Here are the recommended options for Podman containerization mode:

Important: If the pre-installation settings are not performed, Megaladata will not install correctly.

Base image

The Bash script allows the user to change the base image. For example, if required by IT security specialists, the Megaladata server can be built using a more recent base image based on ubuntu instead of the default debian. During the server build, the installer will ask which operating system to use for the image. Currently, the options offered are:

  • debian:11.5-slim
  • ubuntu:22.04
  • ubuntu:23.04

Megaladata is tested and confirmed to work on these operating systems. If necessary, the user can manually specify a different OS.

Installation

Copy the Megaladata distribution archive **megaladata-*.tar.gz** to the target system, for example, to the user's home folder $HOME: /home/user.

Unpack the archive and navigate to the extracted directory using the command:

mkdir megaladata-dist && tar -xf megaladata.tar.gz -C megaladata-dist/ && cd megaladata-dist

Additional components

To include additional components in the Megaladata image, such as ODBC drivers or a Python module, changes must be made to the server image build script server/Dockerfile. In this file, uncomment the lines with the corresponding commands.

1 # Installing Microsoft ODBC Driver 18 for SQL Server {#installing-microsoft-odbc-driver-18-for-sql-server}
2 # The file msodbcsql18_18.0.1.1-1_amd64.deb must be located in the server/libs directory of the distribution {#the-file-msodbcsql1818011-1amd64deb-must-be-located-in-the-serverlibs-directory-of-the-distribution}
3 #RUN apt-get update && DEBIAN_FRONTEND=noninteractive ACCEPT_EULA=Y apt-get install -y /app/msodbcsql18_18.0.1.1-1_amd64.deb
4
5 # Installing Python and some of its libraries {#installing-python-and-some-of-its-libraries}
6 #RUN apt-get install -y python3 python3-pip; \
7 #pip3 install -U pandas numpy scikit-learn

Run the installer to generate container images and configuration files using the following command:

  • For Podman:
./setup.sh
  • For Docker:
sudo ./setup.sh

Port settings

If a firewall is present, open the necessary ports (depending on the chosen configuration). For example, for the default configuration on systems using firewall-cmd:

  • HTTP port: sudo firewall-cmd --permanent --zone=public --add-port=80/tcp
  • HTTPS port: sudo firewall-cmd --permanent --zone=public --add-port=443/tcp
  • Megaladata port for websocket connections: sudo firewall-cmd --permanent --zone=public --add-port=8080/tcp
  • Megaladata port for secure websocket connections: sudo firewall-cmd --permanent --zone=public --add-port=8443/tcp
  • Port for connecting to the Megaladata server via Batchlauncher or external Integrator: sudo firewall-cmd --permanent --zone=public --add-port=4580/tcp
  • Reload firewall rules: sudo firewall-cmd --reload

Launching Megaladata

Important: For commercial use of Megaladata, you must install and activate a license key and a license server.

Before starting the megaladatad service, specify the machine's IP address in the IP_NAME= line in the file located by default at /home/user/megaladata/server/gnclient.ini.

To create the corresponding containers from Megaladata images and launch them:

  • For Podman:
podman-compose -f ${Path_to_config_directory}/docker-compose.yml up -d

With default values, the command is:

podman-compose -f ${HOME}/megaladata/docker-compose.yml up -d
  • For Docker:
pushd /var/opt/megaladata-docker; sudo docker-compose up -d; popd

For Podman, when choosing default values for the current user, the configurations for creating and starting containers will be located in the directory: ${HOME}/megaladata.

Modifiable container configuration files and user data will be located in:

  • ${HOME}/megaladata/server
  • ${HOME}/megaladata/integrator
  • ${HOME}/megaladata/http

The installation script also adds a startup command to the user's crontab to launch the configuration upon host reboot.

For Docker, configurations and files will be located in: /var/opt/megaladata-docker/.

Installing Megaladata using ready-made container images

If internet access on the target machine is restricted or unavailable, ready-made images are required. You can generate these images on a PC with internet access or obtain them from Megaladata technical support.

  • On a PC with internet access (not behind a proxy), run the Megaladata installation using the setup.sh script.
  • Specify the required parameters to build the images. At the end of the installation, you will see the prompt: Save assembled images as separate files? [y/n]. Enter y to agree.
  • Files will be saved in the home folder at: megaladata/images/.
  • Transfer the resulting images (megaladata-http_date.tar, megaladata-server_date.tar, and megaladata-integrator_date.tar, where _date is the date and time of creating the image) to the target machine in the following path, creating directories if necessary: /home/user/megaladata/images/.
  • Run the setup.sh script on the target machine.
  • Proceed to the item Select source for Megaladata images.
  • To use ready-made images, select [2] Use pre-prepared images. The script should automatically find the images in /home/user/megaladata/images/ or in the images folder within the distribution (next to setup.sh); the user only needs to confirm their location and name.

Building specific Megaladata images

The /megaladata-dist/setup.sh file builds all Megaladata images without an option to select a specific one.

If necessary, a specific Megaladata image can be rebuilt using the following command:

podman build http -t megaladata-http

where megaladata-http is the image name. This command must be executed from the /megaladata-dist/ directory, which contains the /http/, /integrator/, and /server/ directories.

Image/container names

  • megaladata-http_date
  • megaladata-server_date
  • megaladata-integrator_date

Where _date is the date and time the image was generated.

Arguments accepted by the setup.sh script

  • -h --help: show help (incompatible with any other arguments).
  • -d --dir: specify ${CONF} and ${DATA} directories.
  • --datadir: override the ${DATA} directory setting.
  • -s --save: save built images to local files on disk (incompatible with --nosave).
  • --nosave: do not save images to local files (incompatible with --save).
  • -c --change: change installed Megaladata components (incompatible with --update).
  • -u --update: update Megaladata images without changing the configuration (incompatible with --change and --nobuild).
  • -b --build: rebuild images from source.
  • -l --load: load images into the system from local files.
  • -n --nobuild: do not rebuild existing images (incompatible with --update).
  • --defaults: use default values where possible. These apply during user prompts. This argument has the lowest priority and can be partially overridden by other arguments.

Except for the incompatible options mentioned above, arguments can be written in any order, e.g., -cbs, -b -c --save, or -sb --change.

Useful commands

Examples for Podman. For Docker, use docker-compose with similar parameters:

  • podman-compose ps: list running containers
  • podman-compose up -d: build/compose and start containers in detached mode
  • podman-compose start: start containers
  • podman-compose stop: stop containers
  • podman-compose rm: remove containers
  • podman-compose down: stop and remove containers
  • podman start ${CONTAINER_NAME}: example of an operation on a single container (start)
  • journalctl -n 10 -o verbose _COMM=megaladatad: megaladatad logs—show last 10 entries in detailed format
  • journalctl -n 10 -o verbose _COMM=Integrator: integrator logs—show last 10 entries in detailed format
  • journalctl -b -f -n 30 CONTAINER_NAME=${CONTAINER_NAME}: container logs—show last 30 entries live
  • podman exec -it ${CONTAINER_NAME} /bin/bash: enter the container (or use /bin/sh instead of /bin/bash)


Articles in Section:

results matching ""

    No results matching ""