Skip to content

teenccu/edgex-go

 
 

Repository files navigation

Core-data with Influx DB

Please refer the documentation of https://github.com/edgexfoundry/edgex-go for any details/licencing of edgex-go

This fork adds the implemenation of Core-data with InfluxDB and keeps the Core-Metadata still using the redisDB. A Hybrid client is created which implements the metadata and core-data interface and re-uses the redis db implementation for core-metadata and adds influx db for core-data in the database implementation. All the core-data rest APIs are implemented and should work.

The reason of this implementation is due to some limitations of redisdb in memory consumption(being in memory database) when lots of datas pumped inside core-data.

To activate influx inside core data

  1. Clone the repository and build a local image of core-data with the current code
make ddata
  1. Put the following changes in the Edgex compose file.
  2. For Core-data service add the following environment variables Please note the HYBRID: "TRUE" flag actyually tells the core-data to create a hybrid client and if this flag is not there core-data will continue to use redis as per the existing implementation
INFLUXDB_URL: http://influxdb:8086
INFLUXDB_ORG: TestORG
INFLUXDB_BUCKET: Edgex
HYBRID: "TRUE"
  1. Use the local image normally tagged as
   image: edgexfoundry/core-data:0.0.0-dev
  1. Add the influx image inside the compose file
influxdb:
    image: influxdb:2.7.0-alpine
    hostname: edgex-influx
    container_name: edgex-influx   
    networks:
      edgex-network: null
    ports:
    - mode: ingress
      target: 8086
      published: "8086"
      protocol: tcp
    volumes:
    - type: volume
      source: influxVolume
      target: /var/lib/influxdb2
      volume: {}
  1. In the volume section add the influx volume
   influxVolume:
    name: edgex_influxVolume
  1. Apart from core-data APIs itself the influx UI or influx cli can be also used to query the data stored. The usename is 'admin'. In secured mode the redis password is used to secure the influx db as well. So the password can be recovered from secret store as explained inside the link https://docs.edgexfoundry.org/3.0/security/Ch-SecretStore/#:~:text=is%20true.-,Using%20the%20Vault%20CLI,-Execute%20a%20shell

    In unsecured mode the password is "admin1234".

Apache-2.0

About

EdgeX Core-data with Influx DB

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 94.7%
  • Shell 2.8%
  • Dockerfile 1.6%
  • Other 0.9%