Installation on a remote server

The usual method: the command runs on your machine and the platform is installed on the server.

bash install_ssh.sh --host=192.168.0.10 --user=user

What happens step by step

  1. Local prechecks. Terminal encoding and pseudo-graphics availability.

  2. Connection data survey — address, user, port, key.

  3. Connection and remote server prechecks: OS, bash version, permissions, free space, port occupancy, presence of a container with the same name. The ssh password is asked here too if login is not by key.

  4. Delivery plan: what will be copied, what will be launched, and on which server. It is printed to the screen and the log but does not ask for confirmation: the wrapper only delivers files and starts the installer, and you already gave consent by launching it. Each large image is asked about separately — right before copying. The survey continues on the target server — defaults depend on its OS (PostgreSQL paths, package names), so they are computed there.

  5. Delivery: rsync copies the installer, then separately the large image files so they need not be resent.

  6. Launch: era/scripts/install.sh is executed on the server, and its wizard works in your terminal.

  7. Log fetch: the remote side log is copied to logs/remote/<host>/.

Both halves speak the same language: the selected language is passed to the server along with the other "how to launch" keys.

Wizard screens

The installation survey runs on the target server — after delivery confirmation and file copying, not immediately after connection. The screens are the same for local and remote installation. Keys specified in the wrapper command line are passed there, and the server does not ask about them again.

No. Screen What it asks about

0

Connection

Only in ssh mode: address, port, user, key.

1

Server and role

Platform address, postfix, data directory, server name, master or node, domain or mic addresses, PSK key.

2

Packages and network

Whether to install packages from the internet, proxy.

3

PostgreSQL — mode

Whether to install the database, in a container or on the host, master or replica, replication, image from Docker Hub.

4

PostgreSQL — access

DB server address, port, platform user and passwords, platform connection SSL (on the master), replication user, OS group.

5

PostgreSQL — directories

Cluster directory, backup directory, whether to clear an existing one.

6

Platform volumes

Twelve directories mounted into the container. Defaults are derived from the data directory and postfix.

7

NFS

Client directories, server or client role, network mask, exported directories.

8

Kernel parameters

Connection reuse in TIME_WAIT.

9

Advanced

Appears only with the --advanced key: platform ports, docker networks, SELinux and firewalld, running without root.

10

Additional servers

Only on the master: whether other servers are planned, how many, and each one’s name and address. The servers themselves are not installed here — ready commands for each are shown at the end.

A screen is skipped entirely if none of its questions is needed given the current answers. For example, screen 5 will not appear if you are not installing a database.

Controls during the survey

Key Action

kbd:[Enter]

Accept the default value (shown in parentheses).

<

Return to the previous question and change the answer.

?

Hint for the current question.

!

Show everything already entered.

kbd:[Ctrl+C]

Abort. Nothing has been changed.

Buttons in pseudo-graphics name what will happen when pressed. On screens with a question these are "Next" and "Back". On screens where nothing is entered — prechecks, summary, plan, report — the button is also called "Next": it leads to the next step. "OK" remains only on the last launch window — after answers are saved, when there will be no continuation.

In pseudo-graphical mode the way to exit is named in every window and depends on the tool:

  • whiptail (Debian, Ubuntu, Linux Mint, Astra Linux, and other Debian derivatives) — kbd:[Esc];

  • dialog (other systems) — the "Exit" button present on every screen.

Exit terminates work immediately and saves nothing: neither the answers file, nor the repeat command, nor the log of this run. The server is not changed — the installer does not touch it before confirmation.

The split is not arbitrary. In the newt library on which whiptail is built, kbd:[Esc] is not a standard form-close hotkey: it works only where the build contains the corresponding patch — in deb-like distributions. On other systems the whiptail window cannot be closed at all, so dialog is used there, which has a third button. If dialog is not installed, the installer works in text mode.

Back works between screens too: from the first question of a screen < takes you to the last question of the previous one. If a changed answer changes the branch — say, you switched the database from a container to the host — questions that lost their meaning are asked again.

Confirmation screen

It is shown on the target server — where the survey runs. The wrapper has no confirmation screen of its own: it has nothing to confirm, it only copies files and starts the installer, and asks about each large image separately before copying.

It shows three things:

  • summary of what was entered — parameter, value, and where it came from: command line, answers file, default, or you;

  • plan — a numbered list of what will be done, and separately a list of system files that will be changed;

  • precheck warnings, if any.

Available actions:

Item What it does

Continue

Proceed to the apply phase.

Change…​

