Cloud and Docker
Cloud and Docker
HQbird works on a cloud server the same way as on your own server. For Docker, there is a ready image for each Firebird line. Backups go directly to S3, with no file on the server disk. The connection to the center needs no inbound ports.
- 4 images Firebird 5 · 4 · 3 · 2.5
- 1 container Firebird, agent and console
- S3 backup with no file on disk
- 0 inbound ports for the connection to the center
- 200–250 MB of memory per idle instance
Server · container · storage
Three parts of a cloud installation
You can install HQbird on a cloud server with the normal installer or run it in a Docker container. In both cases the agent connects to HQCenter on its own, and backups can go to S3 storage.
Normal installer
One file installs Firebird, the agent and the console on a cloud server. The installer itself downloads nothing. A good fit when the whole server is for the database.
Docker image
One container is one Firebird with all HQbird components. Data is on volumes and stays when you replace the container or the image.
Backups to S3
gbak and nbackup write to a stream, and the stream goes to a bucket. The backup needs no space on the server disk. It works both on a server and in a container.
Images · first start · compose
HQbird in Docker
The container installs HQbird with the same installer as a server. Firebird, the fbagent agent and HQ Monitor run inside. The agent installs the cluster node itself when the instance joins a cluster. It installs RCM only when this instance is assigned as the cluster RCM.
The images are in the IBSurgeon GitHub Container Registry. They are public: you do not need to log in to the registry. The image tag is the version of the HQbird kit.
| Image | Firebird | Firebird port | HQ Monitor |
|---|---|---|---|
ghcr.io/ibsurgeon/hqbird2027-fb50 | 5.0 | 3050 | 23050 |
ghcr.io/ibsurgeon/hqbird2027-fb40 | 4.0 | 3050 | 23050 |
ghcr.io/ibsurgeon/hqbird2027-fb30 | 3.0 | 3050 | 23050 |
ghcr.io/ibsurgeon/hqbird2027-fb25 | 2.5 | 3050 | 23050 |
First start
- 1compose.yamlcopy it from the kit to a folder on the host
- 2SYSDBA passwordinto a secret file that only you can read
- 3Image, name, secretsset
imageandhostname, remove the#from thesecrets:lines - 4docker compose up -dthe container installs HQbird
- 5✓ healthyFirebird and the console respond
mkdir -p secrets openssl rand -hex 12 > secrets/sysdba_password chmod 600 secrets/sysdba_password docker compose up -d docker compose logs -f # installation progress docker compose ps # wait for healthy
On a server with 2 cores, the installation at the first start takes about 20 seconds.
What you get
- Firebird:
<Docker host>:3050. - HQ Monitor:
http://<Docker host>:23050/, loginadmin. - The installer creates the console password. It is in the file
/opt/hqbird/conf/access.propertiesinside the container. - The agent name in HQCenter: the host name, the installation date and the Firebird line.
Daily work
| Task | Command |
|---|---|
| Service state | docker compose exec hqbird systemctl list-units --type=service |
| Restart Firebird | docker compose exec hqbird systemctl restart firebirdFirebird 3.0: the firebird-superserver service |
| isql | docker compose exec hqbird /opt/firebird/bin/isql -user SYSDBA localhost/3050:/db/my.fdb |
| Log for one hour | docker compose logs --since 1h |
| Stop | docker compose stop: Firebird closes the databases |
Inside the container, the systemctl command controls the HQbird services, but it is not systemd. It understands the commands that HQbird programs use: start, stop, restart, status, list-units and others.
Variables · secrets · volumes
Settings and volumes
The container reads the settings only once, at the first start: this is the installation. Data, configuration, the license and updated programs are on volumes. They stay when you create the container again or change the image.
| Setting | What it does |
|---|---|
HQBIRD_FB_PORT | Firebird port inside the container, 3050 by default. HQ Monitor listens on 20000 + this port. |
HQBIRD_HQM_PORT | A different HQ Monitor port. |
HQBIRD_AGENT_ID | Agent name. By default it is made from the host name, the date and the port. |
HQBIRD_HQM_LOGIN, secret hqmonitor_password | HQ Monitor login and password. |
HQBIRD_TRIAL_EMAIL, HQBIRD_TRIAL_ZONE | Request for a trial license. |
secret sysdba_password | SYSDBA password of the new Firebird. |
secret license | License file. |
secret attach | The attach.json file from HQCenter: it connects the agent to your center. |
| Volume | Path | Contents |
|---|---|---|
db | /db | Databases. Put your databases here. |
backup | /backup | Backups. |
opt | /opt | Firebird, the agent, HQ Monitor, cluster node, RCM. |
state | /var/lib/hqbird-container | Services, console data, agent logs, machine ID. |
trust | /usr/libexec/hqbird-fbagent | Trusted start of agent updates. |
rootwork | /var/lib/hqbird-fbagent | Work folder for updates. |
- Host folders only for databases and backupsYou can replace the
dbandbackupvolumes with host folders. Give them to the user with uid 84: this is thefirebirduser in the image. Do not replace the other four volumes with host folders. - Backup of the volumesSave all six volumes together.
- Do not change the host nameThe license is bound to the machine ID on the
statevolume and to the agent name. A newstatevolume is a new installation. - Connect to the center with one fileThe
attachsecret connects the agent to HQCenter at the first start. You do not need to enter the container for this.
Port publishing · firewall · second instance
Ports and several instances
Publish each port with the same number outside and inside the container: 3051:3051, not 3051:3050. The agent and the cluster report the port that they see inside the container.
| Port | What | When needed |
|---|---|---|
HQBIRD_FB_PORT (3050) | Firebird | always |
| 20000 + Firebird port (23050) | HQ Monitor | always |
| node port (7051) | cluster node | the instance joins a cluster |
| 7443, 7444 | RCM and its web interface | this agent runs RCM; one per host |
Docker publishes ports past ufw. We checked it: with the ufw rule "only port 22", the Firebird and HQ Monitor ports were open from the internet. Use an external firewall, publish the port on one host address ("10.0.0.5:23050:23050") or add rules to the iptables DOCKER-USER chain.
Second instance on the same host
Each instance needs its own folder, project name, host name and ports. The project name sets the volume names. With the same name, the second start takes the volumes and the container of the first one.
- Firebird: 3050 + N.
- HQ Monitor: 20000 + Firebird port.
- Cluster node: 7051 + N.
- Only one instance on the host can run RCM.
Other Firebird lines on the same host follow the same rules, each with its own image.
| Instance 1 | Instance 2 | |
|---|---|---|
| Project and host name | hqbird-fb40-3051 | hqbird-fb40-3052 |
HQBIRD_FB_PORT | 3051 | 3052 |
| Ports | 3051, 23051, 7052 | 3052, 23052, 7053 |
- MemoryOne idle instance takes about 200–250 MB. We checked it: three Firebird 4.0 instances on a server with 2 cores and 4 GB of memory, one of them under load.
- Firebird outside Docker on the same hostIf Firebird or HQbird already runs on the host without Docker, skip ports 3050, 23050 and 7051.
HQCenter · new image · cluster
Updates and cluster
You can update a container in two ways. Both keep the data.
From HQCenter
As on a normal server: the center updates the agent, HQ Monitor, Firebird, the cluster node and RCM inside the container. The updated programs are on a volume, so they stay after a restart.
With a new image
Change the version in the image line and run:
docker compose pull docker compose up -d
At start, the container runs the installer of the new image in update mode. If the center already updated the agent to a version newer than the one in the image, the installer does not run: the version does not go down.
Container in a cluster
An instance in a container joins a cluster the same way as a server. The member address is the address of the Docker host. Publish the cluster ports in compose.yaml.
- The node port, for example 7051: when the instance is a cluster member.
- Ports 7443 and 7444: when this agent runs RCM. For the web interface on 7444, set
operator_addr=0.0.0.0:7444in the RCM settings. - The node port in the cluster description must match the published port.
The agent installs the node a few minutes after you save the cluster. Until then, the node port does not respond.
Cloud server · NAT · firewall
HQbird on a cloud server
On a cloud server, you install HQbird with the normal installer: one file, one command. Firebird, the agent and the console are inside the file: the installer downloads nothing. On Linux, it gets a few OS libraries (libtommath, ICU) from the distribution repository. If there is no repository, it prints the exact commands and changes nothing.
- No inbound ports for the centerThe agent connects to HQCenter on its own. A server behind NAT or in a private cloud network looks the same in the center as a server in your rack.
- OS firewallThe installer opens the port of the new Firebird and the HQ Monitor port in firewalld or ufw. You set up the firewall rules of the cloud itself.
- Server requirementsAt least 2 GB of memory, 2 cores and 5 GB of disk. Linux x86-64 or Windows.
- Linux distributionsUbuntu, Debian, AlmaLinux, Rocky, RHEL, Oracle Linux, openSUSE, RED OS and others with apt, dnf, yum or zypper.
- A hundred servers by scriptEvery installation step is available as a switch. You can view the installation plan first: the command changes nothing.
- Secrets are protectedA secret that you enter in the console goes to the agent encrypted. Secrets are hidden in reports and in configuration copies. In the agent configuration file, the S3 key is not encrypted: limit access to this file. On an Amazon EC2 server, you can work without a key: the agent uses the IAM role of the server.
- Metrics in your GrafanaThe agent exports Firebird and server metrics in Prometheus format.
- Cloud disk under controlThe agent measures read and write latency and forecasts when the disk becomes full. A slow or nearly full cloud disk is visible in the health report.
Limits · tips
Good to know
- Docker and ufwA published container port is open past ufw. Close it with an external firewall or publish it on one address.
- Settings only at the first startVariables and secrets are read once. You cannot change the Firebird port, the host name and the secrets later: you need a new installation. You change jobs and other agent settings in HQ Monitor or from the center.
- Scripts with docker compose execIn scripts, add the
-Tswitch and</dev/null. Without them, the command reads standard input and takes the rest of the script.
- Warnings before the connection to the centerUntil the agent connects to HQCenter, its log says that the connection settings are incomplete. This is normal.
- Image signatureThe images are signed with the cosign tool. The public key to check them with the
cosign verifycommand is not published yet. - Where it was testedUbuntu 22.04, Docker with Compose, a server with 2 cores and 4 GB of memory. A step-by-step installation guide for Ubuntu is available in Russian and Portuguese.