Can't connect to influxdb databae

I got the sample Sinwave data to work in the tutorial and now setting up OH2 to work influxdb. I enabled the persistence binding, but in the OH2 log I see it is not connecting to it. Both OH2 and Influx are running on the same Ubuntu machine.

So should I not be using 127.0.0.1:8086 for a url?

This my influxdb.cfg file

# The database URL, e.g. http://127.0.0.1:8086 or https://127.0.0.1:8084
# Defaults to: http://127.0.0.1:8086
url=http://127.0.0.1:8086

# The name of the database user, e.g. openhab.
# Defaults to: openhab
user=openhab

# The password of the database user.
password=MYPASS

# The name of the database, e.g. openhab.
# Defaults to: openhab
db=openhab_db

The database is correctly named and shows this:

InfluxDB shell version: 1.2.0
> show databases
name: databases
name
----
_internal
openhab_db

But my log in OH is throwing this error:

2017-03-08 14:11:57.866 [ERROR] [.internal.InfluxDBPersistenceService] - database connection failed
retrofit.RetrofitError: 127.0.0.1.8086: Name or service not known

I was able to solve my own issue. Switching from 127.0.0.1 to localhost solved the problem.

1 Like