Skip to content

Deploying InfluxDB 3.x cluster on AlmaLinux 9 with object storage backing

Stand up a self-hosted InfluxDB 3.x cluster on AlmaLinux 9 — token auth, retention policies, S3-compatible object storage, mTLS, and operational checks that catch silent ingest gaps.

Your IoT product is pushing 60k points per second into a single-node InfluxDB OSS 2.x box, and the daily compaction job has started overlapping with the next day’s. Memory pressure climbs through the morning, the WAL replay on restart takes 14 minutes, and your read latency on the dashboard goes from sub-second to “wait, did it submit?” Every InfluxDB blog post written after 2024 is about Influx 3.x, which is a different engine — Parquet on object storage, separate ingester / querier / compactor / router roles — and the migration story isn’t “edit a config and restart.” It’s a deployment from scratch, with a fresh ingest path and a tiered retention model.

What’s happening

InfluxDB 3.x is a different beast from 1.x/2.x. The OSS edition runs in monolithic mode; the cluster edition splits responsibilities into four daemons. Ingesters accept writes and buffer to local WAL, then flush Parquet files to object storage. Compactors take recently-flushed Parquet files and combine them into larger files for query efficiency. Queriers read Parquet from object storage (with a local cache) and serve SELECT traffic. Routers sit in front and dispatch writes to ingesters and reads to queriers. The whole thing depends on a Catalog database (Postgres) for metadata and on durable object storage (S3, MinIO, Garage) for the actual data. Three things commonly go wrong on first deploy: ingesters run out of local disk because the flush interval is set too high (the WAL grows faster than Parquet writes); the Catalog Postgres ends up on the same host as an ingester and competes for IOPS; and the object storage bucket lacks a lifecycle policy, so deleted retention data physically stays around for months.

How to verify

Confirm all four roles are running and report a recent heartbeat:

systemctl is-active influxdb3-ingester influxdb3-router influxdb3-querier influxdb3-compactor
journalctl -u influxdb3-ingester -n 20 --no-pager | grep -E 'persist|flush|wal'

Confirm the Catalog has registered ingesters and that they’re alive:

-- on the catalog Postgres
SELECT id, ingester_uuid, last_seen FROM ingesters ORDER BY last_seen DESC;

Spot-check write path end to end:

INFLUX_TOKEN=<token>
curl -fs -XPOST "https://router.metrics.internal:8086/api/v3/write_lp?db=demo&precision=s" \
  -H "Authorization: Bearer ${INFLUX_TOKEN}" \
  --data-binary "temp,room=kitchen value=21.4 $(date +%s)"

curl -fs -XPOST "https://router.metrics.internal:8086/api/v3/query_sql" \
  -H "Authorization: Bearer ${INFLUX_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{"db":"demo","q":"SELECT * FROM temp ORDER BY time DESC LIMIT 5"}'

If the write 200s but the query returns nothing for several minutes, your ingester flush interval is too long for the application’s tolerance — adjust INFLUXDB3_PERSIST_TIME_INTERVAL.

The fix

The installer below deploys a three-node InfluxDB 3.x cluster on AlmaLinux 9. Run it on each node after editing variables at the top — the role is selected by the ROLE variable: router, ingester, querier, compactor, or all-in-one for a smaller deployment that runs all four on one box. Catalog Postgres is assumed to live at CATALOG_HOST (deploy that separately — Patroni or a managed Postgres). Object storage targets S3_ENDPOINT with bucket S3_BUCKET. Token auth is initialized at the end.

#!/usr/bin/env bash
set -euo pipefail

### InfluxDB 3.x cluster installer for AlmaLinux 9
### Run on each node after editing variables below.

if [[ "$(id -u)" -ne 0 ]]; then
  echo "Run as root."
  exit 1
fi

# === EDIT PER NODE ===
ROLE="ingester"               # router | ingester | querier | compactor | all-in-one
NODE_NAME="influx-ing01"
NODE_IP="10.30.0.21"
CLUSTER_NETWORK="10.30.0.0/24"

# Catalog Postgres
CATALOG_HOST="10.30.0.10"
CATALOG_PORT="5432"
CATALOG_DB="influxdb3_catalog"
CATALOG_USER="influxdb3"
CATALOG_PASSWORD="CHANGE_ME_CATALOG"

# Object storage (S3-compatible)
S3_ENDPOINT="https://s3.internal:9000"
S3_REGION="local"
S3_BUCKET="influxdb3-data"
S3_ACCESS_KEY="CHANGE_ME_AK"
S3_SECRET_KEY="CHANGE_ME_SK"

