This post is to troubleshoot the issues you are facing with InfluxDB while writing data using the methods mentioned in the below posts,
Please make sure all the below steps working fine in the order.
- InfluxDB should be up and running fine w/o any exception (in the console output).
- If this step itself fails, Please raise your question in StackOverFlow
- You should be able to access the admin interface of InfluxDB with this URL – http://[ipaddress]:8083
- Try to access this in the machine where JMeter is going to run.
- If this step fails, see if the port has been used already. or change that in InfluxDB config file.
[admin] enabled = true bind-address = ":8083" https-enabled = false https-certificate = "/etc/ssl/influxdb.pem"
- If you are not sure where to find the config file for InfluxDB, running the command ‘influxd config‘ which will show the default config values. Copy them and create a new .conf config file yourself.
- If you are using new conf file, restart InfluxDB with this command – influxd -config /etc/influxdb/influxdb.conf
This is very important as InfluxDB is a time-series DB. By default, it will show only the records where timestamp of the records < system timestamp.
- Add POSTMAN
- Update the URL as shown here – http://[ipaddress]:8086/write?db=[database]
Ex: http://10.11.12.13:8086/write?db=demo Note the port – it should be 8086 for writing the data. 8083 is for admin interface. - Lets try to send this record through postman testautomationguru,key=test count=1,duration=1
- testautomationguru – is the name of table/measurement which will be created at run time by InfluxDB if it is not present already.
- key – it is a tag for faster query
- count and duration – some fields with values
- HTTP Method should be POST
- Place the data under Body –> Raw section
- Click on ‘Send’
- You should be able to see the testautomationguru measurement & querying the measurement should show the series.
- Now run JMeter in non – gui mode. You should be seeing the measurements and data for the given DB.
- If it still does not work, Please check the JMeter.log and InfluxDB console for any Errors.
- For ex: My JMeter.log shows this info. Copy the text and try to place it in postman and try to post as you did above. There is a chance that some characters not escaped properly. yuo will know that in the HTTP response of the PostMan or share the log details with me.