Hub — several environments behind one address
The hub puts several NomaUBL environments behind a single address. Started with nomaubl.sh hub start, it serves an environment picker at its root and each environment under its own path — https://server/prod/, https://server/test/. Each environment stays its own Java process, with its own users, licence, master key and log, whatever the source system it processes (JD Edwards, SAP, NetSuite or a custom ERP).
The hub's Administration screen creates, starts, stops, restarts and upgrades the environments, sets how each one starts, reads their logs, and — when the customer runs NomaUBL on several servers — administers the hubs of the other servers and copies the settings of an environment to the same environment on each of them.
The hub is optional: an environment started with nomaubl.sh start <env> keeps working as described in Service supervision. The hub is driven by nomaubl.sh (nomaubl.cmd on Windows, same subcommands).
At a glance
How it works
| Topic | Behaviour |
|---|---|
| Environments | Every folder of the environments folder (ENV_HOME of nomaubl.conf, the script's folder by default) that holds config/config.json. An environment installed with nomaubl.sh install appears as well as one created from Administration; it is started by hand until Start it with the hub is ticked in its start settings. |
| Address | The hub listens on its own port; each environment opens under /<environment>/. A request to /<environment> is redirected to /<environment>/. |
| Internal port | Without its own port, an environment started by the hub gets a free port at each start, from 18101 upward, reachable from the server only — it is reached through the hub. The port is kept in its PID file nomaubl-<environment>.pid. |
| Log | Each environment writes nomaubl-<environment>.log in the environments folder, as with nomaubl.sh start; the hub writes nomaubl-hub.log. |
| Links sent by an environment | Password reset links and Claude's sign-in carry the environment's path without any setting. |
| Promotion | A promotion target served by a hub is given by the environment's address: https://server/<environment>. |
| Names | Lower-case letters, digits, - and _, 40 characters at most, starting with a letter or a digit; hub, api, static and assets are reserved. |
The hub itself answers in plain HTTP. For HTTPS, put a reverse proxy in front of the hub's port, as for one environment — see Service supervision → Reverse proxy.
Commands
| Command | Effect |
|---|---|
nomaubl.sh hub start [port] | Starts the hub in the background. Port: the one given, else the one of the last start, else DEFAULT_PORT (8090). The environments set to start with the hub start with it. |
nomaubl.sh hub stop | Stops the hub and the environments it started. |
nomaubl.sh hub restart [port] | Stops, then starts — after installing a new release. |
nomaubl.sh hub status | Running or not, PID and port. |
nomaubl.sh hub token | Prints a new administrator token for Administration. |
nomaubl.sh hub log | Follows the hub's log (tail -f nomaubl-hub.log). |
./nomaubl.sh hub start 9000
./nomaubl.sh hub token # prints nmh_… — keep it, it is shown once
./nomaubl.sh hub status
An environment started with nomaubl.sh start is never taken over by the hub: Administration lists it as Outside the hub until it is stopped with nomaubl.sh stop <env>.
Environment picker
The hub's address opens Choose an environment: one card per environment, with its display name and colour (the Environment and Theme colour fields of Settings › Global) and its path. A stopped environment is greyed out and marked Stopped. A click opens the environment's own sign-in page.
Inside an environment served by the hub, Switch environment goes back to the picker: the grid icon of the top bar, and the link under the sign-in form.
Sign-ins and preferences are kept per environment in the browser: signing in to prod does not sign in to test, and the two can stay open side by side in two tabs, each with its own session, assistant history and preferences.
Administration
The Administration link under the picker asks for an Administrator token — one printed by nomaubl.sh hub token. Only the hash of a token is kept on the server; each call of the command adds a new token. As long as no token exists, Administration refuses every call. The token is kept for the browser tab; Sign out forgets it.
The page shows the environments on the left, grouped by server, and the log of the selected one on the right. The top bar holds Servers, New environment, Back to the environments and Sign out.
Each environment card shows:
| Element | Content |
|---|---|
| Name and path | Display name, /<environment>/, then its own address when it has an own port (a link while it runs), or its internal port, then its memory and started by hand when it does not start with the hub. |
| State | Running, Stopped, or Outside the hub for an environment started with nomaubl.sh start (Started with nomaubl.sh start: stop it there to manage it here.). |
| Jobs | With scheduled jobs on one server: Runs the jobs, or Jobs on the server that runs them with Run the jobs here. |
| Primary | Primary and Sync on the primary environment; Settings from the primary server and the date on the others. |
| Buttons | Open (running), Restart and Stop (running) or Start (stopped), Upgrade, Settings. |
A click anywhere else on the card selects the environment and shows its log. Open opens the running environment in a new tab, through this hub or through the hub of its server.
Create an environment
New environment opens the creation window:
| Field | Description |
|---|---|
| Server | Shown when other servers are administered: where the environment is created. |
| Name (its path: /name/) | Name of the environment and of its folder, e.g. prod. |
| Database | PostgreSQL or Oracle. |
| JDBC address | Address of the NomaUBL database. Blank: set it later in Settings › NomaUBL database. |
| User, Password, Schema | Database account and schema (public by default for PostgreSQL). |
| Licence key (optional) | The environment's licence. |
| Memory | Java heap, e.g. 2g, 512m; blank: the JVM's default. |
| Its own port | Blank: through the hub only. See Start settings. |
| Start it once created / Start it with the hub | Both ticked by default. |
Create installs the environment (as nomaubl.sh install), writes its database connection and licence — the password encrypted with the environment's own master key —, prepares its database (tables, default roles, a first admin account) and starts it. The steps are shown in the window; the preparation can take a few minutes. Sign in with admin / admin: a new password is asked at the first sign-in. Without a JDBC address, the database is not prepared: set the connection in Settings, then run Initialize.
Start, stop, restart, upgrade
Start, Stop and Restart act at once; a line above the list gives the outcome.
Upgrade asks for a confirmation: the environment is stopped, upgraded to the release installed on its server (backup, database, settings, files), then started again if it was running. Its users are disconnected meanwhile. The upgrade is the one of nomaubl.sh upgrade <env>; its report replaces the log on the right (Show the log goes back). A failure says so and names the backup folder, <environment>/backup/. An environment started with nomaubl.sh start is upgraded with nomaubl.sh upgrade.
Start settings
Settings opens the start settings of the environment, applied at its next start or restart:
| Field | Description |
|---|---|
| Start it with the hub | Started by nomaubl.sh hub start; otherwise it is started by hand from Administration (started by hand on its card). |
| Primary of its cluster | Its settings are copied to the environment of the same name on the other servers — see Same settings on every server. |
| Memory | Java heap, e.g. 2g, 512m; blank: the JVM's default. |
| Its own port | Blank: through the hub only. With a port, the environment also listens there, open to the network as with nomaubl.sh start — an address used before the hub keeps working, and the environment stays reachable and managed through the hub. Between 1024 and 65535, neither the hub's port nor another environment's; a port taken by another program fails the start. Both addresses show on its card. |
| Extra Java options | Added after the JAVA_OPTS of nomaubl.conf, e.g. -Duser.timezone=Europe/Paris. |
Log reader
The right-hand pane reads the end of the selected environment's log, with the file's path and size:
| Control | Effect |
|---|---|
| All / Warnings and errors / Errors | Level filter. Plain lines that read as a failure count as errors. |
| Search… | Keeps the lines that contain the text. |
| 200 / 500 / 2 000 / 10 000 lines | Number of lines read from the end of the file (500 by default). |
| Auto-refresh, Refresh | Reloads the lines; the view stays at the end while new lines come. |
| Download | Saves the lines loaded as <environment>.log. |
Lines with a level show it as a badge, with their module apart; the headings of an upgrade report show as sections. The counter gives the lines shown out of the lines loaded.
Several servers
When the customer runs NomaUBL on several servers, each with its hub, one hub can administer the others. Servers opens:
| Section | Content |
|---|---|
| This server | The name shown to the other servers (blank: the host name). |
| Other servers | Each server added, with its address, release, certificate not checked when so, and its state: Connected, Token refused, Unreachable (with the reason). Edit changes it; Remove stops administering it — nothing changes on that server. |
| Add a server | Name, Address of its hub (e.g. https://srv-b:9000), Its administrator token — printed by nomaubl.sh hub token on that server —, Check its certificate (untick for a self-signed or internal certificate). On a change, a blank token keeps the stored one. |
The server must answer as a hub with that token to be added; its token is kept encrypted. In Administration, the environments then appear under each server's name with its release — other release when it differs from this server's — and are started, stopped, upgraded, opened and read through that server's hub; New environment offers the choice of the server. A server that does not answer is shown with the reason. Each server stays administrable from its own hub, and a server's own servers are administered from that server.
Same settings on every server
The same environment — same name, same database — can run on several servers. One of them is marked Primary of its cluster in its start settings: its card shows Primary and, while it runs, Sync.
Sync asks each other server what the environment of the same name would receive, then shows a preview server by server:
| Element | Content |
|---|---|
| Summary | Items changed, new, identical and only there, files changed and new. |
| Item list | Kind, item, state — changed, new, identical, extra (found only on that server), skipped —, number of changes. |
| Differences | A click on an item compares it field by field: key, change, value on that server, value of the primary. |
| Apply on n server(s) | After a confirmation, the primary's settings replace those of the other servers; a version of each file is kept first, and the jobs there re-read their settings at once. |
A sync carries the documents and their files, the connectors, the settings templates — Global and single sign-on included —, the PDF templates, entry forms, lists, digests, auto-retries, lifecycle checks, notification rules, the UBL defaults and the Explorer analyses and dashboards.
Each server keeps:
- its passwords, tokens and keys, its licence key, its environment name and colours;
- its paths (the directories of Global, Ghostscript, XDO, logo) and its public address, the single sign-on return address;
- the progress marks of its jobs;
- which jobs run on it and how often — unless the jobs run on one server only, in which case these travel too.
An item new on a server arrives switched off there; nothing is removed — an item found only on a server stays there. A server whose environment of that name uses another database refuses the sync: it is not the same environment, and nothing changes. A server without an environment of that name is listed as such, and there is one primary per cluster: an environment marked primary on the receiving server refuses the sync too. The sync works between environments started by their hub; on each receiving environment the card then shows Settings from the primary server and the date.
Scheduled jobs on one server
When several servers share the same database, Settings › Global › Job defaults › Several servers › Run the jobs on one server only runs the scheduled jobs and the polling command lines on one server only; another server takes over within two minutes if it stops, from where the jobs had got to — see Global → Several servers.
In Administration, the running environments show Runs the jobs, or Jobs on the server holding them with Run the jobs here: after a confirmation, the jobs move to this environment's server, the other one stops running them at its next check, and a run in progress there finishes. The Scheduled jobs page of the environment says which server runs them.
Access
Administration only takes the hub's administrator token; no NomaUBL account is involved. Inside each environment, the users and roles are those of that environment.
Tips & best practices
- Keep the administrator token in the team's password vault. It is shown once; a new one is printed by
nomaubl.sh hub tokenat any time. - Give an own port to an environment already in use when moving it behind the hub: the bookmarks and links to its former address keep working.
- Upgrade in order. Install the new JAR and
nomaubl.shnext to the hub, runnomaubl.sh hub restart, then Upgradetestbeforeprod, reading each report. - Preview before applying a sync, server by server, and open the changed items to check their fields.
- Keep the servers' clocks in sync (NTP) when the jobs run on one server only: the servers compare times to know who runs the jobs.