# Auth
ADMIN_TOKEN_SEED="CHANGE_ME_ADMIN_SEED"
# =====================

echo
echo "========================================"
echo "InfluxDB 3.x node ${NODE_NAME} (${ROLE}) at ${NODE_IP}"
echo "========================================"
echo

echo "==> Base packages"
dnf -y update
dnf -y install epel-release
dnf -y install vim curl wget chrony fail2ban dnf-automatic \
  policycoreutils-python-utils lsof tcpdump bind-utils tar gzip \
  iproute net-tools jq socat firewalld postgresql

systemctl enable --now chronyd
systemctl enable --now firewalld
systemctl enable --now fail2ban

echo "==> SELinux enforcing"
sed -i 's/^SELINUX=.*/SELINUX=enforcing/' /etc/selinux/config
setenforce 1 || true

echo "==> Kernel/sysctl tuning"
cat > /etc/sysctl.d/99-influx.conf <<'SYSCTL'
vm.swappiness = 1
vm.overcommit_memory = 2
fs.file-max = 2097152
net.core.somaxconn = 4096
net.ipv4.tcp_max_syn_backlog = 8192
net.ipv4.tcp_syncookies = 1
net.ipv4.ip_local_port_range = 10240 65535
kernel.dmesg_restrict = 1
SYSCTL
sysctl --system

cat > /etc/security/limits.d/99-influxdb3.conf <<'LIMITS'
influxdb3 soft nofile 200000
influxdb3 hard nofile 200000
LIMITS

echo "==> SSH hardening"
sed -i 's|^[#[:space:]]*PermitRootLogin.*|PermitRootLogin prohibit-password|' /etc/ssh/sshd_config
sed -i 's|^[#[:space:]]*PasswordAuthentication.*|PasswordAuthentication no|' /etc/ssh/sshd_config
sshd -t && systemctl restart sshd

echo "==> firewalld"
firewall-cmd --permanent --new-zone=cluster || true
firewall-cmd --permanent --zone=cluster --add-source="${CLUSTER_NETWORK}"
firewall-cmd --permanent --zone=cluster --add-port=8086/tcp
firewall-cmd --permanent --zone=cluster --add-port=8082/tcp
firewall-cmd --permanent --zone=cluster --add-port=8083/tcp
firewall-cmd --reload

echo "==> Adding influxdata repo"
cat > /etc/yum.repos.d/influxdata.repo <<'REPO'
[influxdata]
name = InfluxData Repository - Stable
baseurl = https://repos.influxdata.com/stable/x86_64/main
enabled = 1
gpgcheck = 1
gpgkey = https://repos.influxdata.com/influxdata-archive_compat.key
REPO

dnf -y install influxdb3-core influxdb3-enterprise || dnf -y install influxdb3

echo "==> influxdb3 system user"
id -u influxdb3 >/dev/null 2>&1 || useradd --system --no-create-home --shell /sbin/nologin influxdb3
install -d -o influxdb3 -g influxdb3 -m 0750 /var/lib/influxdb3
install -d -o influxdb3 -g influxdb3 -m 0750 /etc/influxdb3
install -d -o influxdb3 -g influxdb3 -m 0750 /var/log/influxdb3

echo "==> /etc/influxdb3/influxdb3.toml"
cat > /etc/influxdb3/influxdb3.toml <<TOML
node-id = "${NODE_NAME}"
log-filter = "info"

[object-store]
provider = "s3"
endpoint = "${S3_ENDPOINT}"
region = "${S3_REGION}"
bucket = "${S3_BUCKET}"
access-key = "${S3_ACCESS_KEY}"
secret-key = "${S3_SECRET_KEY}"
allow-http = false

[catalog]
type = "postgres"
host = "${CATALOG_HOST}"
port = ${CATALOG_PORT}
database = "${CATALOG_DB}"
user = "${CATALOG_USER}"
password = "${CATALOG_PASSWORD}"
sslmode = "require"

[ingester]
wal-flush-interval = "10s"
persist-time-interval = "60s"
persist-row-limit = 1000000
wal-dir = "/var/lib/influxdb3/wal"

[querier]
exec-mem-pool-bytes = "8GB"
parquet-cache-mem-bytes = "4GB"
parquet-cache-disk-bytes = "100GB"
parquet-cache-dir = "/var/lib/influxdb3/cache"

[compactor]
compaction-partition-concurrency = 4
compaction-job-concurrency = 8

