coussej / node-opcua-logger

An OPCUA Client for logging data to InfluxDB! πŸ”Œ 🏭
https://www.factry.io
MIT License
180 stars 64 forks source link

Future development #question #64

Closed MoritzLaut closed 2 years ago

MoritzLaut commented 3 years ago

is this project still ongoing and are there any future plans e.g. Influx 2.0?

~Moritz

robberthofmanfm commented 3 years ago

Hello @MoritzLaut and @coussej

There is a telegraf plugin for OPC-UA now. It works with InfluxDBv2. See also https://github.com/influxdata/telegraf/blob/master/plugins/inputs/opcua/README.md https://docs.influxdata.com/influxdb/v2.0/write-data/no-code/use-telegraf/manual-config/

@coussej do you still see benefits of using node-opcua-logger as opposed to telegraf?

henjoe commented 3 years ago

To be honest, I've used telegraf opcua, but having so much troubles and issues. And I don't see if there is a data buffering on the side of telegraf when connection to influx is lost.

On my opinion, opcua logger is still the best tested application. πŸ’ͺ

I hope we can run multiple instances of this opcua logger on 1 computer, or atleast it has configuration for multiple opc server inputs and multiple influxdb output ☺️

stephb59 commented 3 years ago

I successfully runned 3 parallel opcua logger to a single influx db. I do not think this could be a problem to output to different db's. I used IOTstack (https://sensorsiot.github.io/). This is grafana, influx, and more already configured within docker.

henjoe commented 3 years ago

Hi @stephb59 how did you that? That was amazing. I never got lucked running atleast 2 insctance of opcua logger on my windows machine. Does it need to be run separately on a a docker? I am just using the opcualogger.exe for this. I hope you can help me.

stephb59 commented 3 years ago

I never tried with windows. I do prefer working on "the light side of the force" :-) My hardware is a small linux server. Linux always working more efficiently. I just do have several instances that are not on the docker side. Grafana and Influx are within docker. Several opcua logger instances are pushing data to influxdb.

henjoe commented 3 years ago

I actually want to implement it on Limux, however existing OS of our client is Windows :'(

But did you already tried running 3 instances of an opcua logger at the same linux machine?

stephb59 commented 3 years ago

On my small server i did some tests recording online opcua server with 5 instances

henjoe commented 3 years ago

@stephb59 is it via docker? (You've run 5 docker with opcua logger) Or you've just run it 1by1 on a command line?

There is no conflict on instance-uid?

coussej commented 3 years ago

Hello all,

henjoe commented 3 years ago

Hi @coussej never knew about this. Thanks a lot!

stephb59 commented 3 years ago

@henjoe On main os i run it in 5 different screen sessions with different path and configuration files. No conflict as instances are different pid. Docker containers are only there for influx and grafana.

henjoe commented 3 years ago

@stephb59 thanks men! As @coussej mentioned in his comment. :)

Again! Highly appreciated all of you! :)

henjoe commented 3 years ago

Hi @stephb59 and @coussej, One more thing. May I confirm that we can run multiple instances of opcua logger when it was run from a source? Instead of a prebuilt binary?

I am trying to run multiple instances from the pre built binary but it seems that only one is running.

Hoping for your confirmation. Thanks in advance! :)

stephb59 commented 3 years ago

@henjoe I ran from source in the past but suffered certificate problems that i was not able to solve. Running pre built binary solved that

henjoe commented 3 years ago

@stephb59 but how did you manage that each pre built binary has different config files? Do you just create a copy of opcua logger on a seperate folder and create a config file for each? That is actually what I am doing right now, but only 1 instance is working.

coussej commented 3 years ago

You can provide the path to the config file using environment variables, you can see which ones in the readme file. You can for example create a windows service from the same binary, but configure different parameters for each service. nssm has an easy way to do this for example.

stephb59 commented 3 years ago

In my linux case

node-opcua-logger1
β”œβ”€β”€ config.toml
β”œβ”€β”€ config.toml.old
β”œβ”€β”€ data
β”‚Β Β  β”œβ”€β”€ _error
β”‚Β Β  └── _queue
└── influx-opcua-logger_v2.0.0-alpha_linux-x64
node-opcua-logger2
β”œβ”€β”€ config.toml
β”œβ”€β”€ data
β”‚Β Β  β”œβ”€β”€ _error
β”‚Β Β  └── _queue
└── influx-opcua-logger_v2.0.0-alpha_linux-x64
node-opcua-logger3
β”œβ”€β”€ config.toml
β”œβ”€β”€ data
β”‚Β Β  β”œβ”€β”€ _error
β”‚Β Β  └── _queue
└── influx-opcua-logger_v2.0.0-alpha_linux-x64
node-opcua-logger4
β”œβ”€β”€ config.toml
β”œβ”€β”€ data
β”‚Β Β  β”œβ”€β”€ _error
β”‚Β Β  └── _queue
└── influx-opcua-logger_v2.0.0-alpha_linux-x64
henjoe commented 3 years ago

You can provide the path to the config file using environment variables, you can see which ones in the readme file. You can for example create a windows service from the same binary, but configure different parameters for each service. nssm has an easy way to do this for example.

Hi @coussej , I understand that I can use an environment variables for the config files. What I didn't know is how would I set other instance of opcualogger to use other config path using environment variables? Like for example if I use an environment variables foe opcualogger1, how would my opcualogger2 will use another environment variables? (with the same variable name of opcualogger1)

Is there a paraneter like running the opcualogger --config path?

henjoe commented 3 years ago

In my linux case

node-opcua-logger1
β”œβ”€β”€ config.toml
β”œβ”€β”€ config.toml.old
β”œβ”€β”€ data
β”‚Β Β  β”œβ”€β”€ _error
β”‚Β Β  └── _queue
└── influx-opcua-logger_v2.0.0-alpha_linux-x64
node-opcua-logger2
β”œβ”€β”€ config.toml
β”œβ”€β”€ data
β”‚Β Β  β”œβ”€β”€ _error
β”‚Β Β  └── _queue
└── influx-opcua-logger_v2.0.0-alpha_linux-x64
node-opcua-logger3
β”œβ”€β”€ config.toml
β”œβ”€β”€ data
β”‚Β Β  β”œβ”€β”€ _error
β”‚Β Β  └── _queue
└── influx-opcua-logger_v2.0.0-alpha_linux-x64
node-opcua-logger4
β”œβ”€β”€ config.toml
β”œβ”€β”€ data
β”‚Β Β  β”œβ”€β”€ _error
β”‚Β Β  └── _queue
└── influx-opcua-logger_v2.0.0-alpha_linux-x64

Hi @stephb59 have you tried this running simulteaneously, and sending their data into different influxdb databases? Like for example db1 has IP: 192.168.0.1:8086 and db2: 192.168.0.2:8086,

I am thinking that there would be some issue when using the same port of databases? But I am not sure here.

stephb59 commented 3 years ago

@henjoe There is no issue sending data to same port. Influx db like others db's can accept simultaneous connections. I did not try with different databases.

henjoe commented 3 years ago

@stephb59

I found the issue now. May testing machine is blocking the opcua program 🀷

I switch to another machine and I was succesfull running it simultaneously.

Again, thanks for your help! :)