EMQX CRD supports the use of .spec.bootstrapConfig to configure the log level of the EMQX cluster. The configuration of bootstrapConfig can refer to the document: bootstrapConfig(opens new window). This field is only allowed to be configured when creating an EMQX cluster, and does not support updating. NOTE: If you need to modify the cluster log level after creating EMQX, please modify it through EMQX Dashboard.
NOTE: The .spec.bootstrapConfig field configures the EMQX cluster log level to debug.
The corresponding CRD of EMQX Enterprise Edition in EMQX Operator is EmqxEnterprise, and EmqxEnterprise supports configuring the log level of EMQX cluster through .spec.template.spec.emqxContainer.emqxConfig field. For the specific description of the emqxConfig field, please refer to: emqxConfig(opens new window).
NOTE: The .spec.template.spec.emqxContainer.emqxConfig field configures the EMQX cluster log level to debug.
The corresponding CRD of EMQX Enterprise Edition in EMQX Operator is EmqxEnterprise, and EmqxEnterprise supports configuring the cluster log level through .spec.emqxTemplate.config field. The description of the config field can refer to the document: config(opens new window)
NOTE: node represents the unique identifier of the EMQX node in the cluster. node_status indicates the status of EMQX nodes. otp_release indicates the version of Erlang used by EMQX. role represents the EMQX node role type. version indicates the EMQX version. EMQX Operator creates an EMQX cluster with three core nodes and three replicant nodes by default, so when the cluster is running normally, you can see information about three running core nodes and three replicant nodes. If you configure the .spec.coreTemplate.spec.replicas field, when the cluster is running normally, the number of running core nodes displayed in the output should be equal to the value of this replicas. If you configure the .spec.replicantTemplate.spec.replicas field, when the cluster is running normally, the number of running replicant nodes displayed in the output should be equal to the replicas value.
kubectl get emqxenterprise emqx-ee -o json | jq ".status.emqxNodes"
NOTE: node represents the unique identifier of the EMQX node in the cluster. node_status indicates the status of EMQX nodes. otp_release indicates the version of Erlang used by EMQX. version indicates the EMQX version. EMQX Operator will pull up the EMQX cluster with three nodes by default, so when the cluster is running normally, you can see the information of the three running nodes. If you configure the .spec.replicas field, when the cluster is running normally, the number of running nodes displayed in the output should be equal to the value of replicas.
kubectl get emqxenterprise emqx-ee -o json | jq ".status.emqxNodes"
NOTE: node represents the unique identifier of the EMQX node in the cluster. node_status indicates the status of EMQX nodes. otp_release indicates the version of Erlang used by EMQX. version indicates the EMQX version. EMQX Operator will pull up the EMQX cluster with three nodes by default, so when the cluster is running normally, you can see the information of the three running nodes. If you configure the .spec.replicas field, when the cluster is running normally, the number of running nodes displayed in the output should be equal to the value of replicas.
# Verify whether the EMQX cluster log level configuration is effective
Use MQTT X to connect to the EMQX cluster to send messages
Click the button to create a new connection on the MQTT X page, and configure the EMQX cluster node information as shown in the figure. After configuring the connection information, click the connect button to connect to the EMQX cluster:
Then click the Subscribe button to create a new subscription, as shown in the figure, MQTT X has successfully connected to the EMQX cluster and successfully created the subscription:
After successfully connecting to the EMQX cluster and creating a subscription, we can send messages to the EMQX cluster, as shown in the following figure:
Use the command line to view EMQX cluster log information
kubectl logs emqx-core-0 -c emqx
1
The output is shown in the figure below:
From the figure, you can see the debug log information of connecting to the EMQX cluster using MQTT just now and sending messages.