2021-08-16 15:07:42 +08:00
|
|
|
[config var=PROFILE]
|
2021-05-18 14:54:48 +08:00
|
|
|
[config var=PACKAGE_PATH]
|
|
|
|
[config var=ONE_MORE_EMQX_PATH]
|
|
|
|
[config var=VSN]
|
2022-12-29 18:13:09 +08:00
|
|
|
[config var=OLD_VSN]
|
|
|
|
[config var=FROM_OTP_VSN]
|
|
|
|
[config var=TO_OTP_VSN]
|
2021-05-18 14:54:48 +08:00
|
|
|
|
|
|
|
[config shell_cmd=/bin/bash]
|
|
|
|
[config timeout=600000]
|
|
|
|
|
|
|
|
[shell http_server]
|
|
|
|
!cd http_server
|
|
|
|
!rebar3 shell
|
|
|
|
???Eshell
|
|
|
|
???>
|
|
|
|
!http_server:start().
|
|
|
|
?Start http_server listener on 8080 successfully.
|
|
|
|
?ok
|
|
|
|
?>
|
|
|
|
|
|
|
|
[shell emqx]
|
2022-12-29 18:13:09 +08:00
|
|
|
!OLD_VSN=$(echo $OLD_VSN | sed -r 's/[v|e]//g')
|
2021-05-18 14:54:48 +08:00
|
|
|
!cd $PACKAGE_PATH
|
2022-12-29 18:13:09 +08:00
|
|
|
!unzip -q -o $PROFILE-$(echo $OLD_VSN | sed -r 's/[v|e]//g')-otp${FROM_OTP_VSN}-ubuntu20.04-amd64.zip
|
2021-05-18 14:54:48 +08:00
|
|
|
?SH-PROMPT
|
|
|
|
|
|
|
|
!cd emqx
|
2022-12-29 18:13:09 +08:00
|
|
|
!export EMQX_LOG__LEVEL=debug
|
2021-08-16 15:07:42 +08:00
|
|
|
|
2021-05-18 14:54:48 +08:00
|
|
|
!./bin/emqx start
|
|
|
|
?EMQ X .* is started successfully!
|
|
|
|
?SH-PROMPT
|
|
|
|
|
|
|
|
[shell emqx2]
|
2022-12-29 18:13:09 +08:00
|
|
|
!OLD_VSN=$(echo $OLD_VSN | sed -r 's/[v|e]//g')
|
2021-05-18 14:54:48 +08:00
|
|
|
!cd $PACKAGE_PATH
|
2021-08-16 15:07:42 +08:00
|
|
|
!cp -f $ONE_MORE_EMQX_PATH/one_more_$(echo $PROFILE | sed 's/-/_/g').sh .
|
|
|
|
!./one_more_$(echo $PROFILE | sed 's/-/_/g').sh emqx2
|
2021-05-18 14:54:48 +08:00
|
|
|
?SH-PROMPT
|
|
|
|
!cd emqx2
|
|
|
|
|
2022-12-29 18:13:09 +08:00
|
|
|
!export EMQX_LOG__LEVEL=debug
|
2021-08-16 15:07:42 +08:00
|
|
|
|
2021-05-18 14:54:48 +08:00
|
|
|
!./bin/emqx start
|
2021-08-16 15:07:42 +08:00
|
|
|
?EMQ X .* is started successfully!
|
2021-05-18 14:54:48 +08:00
|
|
|
?SH-PROMPT
|
|
|
|
|
|
|
|
!./bin/emqx_ctl cluster join emqx@127.0.0.1
|
|
|
|
???Join the cluster successfully.
|
|
|
|
?SH-PROMPT
|
|
|
|
|
|
|
|
!./bin/emqx_ctl cluster status
|
|
|
|
"""???
|
|
|
|
Cluster status: #{running_nodes => ['emqx2@127.0.0.1','emqx@127.0.0.1'],
|
|
|
|
stopped_nodes => []}
|
|
|
|
"""
|
|
|
|
?SH-PROMPT
|
|
|
|
|
|
|
|
!./bin/emqx_ctl resources create 'web_hook' -i 'resource:691c29ba' -c '{"url": "http://127.0.0.1:8080/counter", "method": "POST"}'
|
|
|
|
?created
|
|
|
|
?SH-PROMPT
|
|
|
|
!./bin/emqx_ctl rules create 'SELECT * FROM "t/#"' '[{"name":"data_to_webserver", "params": {"$$resource": "resource:691c29ba"}}]'
|
|
|
|
?created
|
|
|
|
?SH-PROMPT
|
2022-12-29 18:13:09 +08:00
|
|
|
!sleep 5
|
|
|
|
?SH-PROMPT
|
2021-05-18 14:54:48 +08:00
|
|
|
|
|
|
|
[shell emqx]
|
|
|
|
!./bin/emqx_ctl resources list
|
|
|
|
?691c29ba
|
|
|
|
?SH-PROMPT
|
|
|
|
!./bin/emqx_ctl rules list
|
|
|
|
?691c29ba
|
|
|
|
?SH-PROMPT
|
2022-12-29 18:13:09 +08:00
|
|
|
!./bin/emqx_ctl broker metrics | grep "messages.publish"
|
|
|
|
???SH-PROMPT
|
2021-05-18 14:54:48 +08:00
|
|
|
|
|
|
|
[shell bench]
|
2022-12-29 18:13:09 +08:00
|
|
|
!emqtt_bench pub -c 10 -I 1000 -t t/%i -s 64 -L 300
|
|
|
|
# e.g. Start with 20 workers, addrs pool size: 1 and req interval: 200 ms
|
|
|
|
?^Start
|
2021-05-18 14:54:48 +08:00
|
|
|
|
|
|
|
[shell emqx]
|
2021-08-16 15:07:42 +08:00
|
|
|
!echo "" > log/emqx.log.1
|
|
|
|
?SH-PROMPT
|
|
|
|
|
2022-12-29 18:13:09 +08:00
|
|
|
!cp -f ../$PROFILE-$VSN-otp${TO_OTP_VSN}-ubuntu20.04-amd64.zip releases/
|
2021-08-16 15:07:42 +08:00
|
|
|
|
2022-12-29 18:13:09 +08:00
|
|
|
## upgrade to the new version
|
|
|
|
!./bin/emqx install $VSN
|
|
|
|
?Made release permanent: "$VSN"
|
|
|
|
?SH-PROMPT
|
|
|
|
|
|
|
|
!./bin/emqx versions |grep permanent
|
|
|
|
?(.*)$VSN
|
|
|
|
?SH-PROMPT
|
|
|
|
|
|
|
|
## downgrade to the old version
|
|
|
|
!./bin/emqx install $${OLD_VSN}
|
|
|
|
?Made release permanent:.*
|
|
|
|
?SH-PROMPT
|
|
|
|
|
|
|
|
!./bin/emqx versions |grep permanent | grep -qs "$${OLD_VSN}"
|
|
|
|
?SH-PROMPT:
|
|
|
|
!echo ==$$?==
|
|
|
|
?^==0==
|
|
|
|
?SH-PROMPT:
|
|
|
|
|
|
|
|
## again, upgrade to the new version
|
2021-05-18 14:54:48 +08:00
|
|
|
!./bin/emqx install $VSN
|
2021-08-16 15:07:42 +08:00
|
|
|
?Made release permanent: "$VSN"
|
2021-05-18 14:54:48 +08:00
|
|
|
?SH-PROMPT
|
2021-08-16 15:07:42 +08:00
|
|
|
|
|
|
|
!./bin/emqx versions |grep permanent
|
|
|
|
?(.*)$VSN
|
2021-05-18 14:54:48 +08:00
|
|
|
?SH-PROMPT
|
|
|
|
|
|
|
|
!./bin/emqx_ctl cluster status
|
|
|
|
"""???
|
|
|
|
Cluster status: #{running_nodes => ['emqx2@127.0.0.1','emqx@127.0.0.1'],
|
|
|
|
stopped_nodes => []}
|
|
|
|
"""
|
|
|
|
?SH-PROMPT
|
|
|
|
|
2022-12-29 18:13:09 +08:00
|
|
|
!./bin/emqx_ctl plugins list | grep --color=never emqx_management
|
2021-08-16 15:07:42 +08:00
|
|
|
?Plugin\(emqx_management.*active=true\)
|
|
|
|
?SH-PROMPT
|
|
|
|
|
2021-05-18 14:54:48 +08:00
|
|
|
[shell emqx2]
|
2021-08-16 15:07:42 +08:00
|
|
|
!echo "" > log/emqx.log.1
|
|
|
|
?SH-PROMPT
|
|
|
|
|
2022-12-29 18:13:09 +08:00
|
|
|
!cp -f ../$PROFILE-$VSN-otp${TO_OTP_VSN}-ubuntu20.04-amd64.zip releases/
|
2021-08-16 15:07:42 +08:00
|
|
|
|
2022-12-29 18:13:09 +08:00
|
|
|
## upgrade to the new version
|
|
|
|
!./bin/emqx install $VSN
|
|
|
|
?Made release permanent: "$VSN"
|
|
|
|
?SH-PROMPT
|
|
|
|
|
|
|
|
!./bin/emqx versions |grep permanent
|
|
|
|
?(.*)$VSN
|
|
|
|
?SH-PROMPT
|
|
|
|
|
|
|
|
## downgrade to the old version
|
|
|
|
!./bin/emqx install $${OLD_VSN}
|
|
|
|
?Made release permanent:.*
|
|
|
|
?SH-PROMPT
|
|
|
|
|
|
|
|
!./bin/emqx versions |grep permanent | grep -qs "$${OLD_VSN}"
|
|
|
|
?SH-PROMPT:
|
|
|
|
!echo ==$$?==
|
|
|
|
?^==0==
|
|
|
|
?SH-PROMPT:
|
|
|
|
|
|
|
|
## again, upgrade to the new version
|
2021-05-18 14:54:48 +08:00
|
|
|
!./bin/emqx install $VSN
|
2021-08-16 15:07:42 +08:00
|
|
|
?Made release permanent: "$VSN"
|
2021-05-18 14:54:48 +08:00
|
|
|
?SH-PROMPT
|
2021-08-16 15:07:42 +08:00
|
|
|
|
|
|
|
!./bin/emqx versions |grep permanent
|
|
|
|
?(.*)$VSN
|
2021-05-18 14:54:48 +08:00
|
|
|
?SH-PROMPT
|
|
|
|
|
|
|
|
!./bin/emqx_ctl cluster status
|
|
|
|
"""???
|
|
|
|
Cluster status: #{running_nodes => ['emqx2@127.0.0.1','emqx@127.0.0.1'],
|
|
|
|
stopped_nodes => []}
|
|
|
|
"""
|
|
|
|
?SH-PROMPT
|
|
|
|
|
2022-12-29 18:13:09 +08:00
|
|
|
!./bin/emqx_ctl plugins list | grep --color=never emqx_management
|
2021-08-16 15:07:42 +08:00
|
|
|
?Plugin\(emqx_management.*active=true\)
|
|
|
|
?SH-PROMPT
|
|
|
|
|
2021-05-18 14:54:48 +08:00
|
|
|
[shell bench]
|
2022-12-29 18:13:09 +08:00
|
|
|
?publish complete
|
|
|
|
?SH-PROMPT
|
2021-08-16 15:07:42 +08:00
|
|
|
!sleep 30
|
|
|
|
?SH-PROMPT
|
|
|
|
|
2022-12-29 18:13:09 +08:00
|
|
|
[shell emqx]
|
|
|
|
!./bin/emqx_ctl broker metrics | grep "messages.publish"
|
|
|
|
???SH-PROMPT
|
|
|
|
|
|
|
|
## We don't guarantee not to lose a single message!
|
|
|
|
## So even if we received 290~300 messages, we consider it as success
|
|
|
|
[shell bench]
|
|
|
|
!curl --user admin:public --silent --show-error http://localhost:8081/api/v4/rules | jq -M --raw-output ".data[0].metrics[] | select(.node==\"emqx@127.0.0.1\").matched"
|
|
|
|
?(29[0-9])|(300)
|
2021-08-16 15:07:42 +08:00
|
|
|
?SH-PROMPT
|
|
|
|
|
2022-12-29 18:13:09 +08:00
|
|
|
!curl --user admin:public --silent --show-error http://localhost:8081/api/v4/rules | jq -M --raw-output ".data[0].actions[0].metrics[] | select(.node==\"emqx@127.0.0.1\").success"
|
|
|
|
?(29[0-9])|(300)
|
2021-08-16 15:07:42 +08:00
|
|
|
?SH-PROMPT
|
|
|
|
|
2022-12-29 18:13:09 +08:00
|
|
|
## The /counter API is provided by .ci/fvt_test/http_server
|
2021-05-18 14:54:48 +08:00
|
|
|
!curl http://127.0.0.1:8080/counter
|
2022-12-29 18:13:09 +08:00
|
|
|
?\{"data":(29[0-9])|(300),"code":0\}
|
2021-05-18 14:54:48 +08:00
|
|
|
?SH-PROMPT
|
|
|
|
|
|
|
|
[shell emqx2]
|
|
|
|
!cat log/emqx.log.1 |grep -v 691c29ba |tail -n 100
|
|
|
|
-error
|
|
|
|
??SH-PROMPT:
|
|
|
|
|
|
|
|
!./bin/emqx stop
|
|
|
|
?ok
|
|
|
|
?SH-PROMPT:
|
|
|
|
|
|
|
|
!rm -rf $PACKAGE_PATH/emqx2
|
|
|
|
?SH-PROMPT:
|
|
|
|
|
|
|
|
[shell emqx]
|
|
|
|
!cat log/emqx.log.1 |grep -v 691c29ba |tail -n 100
|
|
|
|
-error
|
|
|
|
??SH-PROMPT:
|
|
|
|
|
|
|
|
!./bin/emqx stop
|
|
|
|
?ok
|
|
|
|
?SH-PROMPT:
|
|
|
|
|
|
|
|
!rm -rf $PACKAGE_PATH/emqx
|
|
|
|
?SH-PROMPT:
|
|
|
|
|
|
|
|
[shell http_server]
|
|
|
|
!http_server:stop().
|
|
|
|
?ok
|
|
|
|
?>
|
|
|
|
!halt(3).
|
|
|
|
?SH-PROMPT:
|
|
|
|
|
|
|
|
[cleanup]
|
|
|
|
!echo ==$$?==
|
|
|
|
?==0==
|