Aman Singh
Aman Singh

Reputation: 75

InfluxDB 2.0 getting stopped after putting the service in systemd

I have installed Influxdb 2.0 and it was working fine until I put influxd service in systemd. Below is the content of influxdb.service

    [Unit]
    Description=InfluxDB 2.0 service file.
    Documentation=https://v2.docs.influxdata.com/v2.0/get-started/
    After=network-online.target

    [Service]
    User=influxdb
    Group=influxdb
    ExecStart=/usr/local/bin/influxd 
    Restart=on-failure

    [Install]
    WantedBy=multi-user.target

Upvotes: 1

Views: 1111

Answers (1)

Aman Singh
Aman Singh

Reputation: 75

The problem lies in the user with which influxdb is getting started. I was using a dedicated user "influxdb" to start the service. The user was created using below command :

# useradd -rs /bin/false influxdb

Using journalctl -u influxdb and influxd -h, I found that influxdb creates a boltdb inside home directory of the user from which service has been ran. Since /home/influxdb doesn't exists I was getting the error.

Solution options:

  • Change user in influxdb.service file to root.
  • Create home for "influxdb" user using mkhomedir_helper influxdb
  • Mention explicit location for boltDB using --bolt-path option

Upvotes: 1

Related Questions