In this article, we'll configure the SSL for InfluxDB service to manage the encrypted communication.
We need to follow the below steps to enable SSL for InfluxDB
InfluxDB setup & configuration
- We’ll create self-sign SSL certificates using the below commands
$ openssl genrsa -out `hostname -f`.key 2048
$ openssl req -new -sha256 -key `hostname -f`.key -out `hostname -f`.csr
$ openssl x509 -req -days 365 -in `hostname -f`.csr -signkey `hostname -f`.key -out
`hostname -f`.crt
2. Then we’ll update the influxDB configuration file (/etc/influxdb/influxdb.conf) by setting:
https-enabled to true
https-certificate to /etc/ssl/<hostname>.crt
https-private-key to /etc/ssl/<hostname>.key
3. And then we need to restart the InfluxDB service and
$ systemctl restart influxdb
4. We can run the below command to test the connection over SSL using influx utility
$ influx -ssl -unsafeSsl -host <domain_name>.com
Integration with DPM
1. Now we'll update the DPM timeseries-app.properties file with below content
# Example influx db url: http://influxhost:8500
db.url=https://influx:8086
db.name=<db>
db.user=<user>
db.password=<pass>
db.retentionPolicy=autogen
# Example influx app db url: http://influxhost:8500
dpm.app.db.url=https://influx:8086
dpm.app.db.name=<db>
dpm.app.db.user=<user>
dpm.app.db.password=<pass>
dpm.app.db.retentionPolicy=autogen
2. And then import the influx DB SSL certificate in DPM truststore using the below command and needs to restart the DPM service.
$ keytool -import -file <server.crt > -keystore <truststore> -alias influxdb