Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: save app's env when bootstrapping and reloading #9750

Merged
merged 7 commits into from Jan 14, 2023

Conversation

zhongwencool
Copy link
Member

@zhongwencool zhongwencool commented Jan 13, 2023

If we configure logger and prometheus in cluster-override.conf

log {
  file_handlers {
    default {
      burst_limit {
        enable = true
        max_count = 10000
        window_time = "1s"
      ...
    }
prometheus {
  enable = true
  interval = "151s"
  job_name = "${name}/instance/${name}~${host}"
  mnesia_collector = "enabled"
  push_gateway_server = "http://127.0.0.1:9091"
  vm_dist_collector = "enabled"
  vm_memory_collector = "enabled"
  vm_msacc_collector = "enabled"
  vm_statistics_collector = "enabled"
  vm_system_info_collector = "enabled"
}

These configurations will have no effect. This is because log is an environment variable for kernal applications.
*_collector are the environment variable for the prometheus application.

we need to save those two applications' env after init_load.

close #8895

@zhongwencool zhongwencool changed the title save app's env when bootstrapping and reloading fix: save app's env when bootstrapping and reloading Jan 13, 2023
@@ -463,7 +463,7 @@ fields("node") ->
)},
{"config_files",
sc(
list(string()),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when we config node.config_files = ["test"]

node {
  name = "emqx@127.0.0.1"
  cookie = "emqxsecretcookie"
  data_dir = "data"
  config_files = ["test"]
}

the config schema check will fail by:

exception throw: {emqx_conf_schema,[#{kind => validation_error,
                                      path => "node.config_files",
                                      reason =>
                                          #{expected_type => <<"[string()]">>},
                                      value => [<<"test">>]}]}
  in function  hocon_tconf:assert_no_error/2 (hocon_tconf.erl, line 1142)
  in call from hocon_tconf:map/4 (hocon_tconf.erl, line 295)
  in call from hocon_cli:get_values/3 (hocon_cli.erl, line 194)
  in call from hocon_cli:multi_get/2 (hocon_cli.erl, line 182)
  in call from escript:run/2 (escript.erl, line 750)
  in call from escript:start/1 (escript.erl, line 277)
  in call from init:start_em/1
  in call from init:do_boot/3

So we change the type to hocon:array(string()).

@zmstone zmstone merged commit 002f5db into emqx:master Jan 14, 2023
@zhongwencool zhongwencool deleted the bootstrap-app-env branch January 14, 2023 09:09
zmstone added a commit to zmstone/emqx that referenced this pull request Jan 16, 2023
zmstone added a commit to zmstone/emqx that referenced this pull request Jan 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants