Installation on the master server using the installer
Overview
The system is installed from a local machine via an ssh connection to the server, if the available server address matches the address where the system is to be deployed.
cd /tmp/era_installer bash install_ssh.sh
In other cases, when the local address of the server is not accessible from the outside, you should first unzip and copy the installer to the server, then connect via ssh and run the script.
rsync -avrh --progress -e "ssh -p PORT" /tmp/era_installer USER@HOST:/tmp ssh USER@HOST -p PORT cd /tmp/era_installer/era bash era.sh install
The /tmp folder is chosen as the destination because it is a priori accessible to all users. It is recommended to do so.
Algorithm of the installation process
1) Run the installation script (on the local machine install_ssh.sh
or on the server era/era.sh
).
2) Enter the server address and login, wait for files to be copied to the server if the script is running on a local machine.
Enter remote server IP-address: 192.168.0.115 Enter remote server login: admin
3). Specify whether the server has Internet access.
Should installer apt-update and download packages from internet? (Y/n):
If there is no internet access on the server, in this case the installer will point to packages that are not present on the server but must be installed.
If the list is not empty, you should abort the installation process and use package installer.
Make sure that following containers are properly installed: Proceed installation? (y/N):
4) Specify the postfix to install.
Instance name postfix (recommended: _01, _02, etc; default: empty):
Several different instances of the system can be installed simultaneously on a server in different docker containers.
This postfix will be present in the container name, in the PostgreSQL DBMS instance name (if installed here), and in the file system directory names.
It is recommended that instances of the same system on different servers be told the same postfix.
5) Specify a default directory for data placement (docker container directory, PostgreSQL data directory, NFS folder, etc)
Data path (default: /opt):
6) Select in which mode the installation is performed. The first server in the cluster is the master, the others are - slave.
Are you installing master server (y/n)?: y
7) Specify the name of the master domain.
This root domain will be used to create a tree of child domains, as well as to generate the license.
Perhaps an SSL wildcard certificate will be issued for this domain, and users will type the name of this domain in the address bar of their browser.
Enter master domain name (default: era-platform.ru): pbx.company.ru
8) Select a server name.
Participates in the creation of a distributed configuration by pointing specifically to this server.
By default, the machine hostname is suggested, but any unique value that is not repeated on other servers can be specified.
Enter server name for configuration (default: box-115): srv01
9) Select whether to use a proxy server to access the Internet during installation.
In case of using a proxy, you will need to specify the address (name) of the http and https server.
Should installer use http/https proxy (y/N)?:
10) Wait for docker packages to be installed (if you selected the Internet-accessible installation mode).
11) Specify whether it is necessary to install a DBMS instance PostgreSQL.
Install PostgreSQL? (Y/n): y
If the system will connect to external already existing PostgreSQL servers or farms, you do not need to install a DBMS instance. Instead, it will be necessary to specify connection string parameters to one of the PostgreSQL servers, and specify connection strings to additional servers - replicas or doublers - when setting up the configuration.
In a multi-server deployment along with PostgreSQL, DBMS instances should be installed only on some selective servers according to the deployment plan.
11) If the mode without installing the PostgreSQL DBMS server is selected, specify the connection parameters to one of the PostgreSQL farm servers where the system to be installed should be connected.
Enter pgSql IP address: Enter pgSql port: Enter postgreSQL user 'erapgadmin' password: (default: era2020pg_role):
12) If the mode with PostgreSQL DBMS server installation was selected, then
12.1) Specify passwords for users postgres
, erapgadmin
, era_replica
.
Enter postgreSQL user 'postgres' password: (default: ********): Enter postgreSQL user 'erapgadmin' password: (default: ********): Enter postgreSQL user 'era_replica' password: (default: ********):
ATTENTION: It is necessary to set the same passwords for each of these users when installing them on all the servers whose DBMS instances will be in the streaming replication mode.
12.2) Specify whether replication is required (required if the number of servers is at least two)
Do you need replication? (y/n): y
12.3) If replication is not required (single-server installation), select the installation mode - docker or host.
If the PostgreSQL docker image archive is missing from the distribution, you will be prompted to install using the image from the docker hub (the image will be downloaded if missing)
Select PostgreSQL host/docker install mode (h/d):
The following steps of PostgreSQL installation are performed only if you select host installation mode (h)
12.4) Select the path for the instance data directory PostgreSQL
Enter postgres instance/cluster data folder (default: /var/lib/postgresql/12/era_test):
12.5) Select the path for the instance backup directory PostgreSQL.
Enter postgres instance/cluster backup folder (default: /tmp/pg_backups/era_test):
12.6) Select the installation mode - master.
Select PostgreSQL master/recovery install mode (m/r): m
For the first server it is necessary to specify master, for others recovery.
12.7) Specify the port.
Enter pgSql port (default 5441):
The default port 5432 should not be specified to avoid conflict, as it will be occupied by the default instance main .
|
12.8) Set a password for the user postgres
:
Now setup password for system user 'postgres' (it would be used for ssh):
12.9) If installation into non-standard mounted partitions was used, it is necessary to specify the name of the group where the postgres
user should be included so that he/she has access to work with the DBMS data placement directory.
In the server preconfiguration instructions for this case, a group named storage
is given in the example. It should be specified here.
If no groups for access to the mounted partition have been created, you should create and assign them in the parallel terminal according to the instructions given in the tooltip.
Ensure postgresql data folder root and permissions Enter group name to add postgres into. Leave blank if no group need:
12.10) Wait for the PostgreSQL instance to be installed and proceed to the next step.
13) Configuring working directories (container volumes)
13.1) Specify the directory path in the host to place the volume under the supervisor service directory. It is recommended to leave the default value.
/etc/supervisor/conf.d - is folder of system info. Enter SUPV volume dir for /etc/supervisor/conf.d (default: /opt/era_test/supv):
13.2) Specify the directory path in the host to place the volume under working directories.
/var/lib/era - is folder of working directories (recording, mixing, mnesia). Enter LIB volume dir for /var/lib/era (default: /opt/era_test/lib):
The default value should be changed if the sweep plan calls for placement in a specific mounted partition.
13.3) Specify a directory path in the host to place the volume under the log log directories.
/var/log/era - is folder of logging. Enter LOG volume dir for /var/log/era (default: /opt/era_test/log):
The default value should be changed if the sweep plan calls for placement in a specific mounted partition.
13.4) Specify a directory path in the host to place a volume under the temporary file directories.
/var/lib/era_files/local - is folder for local files (webserver and script-machine temporary files, file-server attachments). Enter volume dir for /var/lib/era_files/local (default: /opt/era_test/local):
The default value should be changed if the sweep plan calls for placement in a specific mounted partition.
13.5) Specify a directory path in the host to place a volume under directories with temporary files of conversation recordings by role MG.
/var/lib/era_files/rectemp - is folder for temp records of MG. Enter volume dir for /var/lib/era_files/rectemp (default: /opt/era_test/rectemp):
The default value should be changed if the sweep plan calls for placement in a specific mounted partition.
13.6) Specify a directory path in the host to place the volume under a directory with a long-lived log storage.
/var/log/era_logstore - is folder of storage. Enter LOGSTORE volume dir for /var/log/era_logstore (default: /opt/era_test/logstore):
The default value should be changed if the sweep plan calls for placement in a specific mounted partition.
13.7) Specify a directory path in the host to place a volume under a directory with storage that is synced automatically between all servers.
/var/lib/era_files/syncroot - is folder for files shared by notify-sync. Enter LOGSTORE volume dir for /var/lib/era_files/syncroot (default: /opt/era_test/syncroot):
The default value should be changed if the sweep plan calls for placement in a specific mounted partition.
13.8) Specify the path to directories in the host to allow moving files from one disk to another. It is necessary to specify 3 directories, it is recommended to specify directories from different disks.
/var/lib/era_files/a /var/lib/era_files/b /var/lib/era_files/c Enter volume dir for /var/lib/era_files/a (default: /opt/era_test/a): Enter volume dir for /var/lib/era_files/b (default: /opt/era_test/b): Enter volume dir for /var/lib/era_files/c (default: /opt/era_test/c):
The default value should be changed if the sweep plan calls for placement in a specific mounted partition.
14) Configuring client NFS folders (placing volumes under container directories in the host)
14.1) Specify the directory path in the host to place the volume under the default conversation record storage.
RECPATH - is folder of storage. It is used to store records for a long time (alternative to S3 external storage). This volume could be non-fast. Recommended to mount it previously to reliable file storage. Enter RECPATH NFS-client volume dir for /var/lib/recpath (default: /opt/era_test/era_recpath):
14.2) Specify a directory path in the host to place a volume under an intra-site network folder accessible to all servers in the current site (siteshare).
SITESHARE - is folder of NFS sync. It is used in arbitrary project cases for interaction within site. Recommended to mount it previously to reliable file storage. Enter NFS-client volume dir for /var/lib/siteshare (default: /opt/era_test/era_siteshare):
14.3) Specify a directory path in the host to host the volume under a global network folder accessible to all servers in the cluster at all sites (globalshare).
GLOBALSHARE - is folder of NFS sync. It is used in arbitrary project cases for interaction within all sites. Recommended to mount it previously to reliable file storage. Enter NFS-client volume dir for /var/lib/globalshare (default: /opt/era_test/era_globalshare):
15) Select whether to use the current server as an NFS server.
Do you want to setup as NFS server (y/N)?:
This mode is not recommended for use because if this server is dropped from the cluster, NFS access will be blocked on all other servers. |
16) Select which address to use as the server NFS.
Enter NFS server address (empty to skip setup)?:
Ideally, this should be the virtual address of a file storage group, such as those operating under the VRRP protocol. Or the address of a device that acts as a reliable file storage.
If the address is left blank, no mounts are performed on the path of the client NFS directories, and in fact the shared directories are only local.
This mode can be used for standard tasks of storing call records and attachments. But it does not allow you to use network folders in scenarios.
When installing a multi-site system, the mount directories must be configured more finely than the installer script provides. In particular, the siteshare and globalshare. |
17) Wait for the docker image to load
18) Specify a cookie (access code between cluster nodes)
PSK cookie: (default: *********):
The code must be unique and coincide on all instances of the system running in the same configuration. |
19) Wait for the container to start
Era. Installation success!
20) Specify whether the time zone MSK+03:00 should be set for use by processes nodejs
Do you need MSK timezone for nodejs usage? (Y/n):
Installation complete.