Running Edgex natively without consul #275
-
Hello, Currently I am trying to run Edgex V3.1 natively on an arm64 embedded board running Linux 4.19 without the use of consul. According to the documentation I should be able to utilise a native configuration file instead of using consul if I do not provide the -cp flag when running the Edgex commands. However, when I attempt to do this I get an error: level=INFO ts=2024-05-19T12:09:53.019418078Z app=core-common-config-bootstrapper source=config.go:718 msg="Using Configuration provider () from: http://:0 with base path of edgex/v3/core-common-config-bootstrapper" Is there a local configuration file outside of the configuration.yaml files under cmd/res that must be provided for it to be able to run locally without consul? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 7 replies
-
Have you tried the suggestion at https://github.com/orgs/edgexfoundry/discussions/243 ? |
Beta Was this translation helpful? Give feedback.
-
I have figured out how to run Edgex natively. Following the steps provided at https://docs.edgexfoundry.org/3.1/getting-started/native/Ch-BuildRunOnLinuxDistro/. The following export flags should be added prior to running.
The Core Common Config Bootstrapper does not need to be started as it purely serves the purpose of pushing the common configurations onto consul. Since we are running the service natively without consul this is not needed. Instead the configuration.yaml of the service should be opened and the appropriate parameters should be copied to the individual services to so they are able to read the correct configuration. E.G. the content under the app-services: sub header etc. Running the appropriate services and reading the logs will also tell you which configuration parameters are missing. Once all the correct parameters are inserted into the configuration.yaml file. The services can then be run without the -cp and -registry flags to operate natively. |
Beta Was this translation helpful? Give feedback.
-
@Yangsta911 could you please let me know where are this configurations changes targeted to ? export EDGEX_SECURITY_SECRET_STORE=false
export EDGEX_CONFIG_PROVIDER=none
export EDGEX_USE_REGISTRY=false I'm trying to run edgex natively from a directory like this mpunix@LIN-MP22QN1X:~/edgex-foundry/edgex-native-3.X$ ls
Makefile app-service-configurable-3.1.1 device-virtual-go-3.1.1 edgex-go-3.1.1 edgex-ui-go-3.1.0 ekuiper-1.14.0 tmp
mpunix@LIN-MP22QN1X:~/edgex-foundry/edgex-native-3.X$ cat Makefile
# Simple Makefile for easy execution of tasks
consul-up:
$ nohup consul agent -ui -bootstrap -server -client 127.0.0.1 -bind 127.0.0.1 -advertise 127.0.0.1 -data-dir=tmp/consul &
# This command forcefully kills consul, there is no information in edgex documentation on how to stop consul once we start it
consul-kill:
$ @ps aux | grep 'consul agent' | grep -v grep | awk '{print $$2}' | xargs kill -9
@echo : consul agent has stopped working.
start-core-metadata:
$ cd edgex-go-3.1.1/cmd/core-metadata/
$ nohup ./edgex-go-3.1.1/cmd/core-metadata/core-metadata -cp=consul.http://127.0.0.1:8500 -registry &
mpunix@LIN-MP22QN1X:~/edgex-foundry/edgex-native-3.X$ Could you please let me know where are the configurations ? Thanks |
Beta Was this translation helpful? Give feedback.
-
@Yangsta911 One more last question, If I need to run natively, I need to setup vault, because vault needs to be running in order for other services to run so do you have any idea on this have you tried doing it this way ? do you have any information on bringing up vault for edgex ? Thanks |
Beta Was this translation helpful? Give feedback.
-
@Yangsta911 Hello !, can we change the logging level ? I changed the following configuration : /edgex-go-3.1.1/cmd/core-data/res$ cat configuration.yaml
MaxEventSize: 25000 # Defines the maximum event size in kilobytes
Writable:
LogLevel: TRACE <---- Changed this
PersistData: true
Telemetry:
Metrics: # All service's metric names must be present in this list.
EventsPersisted: false
ReadingsPersisted: false
# Tags: # Contains the service level tags to be attached to all the service's metrics
## Gateway="my-iot-gateway" # Tag must be added here or via Consul Env Override can only change existing value, not added new ones.
Service:
Port: 59880
Host: "localhost"
StartupMsg: "Welcome, This is my custom Core Data Microservice" <--- changed this Then I did make data for building core-data & then did make build in this directory:
But the logging level and StartupMsg do not change, I'm I missing something ? your help will be much needed thanks |
Beta Was this translation helpful? Give feedback.
I have figured out how to run Edgex natively. Following the steps provided at https://docs.edgexfoundry.org/3.1/getting-started/native/Ch-BuildRunOnLinuxDistro/. The following export flags should be added prior to running.
The Core Common Config Bootstrapper does not need to be started as it purely serves the purpose of pushing the common configurations onto consul. Since we are running the service natively without consul this is not needed. Instead the configuration.yaml of the service should be opened and the appropriate parameters should be copied to the individual services to s…