Vanilla install of Ubuntu and Influx won't start

I have a vanilla install of Ubuntu (via ESXi ) and am trying to install Influxdb. I have tried this multiple times and i cannot get it to start successfully? is anyone able to help pinpoint the problem?

I get this when i attempt to start it:

vmubuntu@vmubuntu-virtual-machine:~$ sudo systemctl start influxdb
[sudo] password for vmubuntu:

vmubuntu@vmubuntu-virtual-machine:~$ sudo systemctl status influxdb
● influxdb.service - InfluxDB is an open-source, distributed, time series database
Loaded: loaded (/lib/systemd/system/influxdb.service; enabled; vendor preset: enabled)
Active: inactive (dead) (Result: exit-code) since Sat 2018-03-24 09:16:20 GMT; 8s ago
Docs: InfluxDB OSS 2.6 Documentation
Process: 2316 ExecStart=/usr/bin/influxd -config /etc/influxdb/influxdb.conf $INFLUXD_OPTS (code=exited, status=1/FAILURE)
Main PID: 2316 (code=exited, status=1/FAILURE)

Mar 24 09:16:20 vmubuntu-virtual-machine systemd[1]: influxdb.service: Unit entered failed state.
Mar 24 09:16:20 vmubuntu-virtual-machine systemd[1]: influxdb.service: Failed with result ‘exit-code’.
Mar 24 09:16:20 vmubuntu-virtual-machine systemd[1]: influxdb.service: Service hold-off time over, scheduling restart.
Mar 24 09:16:20 vmubuntu-virtual-machine systemd[1]: Stopped InfluxDB is an open-source, distributed, time series database.
Mar 24 09:16:20 vmubuntu-virtual-machine systemd[1]: influxdb.service: Start request repeated too quickly.
Mar 24 09:16:20 vmubuntu-virtual-machine systemd[1]: Failed to start InfluxDB is an open-source, distributed, time series database.

vmubuntu@vmubuntu-virtual-machine:~$ influx
Failed to connect to http://localhost:8086: Get http://localhost:8086/ping: dial tcp 127.0.0.1:8086: getsockopt: connection refused
Please check your connection settings and ensure ‘influxd’ is running.
vmubuntu@vmubuntu-virtual-machine:~$

I have used sudo apt-get install influxdb to install and followed the curl update per the website.

I have tried reinstalling both influx and the entire vm multiple times but it does not seem to help?

We need more of the logs to diagnose what’s going wrong. journalctl -u influxdb, and share from influxdb start to when it dies.

I’m having the same problem though not on a VM
Vanilla Install on Lubuntu 16.04.1 LTS

I tried changing the logging to debug but still didn’t get any more useful info.

journalctrl -u influxdb.service

systemd[1]: Started InfluxDB is an open-source, distributed, time series database.
influxd[22985]: ts=2018-06-06T20:40:38.136604Z lvl=info msg="InfluxDB starting" log_id=08Xi7Pz0000 version=1.5.2 branch=1.5 commit=02d7d4f043b34ecb4e9b2dbec298c6f9450c2a32
influxd[22985]: ts=2018-06-06T20:40:38.136718Z lvl=info msg="Go runtime" log_id=08Xi7Pz0000 version=go1.9.2 maxprocs=4
systemd[1]: influxdb.service: Main process exited, code=exited, status=1/FAILURE
systemd[1]: influxdb.service: Unit entered failed state.
systemd[1]: influxdb.service: Failed with result 'exit-code'.
systemd[1]: influxdb.service: Service hold-off time over, scheduling restart.
systemd[1]: Stopped InfluxDB is an open-source, distributed, time series database.

This is a clean install from apt.

My sources.list includes the line

 deb https://repos.influxdata.com/ubuntu xenial stable

Try stopping influxd via systemctl stop influxdb and then run /usr/bin/influxd -config /etc/influxdb/influxdb.conf and see if you get any more info that way.

Best regards,
dg

Thanks that go me going,

The output game me more info and apparently there is a bad file in place.