Return to the selected wizard screen. On re-entry it asks also about what came from the answers file or a key: the previous value is substituted as default, and a correction is marked with the corrected source.

Show passwords

Removes masking in the summary. Passwords are hidden because the screen remains in the terminal scrollback.

Save answers

Writes the answers file and exits without changing anything.

Show command

Prints a ready non-interactive command with the same values.

Cancel

Exit. The server is not changed.

What is shown at the end

Everything the installer prints on the target server is visible here too: output goes over ssh unchanged. Therefore after application you will see the same "what changed on the server" form and the same commands for this server as with a local launch — see era_installer/install-local.adoc#era-installer-install-local-changes.

Separately, the wrapper fetches the log from the target host to logs/remote/<address>/: there is no need to log in to the server manually to analyze a failure. The log is fetched after a trial run too: it runs on the same side and must be analyzed the same way.

Examples

A master with a database in a container, without a single question:

bash install_ssh.sh --non-interactive \
     --host=192.168.0.10 --user=user \
     --ipaddress=192.168.0.10 --srvname=srv1 \
     --master=y --masterdomain=example.ru \
     --dopginstall=y --pgmode=d --usedockerhubpgimage=y

A node connecting to an already deployed master:

bash install_ssh.sh --non-interactive \
     --host=192.168.0.11 --user=user \
     --ipaddress=192.168.0.11 --srvname=srv2 \
     --master=n --micaddress=mic@192.168.0.10 \
     --dopginstall=n --pghost=192.168.0.10

Non-standard ssh port and key login:

bash install_ssh.sh --host=192.168.0.10 --port=2222 \
     --user=user --sshkey=~/.ssh/id_ed25519

See the plan and change nothing:

bash install_ssh.sh --dry-run --host=192.168.0.10 --user=user

--dry-run applies to the target host, not the wrapper: the plan is built by the server itself, and only it can show it. Therefore the wrapper does its work for real — copies the distribution to /tmp/era_installer and runs the installer there with the same key — while the server is not changed. The distribution remains in /tmp and disappears on reboot.

SSL for the platform connection to PostgreSQL

On the master server the pgssl question controls the ssl field in the platform connection string (SQLSTR). Allowed values: true and false, default — false. For SSL specify --pgssl=true in the local or SSH installation launch. The value is saved in the answers file and the repeat command of the current server.

With pgssl=true an additional question appears: "PostgreSQL authorization mode" (--pgauthmethod). Options: cleartext, md5, scram-sha-256, and "Not set" (default). For example, the combination --pgssl=true and --pgauthmethod=scram-sha-256 adds ssl:true,auth_method:scram-sha-256 to SQLSTR.

An empty value (--pgauthmethod=) does not add auth_method to SQLSTR. With pgssl=false the question is hidden and the field is not passed. A method previously entered in the wizard is reset; one explicitly passed via CLI or the answers file is kept for repeat but not used until SSL is enabled.

PostgreSQL must be configured for SSL separately: this key does not create certificates or change the DB server or replication configuration. Additional platform servers receive the configuration from the master; they are not asked about SQLSTR.

Connecting to PostgreSQL prepared by DB administrators

When installing the platform master select "do not install PostgreSQL" (--master=y --dopginstall=n). The master will request:

  • pghost — the address of the ready PostgreSQL;

  • pgport — its port (specify the actual port; the installer default is 5441);

  • pgpostgresuser — the name of the existing platform role, despite the historical key name;

  • pgerapwd — the password of exactly this role;

  • pgssl — whether to use SSL (false by default).

The role name and password are provided by the DB administrator. The default values platformpgadmin and Era_User_pwd do not mean that such credentials already exist on the external server. Specify the administrator’s actual values.

The installer does not create or modify the role on the ready server: it passes the credentials to the platform in SQLSTR. The built-in postgres role and its password (pgpostgrespwd) are not needed for this and are not requested on the master. The answers file and the repeat command of the current server save the selected data; the password is masked on screen and in the journal.

The DB administrator must ensure access from the platform server in advance, configure SSL if required, and prepare a role with platform permissions. When creating the role independently, the installer uses LOGIN CREATEDB CREATEROLE INHERIT; the initial database in SQLSTR is postgres. These requirements should be agreed with the external DB administrator.

For automated launch pass --pgpostgresuser=<role name>, and set the password with the line pgerapwd=<role password> in a protected --secrets-file. See era_installer/unattended.adoc#era-installer-unattended-secrets. The remaining parameters can be passed via CLI or the answers file.