I installed QuestDB 8.3.3 on a Raspberry Pi with Node-Red. Is there a way to write data over Node-Red to QuestDB?
QuestDB has a native Node.js library, but Node-Red is more comfortable and has visual feedback. I thought since QuestDB is compatible with Influx I could just use an Influx configuration for ingesting. I tried v1 InfluxDB Node and v1.8 Flux. For the v1 InfluxDB connection Node I get:
Error 404 “Not Found Error”
For the v1.8 InfluxDB I get:
"Error 401 Unauthorized"
In both Nodes I have the correct server, port, user and password. This is the config I am using:
Your screenshot is for the in
node. That will not work, as QuestDB is compatible with InfluxDB only for ingestion. For querying, you can configure a postgresql connector in NodeRed pointing to localhost:8812
.
As per ingestion, if you use an influx 1.x configuration, with defaults of localhost:9000
, database name qdb
, user admin
, and password quest
, you should see ingestion.
This example flow works just fine
[
{
"id": "9c52a5933925018f",
"type": "tab",
"label": "Flow 2",
"disabled": false,
"info": "",
"env": []
},
{
"id": "17bd4566.e842bb",
"type": "influxdb out",
"z": "9c52a5933925018f",
"influxdb": "eeb221fb.ab27f",
"name": "",
"measurement": "test",
"precision": "",
"retentionPolicy": "",
"database": "",
"retentionPolicyV18Flux": "",
"org": "",
"bucket": "",
"x": 580,
"y": 320,
"wires": []
},
{
"id": "be93bfeb.416c4",
"type": "function",
"z": "9c52a5933925018f",
"name": "single value",
"func": "msg.payload = Math.random()*10;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 410,
"y": 320,
"wires": [
[
"17bd4566.e842bb"
]
]
},
{
"id": "31f9f174.ce060e",
"type": "inject",
"z": "9c52a5933925018f",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": "",
"topic": "",
"payload": "",
"payloadType": "date",
"x": 260,
"y": 320,
"wires": [
[
"be93bfeb.416c4"
]
]
},
{
"id": "eeb221fb.ab27f",
"type": "influxdb",
"hostname": "localhost",
"port": "9000",
"protocol": "http",
"database": "qdb",
"name": "test",
"usetls": false,
"tls": "d50d0c9f.31e858",
"influxdbVersion": "1.x",
"url": "http://localhost:8086",
"timeout": "",
"rejectUnauthorized": true
},
{
"id": "d50d0c9f.31e858",
"type": "tls-config",
"name": "",
"cert": "",
"key": "",
"ca": "",
"certname": "",
"keyname": "",
"caname": "",
"servername": "",
"verifyservercert": false,
"alpnprotocol": ""
}
]