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.
If the server is connected to the Internet, the system installation images are uploaded to the server via a remote repository.
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.tgzarchive to the user’s root folder. Copy theimagesfolder (standalone installation package of the system with archived images) to the root folder of the user. The archive also contains configuration filesdocker-compose.ymland.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
.envfile:
.env#key SECRET_KEY_BASE=0356080kcn0ejgk4lwekrf #DB PGSQL login PG_APP_USER=ppppp #DB PGSQL password PG_APP_PASSWORD= ppppp #WEB interface login VADTEL_SUPER_ADMIN_EMAIL=NEED_USERNAME #WEB interface password VADTEL_SUPER_ADMIN_PASSWORD=NEED_PASSWORD #DB PGSQL unicloud login VADTEL_UNICLOUD_TEST_USERNAME=NEED_USERNAME #DB PGSQL unicloud password VADTEL_UNICLOUD_TEST_PASSWORD=NEED_PASSWORD- It is necessary to copy the downloaded
Installing Docker and Docker Compose
Installing Docker and Docker Compose on the CentOS distribution.
Install Docker and Docker Compose:
bashsudo dnf install docker-ce docker-compose
Starting installation on CentOS distribution
Completing the installation on the CentOS distribution Run and add Docker to autoloader:
bashsudo systemctl enable --now docker && systemctl start dockerInstalling Docker and Docker Compose on an Debian distribution
Install Docker and Docker Compose:
bashsudo apt update sudo apt install docker docker-compose
Starting 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:
bashsudo usermod -aG docker ${USER}Next, unpack the
unicloud.tgzarchive copied to the user’s root folder and run the following command:bashtar -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
unicloudfolder in the user’s root folder and run the script:bashsudo ./remote_install.sh
Executing the remote_install.sh script After successful installation of the package, go to the
/var/lib/unicloudfolder with administrator privileges, and change the Owner Name and Group Name to the current user for the.envfile
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:
bashVADTEL_UNICLOUD_TEST_USERNAME=NEED_USERNAME VADTEL_UNICLOUD_TEST_PASSWORD=NEED_PASSWORD-
Extracting and downloading images
Unzip the previously copied folder with
imagesimage filesbashgunzip 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.gzUploading images to Docker:
bashdocker 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 Check if the images are available:
bashdocker images
Checking images availability If the images loaded without errors, being in the
/var/lib/unicloudfolder, run the following command:bashdocker-compose up -dCreate a directory in the
/optfolder for thevadtelnewwebapplicationbashsudo mkdir /opt/vadtelnewweb cd /opt/vadtelnewwebAfter that, it is necessary to copy
docker-compose.ymland.envfiles (if not copied earlier for a new installation) to the/opt/vadtelnewwebfolder.For the first run, it is necessary to create a Database, for this purpose execute the following command:
bashdocker-compose run app bundle exec rails db:create
Creating database Now we can run the application:
bashdocker-compose up -d
Launching the application Troubleshooting
If an error occurs after running the application:
bashnetwork unicloud_unicloud-net declared as external, but could not be foundThis means that the external network was not created during installation, so you need to perform the initial installation from the
unicloud.tar.tgzarchive, according to instructions.After that, you need to re-run the application:
bashdocker-compose up -dTo check for running containers, execute the following command:
bashdocker ps
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:bashdocker-compose downThen, navigate to the
/var/lib/unicloudfolder to perform the following actions:- Stop the
unicloudservice:
bashsudo service unicloud stop- Shutting down the containers:
bashdocker-compose downNext, copy and unpack the necessary compressed image files:
bashgunzip 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.gzLoad images into Docker:
bashdocker 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 Checking the availability of images:
bashdocker images
Checking images availability If the images loaded without errors, while in the
/var/lib/unicloudfolder, run the following command:shellsudo service unicloud start docker-compose up -dNext, you need to go to the folder
/opt/vadtelnewweband run the application:shelldocker-compose up -dTo check running containers, run the following command:
bashdocker ps- Stop the
Configuring autoload
Create/edit/copy the configuration file
/etc/docker/daemon.jsonand 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.servicewith the contents given below, whereWorkingDirectoryis the path todocker-compose.ymlExecute command:
shellnano /etc/systemd/system/docker-compose-vadtel.servicedocker-compose-vadtel.service[Unit] Description=Docker Compose vadtel Application Service Requires=docker.service After=docker.service StartLimitIntervalSec=60 [Service] WorkingDirectory=/opt/vadtelnewweb ExecStart=/usr/bin/docker-compose up ExecStop=/usr/bin/docker-compose down TimeoutStartSec=0 Restart=on-failure StartLimitBurst=3 [Install] WantedBy=multi-user.targetIn order to activate the autorun script from the
/etc/systemd/system/directory, execute the command:shellsudo systemctl enable docker-compose-vadtelSystem 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:
bashhttp://127.0.0.1/auth/users/sign_in
Login and password for signing in to the system are specified in the file
/opt/vadtelnewweb/.env.envVADTEL_SUPER_ADMIN_EMAIL= (login) VADTEL_SUPER_ADMIN_PASSWORD= (password)
Чи була ця сторінка корисною?
Дякуємо за відгук!