2018-06-07T13:31:08.393429Z     info    InfluxDB starting       {"log_id": "08YbwzvG000", "version": "1.5.2", "branch": "1.5", "commit": "02d7d4f043b34ecb4e9b2dbec298c6f9450c2a32"}
2018-06-07T13:31:08.393548Z     info    Go runtime      {"log_id": "08YbwzvG000", "version": "go1.9.2", "maxprocs": 4}
run: create server: detected /var/lib/influxdb/meta/raft.db. To proceed, you'll need to either 1) downgrade to v0.11.x, export your metadata, upgrade to the current version again, and then import the metadata or 2) delete the file, which will effectively reset your database. For more assistance with the upgrade, see: https://docs.influxdata.com/influxdb/v0.12/administration/upgrading/

I deleted the file and it all works.

I guess someone should look into why this file existed in the first place from a clean install, and also if this error could be printed to the same journalctrl log to ease troubleshooting.

Just looked into this, @RedOranges. I was able to successfully install InfluxDB on a fresh instance of Lubuntu 16.04.1 using the install directions in the InfluxDB documentation, which adds an InfluxData repository with the latest packages for the TICK stack. Using this install method, there was no /var/lib/influxdb/meta/raft.db file present.

However, if you attempted to install InfluxDB before adding the InfluxData repo, the apt-get install command would have used the version from the Ubuntu repositories, InfluxDB v0.10.0. That version includes a raft.db file. If you then add the InfluxDB repo and run apt-get install influxdb, you will install the latest version (v1.5.2) over the old version and run into the error you encountered.

There have been breaking changes since v0.10.0, which is why it’s necessary to throw an error in this situation. If we attempted to automatically migrate a user, it might have an impact on their data, so we present the error and let the user decide how they want to proceed.

I thought I followed the instructions, maybe my first attempt failed to add the PPA properly and accidentally installed the default ubuntu version first, then on my second attempt to add the PPA it worked and installed the latest and that’s why i got in that situation.

I guess my minor gripe is that even in the case that a user does need to make a manual move due to breaking changes it wasn’t apparent in the standard ubuntu way of starting the service and getting the output.

After fixing the file exists issue, I’m still having a problem, running command line works, the service version still fails.

When I start using command line sudo /usr/bin/influxd -config /etc/influxdb/influxdb.conf I can run influx and it will connect successfully by default.

But if I kill the cmd line version and call sudo systemctl stop influxdb when I run influx it fails.

Failed to connect to http://localhost:8086: Get http://localhost:8086/ping: dial tcp 127.0.0.1:8086: getsockopt: connection refused
Please check your connection settings and ensure 'influxd' is running.

But the service seems to be alive in some way

● influxdb.service - InfluxDB is an open-source, distributed, time series database
   Loaded: loaded (/lib/systemd/system/influxdb.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2018-06-14 10:50:03 EDT; 3min 49s ago
     Docs: https://docs.influxdata.com/influxdb/
 Main PID: 26532 (influxd)
   CGroup: /system.slice/influxdb.service
           └─26532 /usr/bin/influxd -config /etc/influxdb/influxdb.conf

Jun 14 10:50:03 little systemd[1]: Started InfluxDB is an open-source, distributed, time series database.
Jun 14 10:50:03 little influxd[26532]: ts=2018-06-14T14:50:03.422803Z lvl=info msg="InfluxDB starting" log_id=08ghF37W000 version=1.5.2 branch=1.5 commit=02d7d4f043b34ecb4e9b2dbec298c6f9450c2a32
Jun 14 10:50:03 little influxd[26532]: ts=2018-06-14T14:50:03.422913Z lvl=info msg="Go runtime" log_id=08ghF37W000 version=go1.9.2 maxprocs=4
Jun 14 10:50:03 little influxd[26532]: ts=2018-06-14T14:50:03.525167Z lvl=info msg="Using data dir" log_id=08ghF37W000 service=store path=/var/lib/influxdb/data
Jun 14 10:50:03 little influxd[26532]: ts=2018-06-14T14:50:03.525354Z lvl=info msg="Open store (start)" log_id=08ghF37W000 service=store trace_id=08ghF3XG000 op_name=tsdb_open op_event=start

I got it to work:

  1. Complete removal of influxdb from apt
  2. Deleted the entire /var/lib/influxdb folder
  3. Installed a new copy using apt
1 Like

Just to follow-up … I believe that the problem is caused by running the process via the command line (via sudo) which creates the /var/lib/influx directory as root. when you then try to start it via systemctl, it is started as user influx, which does not have read/write permissions to files/directory owned by root.

Installing via apt, and starting the first time via systemctl should create the files with the influx owner, and subsequent starts via sudo will allow root to read/write the files.

hth,
dg