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