[auth]
mode = "token"
admin-token-seed = "${ADMIN_TOKEN_SEED}"
TOML
chown influxdb3:influxdb3 /etc/influxdb3/influxdb3.toml
chmod 600 /etc/influxdb3/influxdb3.toml

echo "==> Initializing object store + catalog on first run"
sudo -u influxdb3 influxdb3 init --config /etc/influxdb3/influxdb3.toml || true

echo "==> systemd unit for selected role"
SVC="influxdb3-${ROLE}"
cat > /etc/systemd/system/${SVC}.service <<EOF
[Unit]
Description=InfluxDB 3.x ${ROLE}
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
User=influxdb3
Group=influxdb3
EnvironmentFile=-/etc/default/influxdb3
ExecStart=/usr/bin/influxdb3 serve --mode ${ROLE} --config /etc/influxdb3/influxdb3.toml
Restart=on-failure
RestartSec=5
LimitNOFILE=200000
TimeoutStopSec=60

[Install]
WantedBy=multi-user.target
EOF

systemctl daemon-reload
systemctl enable --now ${SVC}

echo "==> Waiting for listener"
PORT=8086
for i in {1..60}; do
  if ss -lnt "sport = :${PORT}" | grep -q LISTEN; then break; fi
  sleep 2
done

if [[ "${ROLE}" == "router" || "${ROLE}" == "all-in-one" ]]; then
  echo "==> Creating sample database + retention bucket"
  sleep 5
  TOKEN=$(influxdb3 token create --admin --output token \
            --config /etc/influxdb3/influxdb3.toml || true)
  echo "${TOKEN}" > /root/influxdb3-admin.token
  chmod 600 /root/influxdb3-admin.token

  influxdb3 database create demo \
    --retention 30d \
    --config /etc/influxdb3/influxdb3.toml || true

  influxdb3 database create metrics_long \
    --retention 365d \
    --config /etc/influxdb3/influxdb3.toml || true
fi

echo
echo "========================================"
echo "DONE — ${NODE_NAME} (${ROLE})"
echo "========================================"
echo
echo "Listeners:"
ss -lntp | grep -E ':(8086|8082|8083)\b' || true
echo
echo "systemctl status ${SVC}:"
systemctl --no-pager status ${SVC} | head -20 || true

Make it executable and run on each node in order — Catalog Postgres first (separately), then ingesters, then compactor, then queriers, then router last:

chmod 700 /root/setup-influxdb3-node.sh
/root/setup-influxdb3-node.sh

Confirm the cluster is wired correctly:

INFLUX_TOKEN=$(cat /root/influxdb3-admin.token)

# Health from the router
curl -fs "https://router.metrics.internal:8086/health" \
  -H "Authorization: Bearer ${INFLUX_TOKEN}" | jq .

# Catalog sees all daemons
psql "host=${CATALOG_HOST} user=influxdb3 dbname=influxdb3_catalog sslmode=require" \
  -c "SELECT role, hostname, last_seen FROM nodes ORDER BY role;"

# Object storage bucket
aws --endpoint-url "${S3_ENDPOINT}" s3 ls "s3://${S3_BUCKET}/" --recursive | head -20

# Write 1k lines, then query
for i in {1..1000}; do
  echo "temp,room=kitchen value=$((RANDOM % 30 + 15)).0 $(date +%s%N)"
done | curl -fs -XPOST \
  "https://router.metrics.internal:8086/api/v3/write_lp?db=demo&precision=ns" \
  -H "Authorization: Bearer ${INFLUX_TOKEN}" \
  --data-binary @-

sleep 70  # let flush happen
curl -fs -XPOST "https://router.metrics.internal:8086/api/v3/query_sql" \
  -H "Authorization: Bearer ${INFLUX_TOKEN}" \
  -d '{"db":"demo","q":"SELECT count(*) FROM temp"}'

If the count after 70 seconds is below your insert count, raise ingester WAL flush cadence or add more ingesters. The cluster scales horizontally on ingesters and queriers independently; compactors are usually the next-cheapest scale-out lever.

Configure an object-storage lifecycle on the data bucket: 7-day glacier for Parquet older than the retention horizon, and a daily prefix-cleanup for tombstoned files — InfluxDB 3 marks files as superseded but does not delete them itself. Without lifecycle policies, object-storage bills creep up forever.

For self-hosted InfluxDB 3 clusters we deploy and operate — Catalog HA, ingester WAL alerting, lifecycle policies on the data bucket, Sev-1 coverage — see Cloud Compute under Managed Cloud Ops, or start with a scoping call on your current ingest profile.