Influxdb3 systemd creation

I noticed (or at least could not find much info) on how to setup influxdb3 a systemd service on ubuntu 2024.04

so i thought i would at least write up what i did to get it setup after install of InfluxDB 3 Core, so that others might find it (and or correct/update it)

//move installed files
mkdir /usr/lib/influxdb3
copy -R ~/.influxdb/* /usr/lib/influxdb3/

//create the data directory
mkdir /var/lib/influxdb3/
chown -R influxdb:influxdb /var/lib/influxdb3/

//create the systemd file with your {node_id} and adjust ExecStart as required
touch /etc/systemd/system/influxdb3.service

[Unit]
Description=InfluxDB 3 Server
After=network-online.target

[Service]
Type=simple
User=influxdb
Group=influxdb
ExecStart=/usr/lib/influxdb3/influxdb3 serve --node-id=‘{node_id}’ --http-bind=‘0.0.0.0:8181’ --object-store=file --data-dir /var/lib/influxdb3/data
PIDFile=/var/lib/influxdb3/influxd.pid
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target

//reload the deamon
systemctl daemon-reload
systemctl start influxdb3.service

//set autostart
systemctl enable influxdb3.service

1 Like

Very nice, if you can put this in a GitHub gist, be helpful to link to it and find when anyone is searching on GitHub. Also be nice to have one for stopping the service.

Btw, we also have an open issue here, be great to have your input/comments on that @calvinstreeting Document how to manually setup systemd units for InfluxDB 3 Core and Enterprise · Issue #6396 · influxdata/docs-v2 · GitHub . Thanks!