To install the Yva.ai platform you will need a dedicated server or a virtual machine with a Linux distribution. For more information, see the article System requirements.

Creating and configuring a user

To install the Yva.ai platform, you need to do the following on all servers dedicated to installation:

1. Log in as the root user.

2. Install packages from the repository. For Ubuntu, this will be the following command:

sudo apt install jq docker docker-compose zip unzip gnupg2 pass
CODE

3. Create a yva group

sudo groupadd yva
CODE

4. The system must be installed on behalf of a user other than the root user. For this purpose, you can create a separate user (for example, yva) and grant him sudo rights. To create a new user and grant him rights, you will need a root account or another account with sudo rights.

sudo useradd -g yva -G root -p password -s /bin/bash -m yva
CODE

The -g yva key adds the yva user to the yva group, which must be pre-created.

Instead of a password, you need to specify the user's password.

5. You need to create a docker group and add a user to it:

sudo groupadd docker

sudo usermod -a -G docker yva
CODE

6. After creating groups and adding users to them, you need to re-login as the root user.

7. After that, you need to add the group to sudoers with the command:

sudo visudo
CODE

The default editor opens. You need to add a line after the line "See sudoers(5) for more information on "#include" directives::"

%yva ALL=(ALL) NOPASSWD:ALL
CODE

Preliminary configuration

Log in to the server under the user yva. Now you need to prepare a directory (for example, yva-platform) where the installation will be performed. Create a directory and provide full access to it.

sudo mkdir /yva-platform
sudo chown yva:yva /yva-platform
sudo chmod 777 /yva-platform
CODE

Note: if for security reasons only the current user and root must have access to this directory, then the rights can be changed to more stringent ones.

Next, go to the previously created directory and create the values.json configuration file.

cd /yva-platform
touch values.json
CODE

Before starting the installation process, you need to make the initial settings in the values.json configuration file. This can be done using any convenient tool (nano, vi, vim, cat, etc.). The markup of the file must match the JSON format.

{
    "kv": {
        "PLATFORM_CONSUL_JOIN": "IP address of the server with the mngr role",
        "PLATFORM_IFS_DEFUALT_LIST": "bond en eth wl dummy",
        "PLATFORM_SERVICE_PUBLIC_IFS": "bond en eth",
        "PLATFORM_UPDATE_HOSTROLE": "server role",
        "INIT_DOCKER_USER": "user to connect to docker repository",
        "INIT_DOCKER_PASS": "password for connecting to the docker repository",
        "PLATFORM_SERVICE_PUBLIC_IP": "IP address of the server with the mngr role",
        "YVA_SECURE_PLAIN": "administrator password"
    }
}
CODE

"INIT_DOCKER_USER" - provided by the Yva.ai manager.
"INIT_DOCKER_PASS" - provided by the Yva.ai manager.
"PLATFORM_CONSUL_JOIN" - you need to specify the internal IP address
"PLATFORM_SERVICE_PUBLIC_IP" - you need to specify the internal IP address

The number of servers depends on the number of users. Hardware requirements for servers are described in the article System requirements.

Each server must have a unique hostname

Possible roles:

  • Medium installation (3 servers, up to 300 users):
    "vm_mngr_medium"
    "vm_exec_medium"
    "vm_gpdb_medium"

  • Large installation (6 servers, 300-1500 users):
    "vm_mngr_large"
    "vm_exec_large"
    "vm_gpdb_large"
    "vm_mdbsh_large"
    "vm_hbase_large"
    "vm_app_large"

  • XL installation (9 servers, more than 1500 users):
    "vm_mngr_xl"
    "vm_front_xl"
    "vm_mdbs0h0_xl"
    "vm_mdbs0h1_xl"
    "vm_gpdb_xl"
    "vm_hbase_xl"
    "vm_rmq_xl"
    "vm_app_xl"
    "vm_exec_xl"

To check the correctness of filling in the values file.json type the command:

sudo jq . values.json
CODE

If the command returns the contents of the values file.json, which means the file is filled incorrectly.

Next, go to the /yva-platform directory and create the docker folder:

mkdir docker
CODE

Give the rights to read/write:

sudo chmod 777 docker/
CODE

Then create the daemon file.json in the /etc/docker folder:

cd /etc/docker

sudo touch daemon.json
CODE

And write in the config file:

{  
    "data-root": "/yva-platform/docker"
}
CODE

Reboot docker:

sudo systemctl restart docker
CODE

After that, files and folders should appear in the /yva-platform/docker folder, for example (build it containers image network overlay2 plugins runtimes swarm tmp trust volumes).

List of resources

Before installing, it is important to make sure that the following resources are available from the server or virtual machine on which you plan to install the system:

