Platform and services installation

Installation of the IoT platform — downloading images, Docker setup, system install, updates and autostart configuration.

Installation files download

There are two ways to download the installation images of the “Secure IoT Telemetry Data Acquisition and Processing Platform”:

In the case when the server is not connected to the Internet (for example, according to the enterprise security policy), it is possible to install the “Secure IoT Platform for Telemetry Data Collection and Processing” system offline. In this case, the installation images of the system are transferred to the server from an external media.

Installation steps

  • Copy the required data package

    To install the containerization tool it is necessary to execute the commands (administrator rights will be required):

    • It is necessary to copy the downloaded unicloud.tgz archive to the user’s root folder. Copy the images folder (standalone installation package of the system with archived images) to the root folder of the user. The archive also contains configuration files docker-compose.yml and .env (hidden, it is necessary to display hidden files).
    • images
      • vadtel-nginx-latest.tar.gz
      • vadtel-app-latest.tar.gz
      • anytelemetry-latest.tar.gz
      • pgbouncer-latest.tar.gz
      • vadteljsondaemon-latest.tar.gz
      • logrotate-latest.tar.gz
      • postgres-15.1-alpine.tar.gz
      • redis-6.0.16-alpine.tar.gz
      • vector-latest.tar.gz
    • The configuration files should be copied to /opt/vadtelnewweb/.

    • Logins and passwords to the system must be specified in the .env file:

  • Installing Docker and Docker Compose

    Installing Docker and Docker Compose on the CentOS distribution.

    Install Docker and Docker Compose:

    bash
    sudo dnf install docker-ce docker-compose
    Starting installation on CentOS distribution
    Starting installation on CentOS distribution
    Completing the installation on the CentOS distribution
    Completing the installation on the CentOS distribution

    Run and add Docker to autoloader:

    bash
    sudo systemctl enable --now docker && systemctl start docker

    Installing Docker and Docker Compose on an Debian distribution

    Install Docker and Docker Compose:

    bash
    sudo apt update
    sudo apt install docker docker-compose
    Starting the installation on the Debian distribution
    Starting the installation on the Debian distribution
    Completing the installation on the Debian distribution
    Completing the installation on the Debian distribution
  • System Installation

    Next, the system installation does not differ for different operating systems. Add the user under which the application will run to the docker group:

    bash
    sudo usermod -aG docker ${USER}

    Next, unpack the unicloud.tgz archive copied to the user’s root folder and run the following command:

    bash
    tar -xf unicloud.tgz
    • unicloud
      • run
        • db-unicloud
      • remote_install.sh
      • init-db
        • create_tables.sql
      • script_conf.sh
      • docker-compose.yml
      • logs
        • crontab
        • vadteljsondaemon
        • anytelemetry
      • backups
      • data
        • db-unicloud
      • local-images
        • pgbouncer.tar.gz
        • postgres.tar.gz
        • vadteljsondaemon.tar.gz
        • anytelemetry.tar.gz
        • logrotate.tar.gz
      • unicloud.service

    After executing the command, go to the unzipped unicloud folder in the user’s root folder and run the script:

    bash
    sudo ./remote_install.sh
    Executing the remote_install.sh script
    Executing the remote_install.sh script

    After successful installation of the package, go to the /var/lib/unicloud folder with administrator privileges, and change the Owner Name and Group Name to the current user for the .env file

    Changes to .env file
    Changes to .env file

    The script generates access — login, password to the database /var/lib/unicloud/.env, which must be specified in the file /opt/vadtelnewweb/.env.

    These are the values:

    bash
    VADTEL_UNICLOUD_TEST_USERNAME=NEED_USERNAME
    
    VADTEL_UNICLOUD_TEST_PASSWORD=NEED_PASSWORD
  • Extracting and downloading images

    Unzip the previously copied folder with images image files

    bash
    gunzip vadtel-nginx-latest.tar.gz
    gunzip vadtel-app-latest.tar.gz
    gunzip anytelemetry-latest.tar.gz
    gunzip pgbouncer-latest.tar.gz
    gunzip vadteljsondaemon-latest.tar.gz
    gunzip logrotate-latest.tar.gz
    gunzip postgres-15.1-alpine.tar.gz
    gunzip redis-6.0.16-alpine.tar.gz
    gunzip vector-latest.tar.gz

    Uploading images to Docker:

    bash
    docker load -i vadtel-nginx-latest.tar
    docker load -i vadtel-app-latest.tar
    docker load -i anytelemetry-latest.tar
    docker load -i pgbouncer-latest.tar
    docker load -i vadteljsondaemon-latest.tar
    docker load -i logrotate-latest.tar
    docker load -i postgres-15.1-alpine.tar
    docker load -i redis-6.0.16-alpine.tar
    docker load -i vector-latest.tar.gz
    Uploading files to Docker
    Uploading files to Docker

    Check if the images are available:

    bash
    docker images
    Checking images availability
    Checking images availability

    If the images loaded without errors, being in the /var/lib/unicloud folder, run the following command:

    bash
    docker-compose up -d

    Create a directory in the /opt folder for the vadtelnewweb application

    bash
    sudo mkdir /opt/vadtelnewweb
    cd /opt/vadtelnewweb

    After that, it is necessary to copy docker-compose.yml and .env files (if not copied earlier for a new installation) to the /opt/vadtelnewweb folder.

    For the first run, it is necessary to create a Database, for this purpose execute the following command:

    bash
    docker-compose run app bundle exec rails db:create
    Creating database
    Creating database

    Now we can run the application:

    bash
    docker-compose up -d
    Launching the application
    Launching the application
    Troubleshooting

    If an error occurs after running the application:

    bash
    network unicloud_unicloud-net declared as external, but could not be found

    This means that the external network was not created during installation, so you need to perform the initial installation from the unicloud.tar.tgz archive, according to instructions.

    After that, you need to re-run the application:

    bash
    docker-compose up -d

    To check for running containers, execute the following command:

    bash
    docker ps
    Checking running containers
    Checking running containers
  • Software Update

    To upgrade the software, you need to shut down the containers by going to /opt/vadtelnewweb, and executing the following command:

    bash
    docker-compose down

    Then, navigate to the /var/lib/unicloud folder to perform the following actions:

    • Stop the unicloud service:
    bash
    sudo service unicloud stop
    • Shutting down the containers:
    bash
    docker-compose down

    Next, copy and unpack the necessary compressed image files:

    bash
    gunzip vadtel-nginx-latest.tar.gz
    gunzip vadtel-app-latest.tar.gz
    gunzip anytelemetry-latest.tar.gz
    gunzip pgbouncer-latest.tar.gz
    gunzip vadteljsondaemon-latest.tar.gz
    gunzip logrotate-latest.tar.gz
    gunzip postgres-15.1-alpine.tar.gz
    gunzip redis-6.0.16-alpine.tar.gz
    gunzip vector-latest.tar.gz

    Load images into Docker:

    bash
    docker load -i vadtel-nginx-latest.tar
    docker load -i vadtel-app-latest.tar
    docker load -i anytelemetry-latest.tar
    docker load -i pgbouncer-latest.tar
    docker load -i vadteljsondaemon-latest.tar
    docker load -i logrotate-latest.tar
    docker load -i postgres-15.1-alpine.tar
    docker load -i redis-6.0.16-alpine.tar
    docker load -i vector-latest.tar.gz
    Uploading files to Docker
    Uploading files to Docker

    Checking the availability of images:

    bash
    docker images
    Checking images availability
    Checking images availability

    If the images loaded without errors, while in the /var/lib/unicloud folder, run the following command:

    shell
    sudo service unicloud start
    docker-compose up -d

    Next, you need to go to the folder /opt/vadtelnewweb and run the application:

    shell
    docker-compose up -d

    To check running containers, run the following command:

    bash
    docker ps
  • Configuring autoload

    Create/edit/copy the configuration file /etc/docker/daemon.json and add the following to it (replacing values if necessary):

    daemon.json
    {
      "log-driver": "json-file",
      "log-opts": {
        "max-size": "50m",
        "max-file": "3"
      }
    }

    Then we create a script for autostarting the application, for which we will need a file docker-compose-vadtel.service with the contents given below, where WorkingDirectory is the path to docker-compose.yml

    Execute command:

    shell
    nano /etc/systemd/system/docker-compose-vadtel.service

    In order to activate the autorun script from the /etc/systemd/system/ directory, execute the command:

    shell
    sudo systemctl enable docker-compose-vadtel
  • System health check

    After launching the application, in order to check the system operability, it is necessary to enter the IP address of the server where the application is running in the browser address bar:

    bash
    http://127.0.0.1/auth/users/sign_in
    Platform sign-in page

    Login and password for signing in to the system are specified in the file /opt/vadtelnewweb/.env

    .env
    VADTEL_SUPER_ADMIN_EMAIL= (login)
    VADTEL_SUPER_ADMIN_PASSWORD= (password)
Dernière mise à jour le

Cette page vous a-t-elle été utile ?