Documentation pages
Choose 6A for one server or 6B for the cluster with automatic takeover. Both use the PostgreSQL server of chapter 4 (or a local database on a single server).
6A.1 One server: install
cd ~ && tar xzf TRINITY-1.2.1-Linux.tar.gz && cd trinity
sudo ./install-trinity.sh --fqdn trinity.corp.example.com --admins 'CORP\GG-Trinity-Admins' \
--cert ~/certs/trinity.crt --key ~/certs/trinity.key --guacd \
--db postgresql --db-host pg01.corp.example.com --db-name wsp --db-user wsp --db-tls require
It asks for the password of wsp (4.3) and for the account that joins the server to AD. It installs the service trinity-portal, joins the server as the computer account of the portal name (TRINITY$, SPNs HTTP/ and host/), installs the certificate, builds guacd for remote access (--guacd, about 10 minutes) and starts. Without --db … it asks for the database in a menu; local installs PostgreSQL on the portal server itself.
| Option | Meaning |
|---|---|
--fqdn |
portal DNS name (default hostname -f) |
--admins |
first L4 administrators (AD groups or users, comma separated) |
--breakglass |
always L4 (default DOMAIN\Domain Admins) |
--join-user |
AD account that joins the server (asked when missing) |
--cert / --key |
certificate with chain and key, PEM |
--db KIND |
local, postgresql, azure-pg, gcp-pg, azure-sql, gcp-mssql, sqlserver |
--db-host, --db-port, --db-name, --db-user, --db-tls |
external database |
--guacd |
remote access and VDI browser sessions on this server |
--update |
new version: program only, settings and data stay |
Firewall: sudo ufw allow 80/tcp && sudo ufw allow 443/tcp. Check: sudo systemctl status trinity-portal, then https://trinity.corp.example.com/trinity-status.
6B.1 Cluster: settings file (trinity01, trinity02, trinity03)
On each of the three servers, the same file:
cd ~ && tar xzf TRINITY-1.2.1-Linux.tar.gz && cd trinity
sudo install -d -m 750 /etc/trinity
sudo tee /etc/trinity/cluster.conf >/dev/null <<'EOF'
NODE1=trinity01
NODE1_IP=10.0.10.33
NODE2=trinity02
NODE2_IP=10.0.10.34
WITNESS=trinity03
WITNESS_IP=10.0.10.35
VIP=10.0.10.36
VIP_CIDR=24
FQDN=trinity.corp.example.com
DOMAIN=corp.example.com
NFS=nas01.corp.example.com:/export/trinity
NFS_OPTS=vers=4.1,hard,timeo=600,retrans=3
DB_KIND=postgresql
DB_HOST=pg01.corp.example.com
DB_PORT=5432
DB_NAME=wsp
DB_USER=wsp
DB_TLS=require
ADMINS='CORP\GG-Trinity-Admins'
BREAKGLASS='CORP\Domain Admins'
WSP_UID=2990
SBD_WATCHDOG_TIMEOUT=15
GUACD=yes
EOF
Without DB_KIND (or DB_KIND=local) the cluster runs its own PostgreSQL on both nodes with replication instead. WSP_UID is the id of the service account on both nodes (the files on the share belong to it): getent passwd 2990; getent group 2990 must print nothing on all three servers. The witness should run on a third hypervisor host.
6B.2 Firewall (all three)
# trinity01 and trinity02
sudo ufw allow 80/tcp && sudo ufw allow 443/tcp
sudo ufw allow from 10.0.10.33 to any port 2224,5432 proto tcp; sudo ufw allow from 10.0.10.34 to any port 2224,5432 proto tcp
sudo ufw allow from 10.0.10.33 to any port 5404:5406 proto udp; sudo ufw allow from 10.0.10.34 to any port 5404:5406 proto udp
# trinity03 (witness)
sudo ufw allow from 10.0.10.33 to any port 2224,5403 proto tcp; sudo ufw allow from 10.0.10.34 to any port 2224,5403 proto tcp
6B.3 Build the cluster
| # | Where | Command | What it does |
|---|---|---|---|
| 1 | trinity03 | cd ~/trinity && sudo ./trinity-cluster.sh witness |
quorum device; asks for the hacluster password (use the same on all three) |
| 2 | trinity01, then trinity02 | cd ~/trinity && sudo ./trinity-cluster.sh prepare |
packages, account trinity, the program, watchdog, guacd |
| 3 | trinity01 | cd ~/trinity && sudo ./trinity-cluster.sh init --cert ~/certs/trinity.crt --key ~/certs/trinity.key |
cluster, fencing, database check, files on the share, AD join of the portal name |
| 4 | trinity01 | cd ~/trinity && sudo ./trinity-cluster.sh resources |
hands the VIP, the share and the portal to Pacemaker, waits until it answers |
Before step 3, check the database from trinity01 (asks for the wsp password): psql "host=pg01.corp.example.com dbname=wsp user=wsp sslmode=require" -c 'select version()'. In step 3 answer: the hacluster password; Create the database and the user now with an admin login? No (it exists); the wsp password; the AD join account and its password. With the cluster's own PostgreSQL, run sudo ./trinity-cluster.sh standby on trinity02 between steps 3 and 4.
6B.4 Check and test the takeover
sudo ./trinity-cluster.sh status
curl -s https://trinity.corp.example.com/healthz; echo # 200
sudo ./trinity-cluster.sh failover # the portal answers on the other node within ~30 s
Then power off the active VM from the hypervisor: the portal is back within 30 to 90 seconds. Never start trinity-portal with systemctl on a node: Pacemaker owns it.
| Task | Command |
|---|---|
| State | sudo ./trinity-cluster.sh status, sudo pcs status |
| Patch the nodes | failover, patch and reboot the passive node, failover, patch the other |
| New TRINITY version | sudo ./trinity-cluster.sh update on one node |
| Stop or start everything | sudo pcs cluster stop --all / sudo pcs cluster start --all |
6.3 First settings in the portal
- Open
https://trinity.corp.example.comas a member ofGG-Trinity-Admins(domain PCs sign in without a password when the portal is in the Local intranet zone; other PCs get the sign-in page). - Trinity VDI > Remote access > Remote access settings: tick Remote desktop in the browser, host
127.0.0.1, port4822; tick Record sessions; Save. The heading must say guacd reachable. The connection servers read this setting too: without it no VDI session opens in the browser.
6.4 Where things are
| What | Where |
|---|---|
| Service, log | trinity-portal, journalctl -u trinity-portal -f |
| Settings | /etc/trinity/trinity.json (cluster: on the share) |
| Secret key (back it up) | /etc/trinity/secret.key |
| Kerberos keytab | /etc/trinity/trinity.keytab (machine password rotated weekly) |
| Data, reports, nightly database dump | /var/lib/trinity |
6.5 Other databases
--db / DB_KIND |
Use it for |
|---|---|
local |
PostgreSQL on the portal server (single) or replicated on both nodes (cluster) |
postgresql |
your PostgreSQL 12+ (a Patroni cluster: its VIP / HAProxy port) |
azure-pg, gcp-pg |
Azure Database for PostgreSQL, Google Cloud SQL for PostgreSQL |
azure-sql, gcp-mssql, sqlserver |
Azure SQL, Cloud SQL for SQL Server, SQL Server 2016+ |
Unattended (scripts, images): the installer takes the passwords from the environment instead of asking. Type them at a hidden prompt so they never stand on a command line:
read -rsp 'Password of wsp: ' DB_PASS; echo; read -rsp 'Password of the database admin: ' DB_ADMIN_PASS; echo
export DB_PASS DB_ADMIN_PASS WSP_UNATTENDED=1
sudo --preserve-env=DB_PASS,DB_ADMIN_PASS,WSP_UNATTENDED ./install-trinity.sh --fqdn trinity.corp.example.com \
--admins 'CORP\GG-Trinity-Admins' --db azure-pg --db-host <server>.postgres.database.azure.com --db-admin <admin>
unset DB_PASS DB_ADMIN_PASS
Names, addresses and accounts in the examples (corp.example.com, 10.0.x.x, CORP\…) are examples: use your own. TRINITY 1.2.1, December 2026.