|
|
@@ -1,7 +1,6 @@
|
|
|
[config var=PROFILE]
|
|
|
[config var=PACKAGE_PATH]
|
|
|
[config var=BENCH_PATH]
|
|
|
-[config var=ONE_MORE_EMQX_PATH]
|
|
|
[config var=VSN]
|
|
|
[config var=OLD_VSNS]
|
|
|
|
|
|
@@ -16,16 +15,17 @@
|
|
|
???Eshell
|
|
|
???>
|
|
|
!http_server:start().
|
|
|
- ?Start http_server listener on 8080 successfully.
|
|
|
+ ?Start http_server listener on 7077 successfully.
|
|
|
?ok
|
|
|
?>
|
|
|
|
|
|
[shell emqx1]
|
|
|
!cd $PACKAGE_PATH
|
|
|
!mkdir -p emqx1
|
|
|
- !tar -C emqx1 -zxf ${PROFILE}-$(echo $old_vsn | sed -r 's/[v|e]//g')-*-ubuntu20.04-amd64.tar.gz
|
|
|
+ !tar -C emqx -zxf ${PROFILE}-$(echo $old_vsn | sed -r 's/[v|e]//g')-*-ubuntu20.04-amd64.tar.gz
|
|
|
?SH-PROMPT
|
|
|
- !cd emqx1
|
|
|
+
|
|
|
+ !cd emqx
|
|
|
!export EMQX_NODE_NAME='emqx1@127.0.0.1'
|
|
|
!./bin/emqx start
|
|
|
?EMQX .* is started successfully!
|
|
|
@@ -33,15 +33,18 @@
|
|
|
|
|
|
[shell emqx2]
|
|
|
!cd $PACKAGE_PATH
|
|
|
- !tar -C emqx2 -zxf ${PROFILE}-$(echo $old_vsn | sed -r 's/[v|e]//g')-*-ubuntu20.04-amd64.tar.gz
|
|
|
!mkdir -p emqx2
|
|
|
+ !tar -C emqx -zxf ${PROFILE}-$(echo $old_vsn | sed -r 's/[v|e]//g')-*-ubuntu20.04-amd64.tar.gz
|
|
|
?SH-PROMPT
|
|
|
+
|
|
|
!cd emqx2
|
|
|
- !export EMQX_NODE_NAME='emqx2@127.0.0.1'
|
|
|
- !export EMQX_listeners__tcp__default__bind=2883
|
|
|
- !export EMQX_listeners__ssl__default__bind=9883
|
|
|
- !export EMQX_listeners__ws__default__bind=9083
|
|
|
- !export EMQX_listeners__wss__default__bind=9084
|
|
|
+ !export EMQX_NODE__NAME='emqx2@127.0.0.1'
|
|
|
+ !export EMQX_STATSD__SERVER='127.0.0.1:8124'
|
|
|
+ !export EMQX_LISTENERS__TCP__DEFAULT__BIND='0.0.0.0:1882'
|
|
|
+ !export EMQX_LISTENERS__SSL__DEFAULT__BIND='0.0.0.0:8882'
|
|
|
+ !export EMQX_LISTENERS__WS__DEFAULT__BIND='0.0.0.0:8082'
|
|
|
+ !export EMQX_LISTENERS__WSS__DEFAULT__BIND='0.0.0.0:8085'
|
|
|
+ !export EMQX_DASHBOARD__LISTENERS__HTTP__BIND='0.0.0.0:18082'
|
|
|
!./bin/emqx start
|
|
|
?EMQX .* is started successfully!
|
|
|
?SH-PROMPT
|
|
|
@@ -54,12 +57,24 @@
|
|
|
???["emqx1@127.0.0.1","emqx2@127.0.0.1"]
|
|
|
?SH-PROMPT
|
|
|
|
|
|
-# TODO find another way to create resource
|
|
|
-# !./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
|
|
|
+ ## create a webhook data bridge with id "my_webhook"
|
|
|
+ !curl --user admin:public --silent --show-error 'http://localhost:18083/api/v5/bridges' -X 'POST' -H 'Content-Type: application/json' --data-binary '{"name":"my_webhook","method":"post","url":"http://127.0.0.1:7077/counter","headers":{"content-type":"application/json"},"pool_size":4,"enable_pipelining":100,"connect_timeout":"5s","request_timeout":"5s","max_retries":3,"type":"webhook","ssl":{"enable":false,"verify":"verify_none"}}' | jq '.status'
|
|
|
+ ?connected
|
|
|
+ ?SH-PROMPT
|
|
|
+
|
|
|
+ ## create a rule that uses the webhook as action, the rule id = "rule_edsy"
|
|
|
+ !curl --user admin:public --silent --show-error 'http://localhost:18083/api/v5/rules' -X 'POST' -H 'Content-Type: application/json' --data-binary '{"id":"rule_edsy","sql":"SELECT\n *\nFROM\n \"t/#\"","actions":["webhook:my_webhook"]}' | jq '.id'
|
|
|
+ ?rule_edsy
|
|
|
+ ?SH-PROMPT
|
|
|
+
|
|
|
+[shell emqx1]
|
|
|
+ ## verify the bridges and rules are sync to the other node
|
|
|
+ !curl --user admin:public --silent --show-error 'http://localhost:18083/api/v5/bridges/webhook:my_webhook' -X 'GET' -H 'Content-Type: application/json' | jq '.name'
|
|
|
+ ?my_webhook
|
|
|
+ ?SH-PROMPT
|
|
|
+ !curl --user admin:public --silent --show-error 'http://localhost:18083/api/v5/rules/rule_edsy' -X 'GET' -H 'Content-Type: application/json' | jq '.id'
|
|
|
+ ?rule_edsy
|
|
|
+ ?SH-PROMPT
|
|
|
|
|
|
[shell bench]
|
|
|
!cd $BENCH_PATH
|
|
|
@@ -153,14 +168,18 @@
|
|
|
!sleep 5
|
|
|
?SH-PROMPT
|
|
|
|
|
|
-# TODO adjust rule metrics query API
|
|
|
-# !curl --user admin:public --silent --show-error http://localhost:18083/api/v5/rules | jq --raw-output ".[0].node_metrics[] | select(.node==\"emqx@127.0.0.1\") | .metrics.matched"
|
|
|
-# ?300
|
|
|
-# ?SH-PROMPT
|
|
|
+ !curl --user admin:public --silent --show-error http://localhost:18083/api/v5/rules | jq --raw-output ".[0].node_metrics[] | select(.node==\"emqx@127.0.0.1\") | .metrics.matched"
|
|
|
+ ?300
|
|
|
+ ?SH-PROMPT
|
|
|
+
|
|
|
+ !curl --user admin:public --silent --show-error http://localhost:18083/api/v5/rules | jq --raw-output ".[0].node_metrics[] | select(.node==\"emqx@127.0.0.1\") | .metrics.\"actions.success\""
|
|
|
+ ?\{"data":(29[0-9])|(300),"code":0\}
|
|
|
+ ?SH-PROMPT
|
|
|
|
|
|
-# !curl --user admin:public --silent --show-error http://localhost:18083/api/v5/rules | jq --raw-output ".[0].node_metrics[] | select(.node==\"emqx@127.0.0.1\") | .metrics.\"actions.success\""
|
|
|
-# ?\{"data":(29[0-9])|(300),"code":0\}
|
|
|
-# ?SH-PROMPT
|
|
|
+ ## The /counter API is provided by .ci/fvt_test/http_server
|
|
|
+ !curl http://127.0.0.1:7077/counter
|
|
|
+ ?\{"data":(29[0-9])|(300),"code":0\}
|
|
|
+ ?SH-PROMPT
|
|
|
|
|
|
[shell emqx2]
|
|
|
!cat log/emqx.log.1 |grep -v 691c29ba |tail -n 100
|