-
Notifications
You must be signed in to change notification settings - Fork 8
/
faq_en.json
230 lines (230 loc) · 28.2 KB
/
faq_en.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
[
{
"title": "",
"category": "",
"tag": [],
"content": ""
},
{
"title": "What's EMQ X?",
"category": "",
"tag": [],
"content": "EMQ X is an open-source, distributed MQTT messaging broker, it can support up to million level of concurrent MQTT connections. It can be used for connecting to any devices that support MQTT protocol, and it can also be used for delivering message from server side to client."
},
{
"title": "How many products in EMQ X?",
"category": "",
"tag": [],
"content": "EMQ X totally has [3 products.](https://www.emqx.io/products) Different products support different level of connections, features and services etc.\n\n- EMQ X Broker: EMQ X open source version, supports the popular IoT protocols, such as MQTT, CoAP and LwM2M. It supports 100k level concurrent MQTT connections.\n- EMQ X Enterprise: EMQ X enterprise version. It is based on the open source version, and adds data persistence (support Redis, MySQL, MongoDB or PostgreSQL), data bridge to Kafka, LoRaWAN support, EMQ X monitoring, Kubernetes deployment etc. It supports 1M level concurrent MQTT connections.\n- EMQ X Platform: EMQ X Platform version is based on the Enterprise version,and support 10M level concurrent MQTT connections. We provide consulting service for complex IoT platforms, such as cross data center solutions. All kinds of services building an IoT platform can be provided, such as consulting, training, architect design, customized development, platform implementation, testing and operation."
},
{
"title": "What's the major difference between EMQ X enterprise and broker?",
"category": "",
"tag": [],
"content": "EMQ X Enterprise (enterprise version) is based on Broker (open source version), it includes all of the features of open source version. Comparing to open source version, it has following difference:\n\n- Concurrent connection level: the stable concurrent connection level for open source version is 100k, while enterprise version is 1M.\n- Data persistence: Enterprise version supports to persist data to several kinds of databases, includes the popular relational database, such as MySQL, PostgreSQL; Memory database, such as Redis; Non-SQL DB, such as MongoDB.\n- Kafka bridge: Forward MQTT message to Kafka clusters through internal bridge plugins, application can consume Kafka message to implement the streaming data process.\n- RabbitMQ bridge: Support to forward MQTT message to RabbitMQ, application can consume RabbitMQ message to integrate with 3rd party system.\n- System monitoring (EMQ X Control Center)\n\n - EMQ X cluster monitor: Include statistics of connections, topics, message & sessions.\n\n - Erlang VM monitor: Erlang process, threads, memory, distributed database & distributed locks etc.\n\n - Host monitor: Measurements of CPU, memory, disk, network and operating system.\n- security: By configuration of TLS, DTLS connections and certifications to get higher secured connections."
},
{
"title": "How to use EMQ X?",
"category": "",
"tag": [],
"content": "EMQ X Broker is free and it can be download at [https://www.emqx.io/downloads#broker](https://www.emqx.io/downloads#enterprise#broker).\n\nEMQ X Enterprise can be downloaded and evaluated for free. You can download it from [https://www.emqx.io/downloads#enterprise](https://www.emqx.io/downloads#enterprise), and then apply trial license at [https://www.emqx.io/licenses#trial](https://www.emqx.io/licenses#trial).\n\nAlso you can use the EMQ X enterprise version through public cloud service.\n\n- [AWS](https://aws.amazon.com/marketplace/pp/B07N2ZFVLX?qid=1552872864456&)"
},
{
"title": "How to update EMQ X license?",
"category": "",
"tag": [],
"content": "You need to two steps:\n\n1. After clicking \"Download License\", browse to the \"license.zip\" file that you downloaded.\n\n2. Copy the two files(emqx.lic, emqx.key) in the zip file to the EMQX license directory.\n - If your installation package is a zip file, the licenses are under \"emqx/etc/\"; \n - For DEB/RPM package, the licenses are under \"/etc/emqx/\";\n - For Docker image, the licenses are under \"/opt/emqx/etc/\".\n\nAfter the copy is completed, the license needs to be reloaded from the command line to complete the update:\n\n```\nemqx_ctl license reload [license file path]\n```\n\nThe update commands for different installation modes:\n\n```\n## zip packages\n./bin/emqx_ctl license reload etc/emqx.lic\n\n## DEB/RPM\nemqx_ctl license reload /etc/emqx/emqx.lic\n\n## Docker\ndocker exec -it emqx-ee emqx_ctl license reload /opt/emqx/etc/emqx.lic\n```"
},
{
"title": "Does EMQ X provide consulting service?",
"category": "",
"tag": [],
"content": "Yes. We have rich experience at consulting of building IoT platforms, include practice of helping Internet companies and carriers to build IoT platform that supports 10M level concurrent connections. We can help by customizing solutions for creating load-balancing, clustering, security policies, data storage and analytics, and make the solution can satisfy future business evolvement."
},
{
"title": "What's EMQ X suggested OS?",
"category": "",
"tag": [],
"content": "EMQ X supports deployment on at Linux, Windows, MacOS, ARM system, and suggest to deploy product environment at issued Linux version, such as CentOS, Ubuntu and Debian."
},
{
"title": "Can EMQ X support customized protocols? How to implement?",
"category": "",
"tag": [],
"content": "TODO..."
},
{
"title": "How to estimate resource usage of EMQ X?",
"category": "",
"tag": [],
"content": "Following factors will have an impact on EMQ X resource consumption, mainly on CPU and memory usage.\n\n- Connection number: EMQ X creates 2 Erlang process for every MQTT connection, and every Erlang process consumes some resource. The more connections, the more resource is required.\n\n- Average throughput: Throughput means (pub message number + sub message number) processed by EMQ X per second. With higher throughput value, more resource will be used for handling route and message delivery in EMQ X.\n\n- Payload size: With bigger size of payload, more memory and CPU are required for message cache and processing.\n\n- Topic number: With more topics, the route table in EMQ X will increase, and more resource is required.\n\n- QoS:With higher message QoS level, more resource will be used for message handling.\n\nIf client devices connect to EMQ X through TLS, more CPU resource is required for encryption and decryption. Our suggested solution is to add a load balancer before EMQ X nodes, the TLS is offloaded at load balance node, connections between load balancer and backend EMQ X nodes use plain TCP connections.\n\nYou can use our online calculation tool [TODO](https://www.emqx.io) to estimate the resource consumption."
},
{
"title": "What's EMQ X authentication and it's use scenario?",
"category": "",
"tag": [],
"content": "When a client connects to EMQ X server, EMQ X can authenticate it in different ways. It includes following 3 approaches,\n\n- Username and password: Per every MQTT client connection, which can be configured at the server, only by passing with correct username and password, the client connection can be established.\n\n- ClientID: Every MQTT client will have a unique ClientID, and a list of ClientIds can be configured in server, and only ClientIds in the list can be authenticated successfully.\n\n- Anonymous: Allows anonymous access.\n\nBesides using the configuration file (to configure authentication), EMQ X can also use database and integration with external applications, such as MySQL, PostgreSQL, Redis, MongoDB, HTTP and LDAP."
},
{
"title": "Can I capture device online and offline events? How to use it?",
"category": "",
"tag": [],
"content": "EMQ X supports to capture device online and offline events through below 3 approaches,\n\n- Web Hook\n\n- Subscribe related $SYS topics\n\n - $SYS/brokers/${node}/clients/${clientid}/connected\n - $SYS/brokers/${node}/clients/${clientid}/disconnected\n\n- Directly save events into database\n\n The final approach is only supported in enterprise version, and supported database includes Redis, MySQL, PostgreSQL, MongoDB and Cassandra. User can configure database, client.connected and client.disconnected events in the configuration file. When a device is online or offline, the information will be saved into database."
},
{
"title": "What's Hook? What's the use scenario?",
"category": "",
"tag": [],
"content": "Hook is an interface provided by EMQ X, which will be triggered when a connection, session or message is established/delivered. EMQ X provides hooks listed in below, which allows user to save these triggered events to database, and user can conveniently query all kinds of information, such as client connect, disconnect. \n\n- client.connected: client online\n- client.disconnected: client offline\n- client.subscribe: client subscribes topics\n- client.unsubscribe: client unsubscribes topics\n- session.created: session was created\n- session.resumed: session is resumed\n- session.subscribed: after session subscribe topic\n- session.unsubscribed: after session unsubscribe topic\n- session.terminated: session is terminated\n- message.publish: MQTT message is publish\n- message.delivered: MQTT message is delivered\n- message.acked: MQTT message is acknowledged\n- message.dropped: MQTT message is dropped"
},
{
"title": "What's mqueue? How to use mqueue in EMQ X?",
"category": "",
"tag": [],
"content": "mqueue is message queue stored in session during the message publish process. If the clean session is set false in mqtt connect packet, then EMQ X would maintain session for the client which conneced to EMQ X even the client has been disconnected from EMQ X. Then the session would receive messages from the subscribed topic and store these messages into mqueue. And when the client online again, these messages would be delivered to client instantly. Because of low priority of qos 0 message in mqtt protocol, EMQ X do not cache qos 0 message into mqueue. However, the mqueue could be configured in `emqx.conf`, if this entry has been configured as `zone.$name.mqueue_store_qos0 = true`, the qos0 mesage would been stored into mqueue, too. mqueue has limit size, it would be configured with `zone.external.max_mqueue_len` to determine the number of messages cached into mqueue. Notice that these messages are stored in memory, so please do not set the mqueue length to 0 (0 means there is no limit for mqueue), otherwise it would risk running out of memory."
},
{
"title": "What's WebSocket? When to use Websocket to connect EMQ X?",
"category": "",
"tag": [],
"content": "WebSocket is a full-duplex communication protocol based on HTTP protocol, user can realize dual direction communications between browser and server. Through Websocket, server can push message to web browser. EMQ X provides support of WebSocket, user can realize pub to topics and sub to topic from browsers."
},
{
"title": "I want to control topics can be used for specific clients, how to configure it in EMQ X?",
"category": "",
"tag": [],
"content": "EMQ X can constrain clients used topics to realize device access controls. To use this feature, ACL (Access Control List) should be enabled, disable anonymous access and set `acl_nomatch` to 'deny' (For the convenience of debugging, the last 2 options are enabled by default, and please close them).\n\nACL can be configured in configuration file, or backend databases. Below is one of sample line for ACL control file, the meaning is user 'dashboard' can subscribe '$SYS/#' topic. ACL configuration in backend databases is similar, refer to EMQ X document for more detailed configurations.\n\n```\n{allow, {user, \"dashboard\"}, subscribe, [\"$SYS/#\"]}.\n```"
},
{
"title": "What's shared subscription, and it's use scenario?",
"category": "",
"tag": [],
"content": "Shared subscription is a new feature of MQTT 5.0 specification. Before the feature was introduced in MQTT 5.0 specification, EMQ 2.x already supported the feature as non-standard MQTT protocol. In general, all of subscribers will receive ALL message for the subscribed topics, while clients that subscribe the same topic will receive the message with round-robin way, so one message will not be delivered to different clients. By this way, the subscribers can be load-balanced.\n\nShared subscription is very useful in data collection and centralized data analysis applications. In such cases, number of data producers is much larger than consumers, and one message is ONLY need to be consumed by once."
},
{
"title": "Can EMQ X support traffic control?",
"category": "",
"tag": [],
"content": "Yes. Currently EMQ X supports to control connection rate and message publish rate. Refer to below for sample configuration.\n\n```\n## Value: Number\nlistener.tcp.external.max_conn_rate = 1000\n\n## Value: rate,burst\nlistener.tcp.external.rate_limit = 1024,4096\n```"
},
{
"title": "What is off-line message?",
"category": "",
"tag": [],
"content": "Usually an MQTT client receives messages only when it is connected to an EMQ X, if this client is off-line, it will not receive messages. But if a client has a fixed ClientID, and it connects to the broker with clean_seesion = false, the broker will store particular message for it when it is off-line, if the Pub/Sub is done at certain QoS level (broker configuration). These messages will be delivered when this client is reconnected. \n\nOff-line message is useful when the connection is not stable, or the application has special requirements on QoS."
},
{
"title": "What is Subscription by Broker? And its use scenario?",
"category": "",
"tag": [],
"content": "Usually an MQTT client has to subscribe to the topics expressly by itself, if it wants to receive the messages under these topics. Subscription by Broker means that the broker can subscribe to particular topics for a client without client's interaction. The relation of such clients and their topics to be subscribed to is stored at broker side.\n\nUsing of Subscription by Broker can ease the management of massive client, and save the computational resource and bandwidth on device.\n\n* Note: Currently this feature is available in the EMQ X Enterprise edition. *"
},
{
"title": "How does the EMQ X achieve high concurrency and high availability?",
"category": "",
"tag": [],
"content": "High concurrency and availability are design goals of EMQ X. To achieve these goals, several technologies are applied:\n\n- Making maximum use of the soft-realtime, high concurrent and fault-tolerant Erlang/OTP platform;\n- Full asynchronous architecture;\n- Layered design of connection, session, route and cluster;\n- Separated messaging and control panel;\n\nWith the well design and implementation, a single EMQ X cluster can handle million level connections.\n\nEMQ X supports clustering. The EMQ X performance can be scale-out with the increased number of nodes in cluster, and the MQTT service will not be interrupted when a single node is down."
},
{
"title": "Can EMQ X store messages to database?",
"category": "",
"tag": [],
"content": "The EMQ X Enterprise edition supports data persistence. Supported databases are:\n\n- Redis\n- MongoDB\n- MySQL\n- PostgreSQL\n- Cassandra"
},
{
"title": "Can I disconnect an MQTT connection from EMQ X server?",
"category": "",
"tag": [],
"content": "Yes. You can do it by invoking REST API provied by EMQ X, but the implementation is different in EMQ X 2.x and 3.x: \n\n- EMQ X customized protocol in 2.x versions.\n- Follow the process defined in MQTT 5.0 protocol after version 3.0. \n\nRefer to below for API invocation: \n\n```html\nHTTP Method: DELETE \nURL:api/[v2|v3]/clients/{clientid} \n<!--Please notice the 2nd section in URL, and use the correct version number according to your EMQ X version. -->\n\nReturned response: \n{\n \"code\": 0,\n \"result\": []\n}\n```"
},
{
"title": "Can EMQ X forward messages to Kafka?",
"category": "",
"tag": [],
"content": "The EMQ X Enterprise edition integrates a Kafka bridge, it can bridge data to Kafka."
},
{
"title": "I use Kafka bridge in EMQ X enterprise, when will the MQTT Ack packet sent back to client? Is the time when message arriving EMQ X or after getting Ack message from Kafka?",
"category": "",
"tag": [],
"content": "It's up to Kafka bridge configuration, the configuration file is at `/etc/emqx/plugins/emqx_bridge_kafka.conf`\n\n```bash\n## Pick a partition producer and sync/async.\nbridge.kafka.produce = sync\n```\n\n- Sync: MQTT Ack packet will be sent back to client after receiving Ack from Kafka.\n- Async: MQTT Ack packet will be sent back to client right after EMQ X receiving the message, and EMQ X will not wait the Ack returned from Kafka.\n\nIf the backend Kafka server is not available, then the message will be accumulated in EMQ X broker.\n\n- The message will be cached in memory before EMQ X 2.4.3 version, if the memeory is exhausted, then the EMQ X server will be down. \n- The message will be cached in disk after EMQ X 2.4.3 version, message will probably lost if the disk is full. \n\nSo we suggest you to closely monitor Kafka server, and recover Kafka service as soon as possible when it has any questions."
},
{
"title": "Does EMQ X support cluster auto discovery? What clustering methods are supported?",
"category": "",
"tag": [],
"content": "EMQ X supports cluster auto discovery. EMQ X clustering can be done manually or automatically.\n\nCurrently supported clustering methods:\n\n- Manual clustering\n- Static clustering\n- Auto clustering using IP multi-cast\n- Auto clustering using DNS\n- Auto clustering using ETCD\n- Auto clustering using K8S"
},
{
"title": "Can I forward MQTT messages EMQ X to other MQTT broker, like RabbitMQ?",
"category": "",
"tag": [],
"content": "EMQ X support forward messages to other MQTT broker. Using MQTT bridge, EMQ X can forward messages of interested topics to other broker."
},
{
"title": "Can I forward messages from EMQ X to MQTT services hosted on public cloud?",
"category": "",
"tag": [],
"content": "EMQ X can forward messages to IoT Hub hosted on public cloud, this is a feature of EMQ X bridge."
},
{
"title": "Can other MQTT broker (for example Mosquitto) forward messages to EQM X?",
"category": "",
"tag": [],
"content": "EMQ X can receive messages from other broker, but it depends also on the implementation of other brokers, Mosquitto can forward messages to EMQ X, please refer to [TODO](https://www.emqx.io)。"
},
{
"title": "What is the usage of system topics? What system topics are available?",
"category": "",
"tag": [],
"content": "The system topics have a prefix of `$SYS/`. Periodically, EMQ X publishes system messages to system topics, these messages include system status, statistics of MQTT, client's online/offline status and so on.\n\nHere are some examples of system topics, for a complete list of system topic please refer to EMQ X document:\n\n- $SYS/brokers: List of nodes in cluster\n- $SYS/brokers/${node}/clients/${clientid}/connected: this message is published when a client connects\n- $SYS/broker/${node}/stats/connections/count: Number of connections on a node\n- $SYS/broker/${node}/stats/sessions/count: Number of sessions on a node"
},
{
"title": "What should I do if I want trace the subscription and publish of some particular message?",
"category": "",
"tag": [],
"content": "EMQ X support the tracing of messages from particular client or under particular topic. You can use the command line tool `emqx_ctl` for tracing. The example below shows how to trace messages under 'topic' and save the result in 'trace_topic.log'. For more details, please refer to EMQ X document.\n\n```\n./bin/emqx_ctl trace topic \"topic\" \"trace_topic.log\"\n```"
},
{
"title": "When I was executing stress test, the connection number and throughput are lower than expected. How can I tune the system to make full use of it?",
"category": "",
"tag": [],
"content": "When executing a stress test, besides ensuring the necessary hardware resource, it is also necessary to tune the OS and the Erlang VM to make the maximum use of the resource. The most common tuning is to modify the global limitation of file handles, the user limitation of file handles, the TCP backlog and buffer, the limitation fo process number of Erlang VM and so on. You will also need to tune the client machine to ensure it has the ability and resource to handle all the subs and pubs.\n\nDifferent use scenario requires diferent tuning。 In the EQM X document there is a chapter about tuning the system for general purpose. [TODO](https://www.emqx.io)"
},
{
"title": "My connections number is small, do I still need to deploy multiple nodes in production?",
"category": "",
"tag": [],
"content": "Even when the connction number is small, or message rate is low, it is still very meaningfulto deploy a cluster with multiple nodes in production. A cluster improves the availability of system, when a single node is down, the rest nodes in cluster ensures the service is not interrupted."
},
{
"title": "Does EMQ X support encrypted connection? What is the recommended deployment?",
"category": "",
"tag": [],
"content": "EMQ X Support SSL/TLS. In production, we recommend to terminate the TLS connection by Load Balancer. By this way, the connection between device and server(load balancer) use secured connection, and connection between load balancer and EMQ X nodes use general TCP connection."
},
{
"title": "How to troubleshoot if EMQ X can't start after installation?",
"category": "",
"tag": [],
"content": "Execute `$ emqx console` to view the output.\n\n- `logger` command is missing\n\n ```\n $ emqx console\n Exec: /usr/lib/emqx/erts-10.3.5.1/bin/erlexec -boot /usr/lib/emqx/releases/v3.2.1/emqx -mode embedded -boot_var ERTS_LIB_DIR /usr/lib/emqx/erts-10.3.5.1/../lib -mnesia dir \"/var/lib/emqx/mnesia/[email protected]\" -config /var/lib/emqx/configs/app.2019.07.23.03.07.32.config -args_file /var/lib/emqx/configs/vm.2019.07.23.03.07.32.args -vm_args /var/lib/emqx/configs/vm.2019.07.23.03.07.32.args -- console\n Root: /usr/lib/emqx\n /usr/lib/emqx\n /usr/bin/emqx: line 510: logger: command not found\n ```\n\n **Solution:**\n\n - `Centos/Redhat`\n\n ```\n $ yum install rsyslog\n ```\n\n - `Ubuntu/Debian`\n\n ```\n $ apt-get install bsdutils\n ```\n\n- `Missssl` is missing\n\n```\n $ emqx console\n Exec: /emqx/erts-10.3/bin/erlexec -boot /emqx/releases/v3.2.1/emqx -mode embedded -boot_var ERTS_LIB_DIR /emqx/erts-10.3/../lib -mnesia dir \"/emqx/data/mnesia/[email protected]\" -config /emqx/data/configs/app.2019.07.23.03.34.43.config -args_file /emqx/data/configs/vm.2019.07.23.03.34.43.args -vm_args /emqx/data/configs/vm.2019.07.23.03.34.43.args -- console\n Root: /emqx\n /emqx\n Erlang/OTP 21 [erts-10.3] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:32] [hipe]\n \n {\"Kernel pid terminated\",application_controller,\"{application_start_failure,kernel,{{shutdown,{failed_to_start_child,kernel_safe_sup,{on_load_function_failed,crypto}}},{kernel,start,[normal,[]]}}}\"}\n Kernel pid terminated (application_controller) ({application_start_failure,kernel,{{shutdown,{failed_to_start_child,kernel_safe_sup,{on_load_function_failed,crypto}}},{kernel,start,[normal,[]]}}})\n \n Crash dump is being written to: log/crash.dump...done\n```\n\n**Solution:** Install openssl above version 1.1.1\n\n- `License` file is missing\n\n```\n $ emqx console\n Exec: /usr/lib/emqx/erts-10.3.5.1/bin/erlexec -boot /usr/lib/emqx/releases/v3.2.1/emqx -mode embedded -boot_var ERTS_LIB_DIR /usr/lib/emqx/erts-10.3.5.1/../lib -mnesia dir \"/var/lib/emqx/mnesia/[email protected]\" -config /var/lib/emqx/configs/app.2019.07.23.05.52.46.config -args_file /var/lib/emqx/configs/vm.2019.07.23.05.52.46.args -vm_args /var/lib/emqx/configs/vm.2019.07.23.05.52.46.args -- console\n Root: /usr/lib/emqx\n /usr/lib/emqx\n Erlang/OTP 21 [erts-10.3.5.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:32] [hipe]\n \n Starting emqx on node [email protected]\n Start http:management listener on 8080 successfully.\n Start http:dashboard listener on 18083 successfully.\n Start mqtt:tcp listener on 127.0.0.1:11883 successfully.\n Start mqtt:tcp listener on 0.0.0.0:1883 successfully.\n Start mqtt:ws listener on 0.0.0.0:8083 successfully.\n Start mqtt:ssl listener on 0.0.0.0:8883 successfully.\n Start mqtt:wss listener on 0.0.0.0:8084 successfully.\n EMQ X Broker 3.2.1 is running now!\n \"The license certificate is expired!\"\n 2019-07-23 05:52:51.355 [critical] The license certificate is expired!\n 2019-07-23 05:52:51.355 [critical] The license certificate is expired! System shutdown!\n Stop mqtt:tcp listener on 127.0.0.1:11883 successfully.\n Stop mqtt:tcp listener on 0.0.0.0:1883 successfully.\n Stop mqtt:ws listener on 0.0.0.0:8083 successfully.\n Stop mqtt:ssl listener on 0.0.0.0:8883 successfully.\n Stop mqtt:wss listener on 0.0.0.0:8084 successfully.\n [os_mon] memory supervisor port (memsup): Erlang has closed\n [os_mon] cpu supervisor port (cpu_sup): Erlang has closed\n```\n\n **Solution:** Go to [emqx.io](https://emqx.io) to apply for a license or install the open source version of EMQ X Broker"
},
{
"title": "EMQ X cannot connect to Mysql8.0",
"category": "",
"tag": [],
"content": "Different from previous versions, Mysql8.0 uses the `caching_sha2_password` plugin by default for account password configuration. The password plugin is required to change to `mysql_native_password`.\n\n- Modify the `mysql.user` table\n\n ```\n ## Switch to the mysql database\n mysql> use mysql;\n \n ## View user table\n \n mysql> select user, host, plugin from user;\n +------------------+-----------+-----------------------+\n | user | host | plugin |\n +------------------+-----------+-----------------------+\n | root | % | caching_sha2_password |\n | mysql.infoschema | localhost | caching_sha2_password |\n | mysql.session | localhost | caching_sha2_password |\n | mysql.sys | localhost | caching_sha2_password |\n | root | localhost | caching_sha2_password |\n +------------------+-----------+-----------------------+\n \n ## Change password plugin\n mysql> ALTER USER 'your_username'@'your_host' IDENTIFIED WITH mysql_native_password BY 'your_password';\n Query OK, 0 rows affected (0.01 sec)\n \n ## Refresh\n mysql> FLUSH PRIVILEGES;\n Query OK, 0 rows affected (0.00 sec)\n ```\n\n- Change `my.conf`\n\n Add a line below the [mysqld] in the `my.cnf` configuration file.\n\n ```\n default_authentication_plugin=mysql_native_password\n ```\n\n- Restart Mysql"
},
{
"title": "Use of ssl resumption session in EMQ X",
"category": "",
"tag": [],
"content": "Modify the reuse_sessions = on in the emqx.conf configuration and take effect. If the client and the server are successfully connected through SSL, when the client connection is encountered for the second time, the SSL handshake phase is skipped, the connection is directly established to save the connection time and increase the client connection speed."
},
{
"title": "MQTT client disconnect statistics",
"category": "",
"tag": [],
"content": "Execute `emqx_ctl listeners` to view the `shutdown_count` statistics under the corresponding port.\n\nClient disconnect link error code list:\n\n- `keepalive_timeout`:MQTT keepalive time out\n\n- `closed`: TCP client disconnected (the FIN sent by the client did not receive the MQTT DISCONNECT)\n\n- `normal`: MQTT client is normally disconnected\n\n- `einval`:EMQ X wants to send a message to the client, but the Socket has been disconnected\n\n- `function_clause`:MQTT packet format error\n\n- `etimedout`:TCP Send timeout (no TCP ACK response received)\n\n- `proto_unexpected_c`:Repeatedly received an MQTT connection request when there is already an MQTT connection\n\n- `idle_timeout`: After the TCP connection is established for 15s, the connect packet has not been received yet."
}
]