Using a proxy

If the server where the platform is planned to be installed does not have direct access to the Internet, then it is necessary to additionally prepare it for using a proxy.

First, you need to set up a proxy on the server itself. This can be done through a temporary solution (a script that runs while the user session is running) or through a permanent setting in the environment file /etc/environment. In the case of proxies, it is necessary to exclude internal addresses that docker and microservices will use. These addresses will be shown in the examples

An example of use in the form of a script that needs to be run:

export proxy="http://user:password@address:port/"
export http_proxy="$proxy"
export https_proxy="$proxy"
export no_proxy="localhost,127.0.0.1,.service.consul,169.254.1.1,172.18.0.0/24,ip_address,anglefeatures"
CODE

Example for /etc/environment:

http_proxy="http://user:password@address:port/"
https_proxy="http://user:password@address:port/"
no_proxy="localhost,127.0.0.1,.service.consul,169.254.1.1,172.18.0.0/24,ip_address,anglefeatures"
CODE

After configuring the proxy on the machine, you must also configure the proxy for docker. This setting assumes that Docker is already installed. There are 2 ways to configure a proxy for docker through environment variables and client configuration.

To configure via environment variables, you need to create a file /etc/systemd/system/docker.service.d/http-proxy.conf and fill it with the following contents:

Environment="HTTP_PROXY=http://user:password@address:port/"
Environment="HTTPS_PROXY=http://user:password@address:port/"
Environment="NO_PROXY=localhost,127.0.0.1,.service.consul,169.254.1.1,172.18.0.0/24,ip_address,anglefeatures"
CODE

Then run the commands:

systemctl daemon-reload
systemctl restart docker
CODE

If errors occur during the application of the settings, they will be displayed in the log.

To configure the client, you need to create a file ~/.docker/config.json in the home directory of the user on whose behalf the launch will take place Yva.ai. If the file exists, then you need to add the proxies key to it.

{
 "proxies": {
     "default": {
         "httpProxy": "http://user:password@address:port/",
         "httpsProxy": "http://user:password@address:port/",
         "noProxy": "localhost,.service.consul,169.254.1.1,127.0.0.1,172.18.0.0/24,ip_address,anglefeatures"
     }
 }
}
CODE

You can learn more about docker proxy in this article https://docs.docker.com/network/proxy/.

Configuring firewall

If on the network, where will it be installed Yva.ai if the use of a firewall is required, then it is necessary to take into account the mandatory network interaction between the services of the system. When installing on multiple machines, the required ports depend on the server role, but you can simply allow all the ports listed below for each of the machines.

Required addresses:

<ip_address of all_machines>
169.254.1.1
172.17.0.0/24
CODE

Required ports:

443, 80, 8080, 8888 - frontend и routers
32768-61000 - docker
8500, 8600, 8300 - consul
53 - int-dns
5672, 15672, 4369, 5671, 25672 - RabbitMQ
CODE

Example of a command to open iptables ports:

sudo iptables -t filter -A INPUT -p tcp -s 169.254.1.1,172.17.0.0/24,ADD_IP_ADDRESS --match multiport --dport 53,80,443,4369,5671,5672,8080,8300,8500,8600,8888,15672,25672,32768:61000 -j ACCEPT
CODE

Instead of ADD_IP_ADDRESS, add the IP addresses or subnet of the servers on which the system components will be installed.

Example of a command to open firewalld ports:

firewall-cmd --permanent --zone=public --add-port=8080/tcp
firewall-cmd --reload
CODE

Installation

Before starting the installation procedure, you need to make sure again that everything is prepared. To do this, you can use the following checklist:

  • There is a user on whose behalf the installation will take place, and it is not root

  • This user has sudo rights and there is a home directory

  • A directory has been created where the installation will take place

  • The user has the right to work with this directory

  • Current location - the directory created for the installation

  • There is enough space in the /, /tmp and installation directories (the best option is to use a large lvm partition for / and not connect separate partitions for /tmp and directories)

  • The firewall is disabled on the machine or configured in such a way as not to interfere with the process of creating docker networks

To start the platform installation procedure, you need to run the installation script from the folder where you plan to install yva (for example /yva-platform), https://release.yva.ai/install.sh. First of all, the installation of the server with the mngr role is started immediately after launching on the mngr server, we run the installation on all the others.

curl -fSs https://release.yva.ai/install.sh  | bash
CODE

The installation procedure will take some time, which depends on the server parameters and the width of the Internet channel. The easiest way to verify that the installation was successful is to check the status of docker containers (there should be no containers in the restarting state). To do this, you need to log in to your account and use the command below.

sudo docker ps
CODE

After successful installation, you can proceed to Initial platform configuration.