Merge branch 'master' into dev-feng
This commit is contained in:
commit
35bc96807e
14
CHANGELOG.md
14
CHANGELOG.md
|
@ -2,6 +2,20 @@
|
|||
emqttd ChangeLog
|
||||
==================
|
||||
|
||||
0.10.2-beta (2015-08-26)
|
||||
-------------------------
|
||||
|
||||
Improve: issue#257 - After the node name changed, the broker cannot restart for mnesia schema error.
|
||||
|
||||
|
||||
0.10.1-beta (2015-08-25)
|
||||
-------------------------
|
||||
|
||||
Bugfix: issue#259 - when clustered the emqttd_dashboard port is close, and the 'emqttd' application cannot stop normally.
|
||||
|
||||
Feature: issue#262 - Add 'http://host:8083/mqtt/status' Page for health check
|
||||
|
||||
|
||||
0.10.0-beta (2015-08-20)
|
||||
-------------------------
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit c87d9c4580e568917b4b026c809becf2cccd469e
|
||||
Subproject commit edbb6dc0862973137b056248efb5940d003d75be
|
|
@ -20,6 +20,7 @@ RUNNER_BASE_DIR={{runner_base_dir}}
|
|||
RUNNER_ETC_DIR={{runner_etc_dir}}
|
||||
RUNNER_LIB_DIR={{platform_lib_dir}}
|
||||
RUNNER_LOG_DIR={{runner_log_dir}}
|
||||
RUNNER_DATA_DIR=$RUNNER_BASE_DIR/data
|
||||
RUNNER_PLUGINS_DIR=$RUNNER_BASE_DIR/plugins
|
||||
|
||||
# Note the trailing slash on $PIPE_DIR/
|
||||
|
@ -72,6 +73,8 @@ if [ -z "$NAME_ARG" ]; then
|
|||
echo "vm.args needs to have either -name or -sname parameter."
|
||||
exit 1
|
||||
fi
|
||||
NAME_ARR=(${NAME_ARG// / })
|
||||
NODE_NAME=${NAME_ARR[1]}
|
||||
|
||||
# Extract the target cookie
|
||||
COOKIE_ARG=`grep '^\-setcookie' $RUNNER_ETC_DIR/vm.args`
|
||||
|
@ -264,9 +267,12 @@ case "$1" in
|
|||
BINDIR=$ROOTDIR/erts-$ERTS_VSN/bin
|
||||
EMU=beam
|
||||
PROGNAME=`echo $0 | sed 's/.*\///'`
|
||||
# Setup Mnesia Dir
|
||||
MNESIA_DIR="$RUNNER_DATA_DIR/mnesia/$NODE_NAME"
|
||||
CMD="$BINDIR/erlexec -boot $RUNNER_BASE_DIR/releases/$APP_VSN/$SCRIPT \
|
||||
-embedded -config $RUNNER_ETC_DIR/emqttd.config \
|
||||
-pa $RUNNER_LIB_DIR/basho-patches \
|
||||
-mnesia dir "\"${MNESIA_DIR}\"" \
|
||||
-args_file $RUNNER_ETC_DIR/vm.args -- ${1+"$@"}"
|
||||
export EMU
|
||||
export ROOTDIR
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
@echo off
|
||||
@setlocal
|
||||
@setlocal enabledelayedexpansion
|
||||
|
||||
@set node_name=emqttd
|
||||
|
||||
|
@ -69,7 +71,16 @@
|
|||
@goto :EOF
|
||||
|
||||
:console
|
||||
@start "%node_name% console" %werl% -boot "%node_boot_script%" -config "%sys_config%" -args_file "%vm_args%" -sname %node_name%
|
||||
set dest_path=%~dp0
|
||||
cd /d !dest_path!..\plugins
|
||||
set current_path=%cd%
|
||||
set plugins=
|
||||
for /d %%P in (*) do (
|
||||
set "plugins=!plugins!!current_path!\%%P\ebin "
|
||||
)
|
||||
cd /d %node_root%
|
||||
|
||||
@start "%node_name% console" %werl% -boot "%node_boot_script%" -config "%sys_config%" -args_file "%vm_args%" -sname %node_name% -pa %plugins%
|
||||
@goto :EOF
|
||||
|
||||
:query
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
@setlocal
|
||||
@echo off
|
||||
@setlocal enabledelayedexpansion
|
||||
|
||||
@rem Parse arguments. erlsrv.exe prepends erl arguments prior to first ++.
|
||||
@rem Other args are position dependent.
|
||||
|
@ -33,7 +35,15 @@
|
|||
@set vm_args="%node_root%\etc\vm.args"
|
||||
)
|
||||
|
||||
@%erl_exe% %erl_args% -boot %boot_file% -config %app_config% -args_file %vm_args%
|
||||
set dest_path=%~dp0
|
||||
cd /d !dest_path!..\plugins
|
||||
set current_path=%cd%
|
||||
set plugins=
|
||||
for /d %%P in (*) do (
|
||||
set "plugins=!plugins!!current_path!\%%P\ebin "
|
||||
)
|
||||
cd /d %node_root%
|
||||
@%erl_exe% %erl_args% -boot %boot_file% -config %app_config% -args_file %vm_args% -pa %plugins%
|
||||
|
||||
:set_trim
|
||||
@set %1=%2
|
||||
|
|
|
@ -6,11 +6,6 @@
|
|||
## Cookie for distributed erlang
|
||||
-setcookie emqttdsecretcookie
|
||||
|
||||
##-------------------------------------------------------------------------
|
||||
## Mnesia dir. NOTICE: quote the dir with '" "'
|
||||
##-------------------------------------------------------------------------
|
||||
-mnesia dir '"data/mnesia"'
|
||||
|
||||
##-------------------------------------------------------------------------
|
||||
## Flags
|
||||
##-------------------------------------------------------------------------
|
||||
|
|
|
@ -73,6 +73,7 @@
|
|||
{mkdir, "etc/"},
|
||||
{mkdir, "etc/ssl/"},
|
||||
{mkdir, "data/"},
|
||||
{mkdir, "data/mnesia"},
|
||||
{mkdir, "plugins/"},
|
||||
{copy, "files/erl", "\{\{erts_vsn\}\}/bin/erl"},
|
||||
{template, "files/nodetool", "\{\{erts_vsn\}\}/bin/nodetool"},
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{application, emqttd,
|
||||
[
|
||||
{description, "Erlang MQTT Broker"},
|
||||
{vsn, "0.10.1"},
|
||||
{vsn, "0.10.2"},
|
||||
{modules, []},
|
||||
{registered, []},
|
||||
{applications, [kernel,
|
||||
|
|
|
@ -39,6 +39,17 @@
|
|||
handle_request(Req) ->
|
||||
handle_request(Req:get(method), Req:get(path), Req).
|
||||
|
||||
handle_request('GET', "/mqtt/status", Req) ->
|
||||
{InternalStatus, _ProvidedStatus} = init:get_status(),
|
||||
AppStatus =
|
||||
case lists:keysearch(emqttd, 1, application:which_applications()) of
|
||||
false -> not_running;
|
||||
{value, _Ver} -> running
|
||||
end,
|
||||
Status = io_lib:format("Node ~s is ~s~nemqttd is ~s~n",
|
||||
[node(), InternalStatus, AppStatus]),
|
||||
Req:ok({"text/plain", iolist_to_binary(Status)});
|
||||
|
||||
%%------------------------------------------------------------------------------
|
||||
%% HTTP Publish API
|
||||
%%------------------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue