The CLI emqx_ctl fails:
```
./bin/emqx_ctl status
Node not initialized?
Generated config file vm.*.args is not found for command 'ctl'
in config dir: /Users/liuxy/code/emqx50/_build/emqx/rel/emqx/-emqx_data_dir /Users/liuxy/code/emqx50/_build/emqx/rel/emqx/data --/configs
In case the file has been deleted while the node is running,
set environment variable 'EMQX_NODE__NAME' to continue
```
The main slow-down is the overheads of booting up beam with the
'start_clean' boot file (which loads all modules).
Prior to this change, beam is started multiple times in order to
resolve configuration values.
After this change:
* For boot commands such as 'start', 'console' and
'foreground', it starts beam twice:
- 1st is to check platform compatibility
- 2nd is to resolve all configs required for boot in a batch
* For non-boot commands, such as 'ctl' and 'ping', it does not
require to start beam for config resolution at all
Adds a check to `bin/emqx` to see if the OTP version being used has
support for `mnesia_hook`, which is required by Mria for using the
RLOG backend. If OTP is not compatible and the user tries to use
RLOG, a warning is printed during startup and the configuration falls
back to using the Mnesia backend.
some of the find_ functions are generated from the old rebar template
which will never be used since we:
1. always release erts
2. always generate sys.config
3. always generate vm.args
for remsh prefixed nodes, ekka pick a random port to listen on
instead of following the conventional port mapping rule:
ekka listens on 4370 for emqx or emqx0 and 4371 for emqx1 and so on
With the previous arguments, a fresh hidden node with the same name as
the expected running one was being started and commands were being run
there. This caused commands like `ekka_cluster:info()` to report
seemingly weird results.
OTP release handler only works with .tar.gz
as a result, we had to unpack .zip and re-pack .tar.gz
just to make OTP happy.
Now since we will be building .tar.gz packages
there is no need for this re-pack step anymore
* refine usage print
* deleted restart command, as it only works for daemon mode.
e.g. if EMQ X is started in 'foreground' mode the 'restart'
command will make it start in daemon mode
* some commands such as ertspath does not requre RPC
fix(bin_emqx): remove `vm_args` backup in `install`
The `install_upgrade.escript` depended on being able to retrieve the
`vm_args` argument from `init`, but that options has been removed
recently. Since this backup was unused, we also remove it here.
Also, the `cuttlefish` script reference is removed, since it is no longer
present in the release.
The `install_upgrade.escript` depended on being able to retrieve the
`vm_args` argument from `init`, but that options has been removed
recently. Since this backup was unused, we also remove it here.
Surprisingly enough, by doing small cirurgical changes in the existing
EMQX control scripts, we are able to get it running with Elixir and
with existing functionalities (`console`, `remote_console`, `start`,
`stop`, `ctl`, `foreground`, `eval`).
In order for us to reuse most of the functionalities implemented in
`bin/eqmx` also in the Elixir release script, common variable and
function definitions are extracted in separated bash files that can be
sourced by both Rebar and Elixir release scripts.
* fix: ./bin/emqx ping return pong
* chore: waiting longer for logger flush log to disk
* fix: change swagger page's limit from 100 to 1000
* chore: type wrong
* fix: sync log to disk by logger_disk_log_h:filesync
* feat(emqx_conf): move conf manager for emqx_machine to emqx_conf
* chore(emqx_conf): change emqx:get_config/2 to emqx_conf:get/2
* fix: common test failed
* fix: badmatch by typo wrong key
* fix(emqx_conf): get the wrong core nodes
* fix(emqx_conf): get core node's tnx_id not latest tnx_id
* fix: add ro_transation when copy conf file
* fix: delete debug info
* fix: change ekka_rlog to mria_rlog
* fix: remove cluster_rpc from emqx_machine.
* fix: don't call ekka:start/0 explicitly
* fix: ekka should be start in emqx_machine
prior to this cahnge emqx node shutdown is done by init:stop
which might have undesired stop order of the applications
in this change, emqx_machine_terminator is added to stop apps
in defined order and then terminate the node in infinite loop
prior to this fix the logger message (syslog) has the name and pid
missing.
with this change, the programe name, and its boot command is logged
to syslog, so the console boot is cleaner
* fix(hocon): fail on hocon command errors
call_hocon bash function respects exit code
* fix(bin/emax): get dist_port config from hocon
after config file refactoring (to hocon format) the grep pattern
no longer works
* fix(bin/emqx): set -o pipefail
* feat(bin/emqx): add a DEBUG option
nodetool has all lib paths set up correctly by reading the
persisted RELEASES file
calling hocon escript directly has two problems:
1. it may not be able to find the beams compiled
2. if we use ERL_LIBS, it may find the version after hot beam upgrade
previously we supports skipping config generation if USE_CUTTLEFISH
not set to true.
it has never been tested (at least not in automated tests)
now it's time to drop it.
Prioro to this change, ekka lib dir was added by inspecting
the ekka lib version in persisted RELEASES file.
However, this file may not be the true version if a hot
upgrade failed in the middle.
In this fix, it reads the per-version emqx.rel file
content to load lib paths.
For node name and cookie overriden from environment variable
the only way to find it from another shell is to inspect
the vm.args file.
For node boot commands, the vm.args file may not have been created
yet, so we need to inspect node name in emqx.conf