Stream data analytics FAQ
This topic describes frequently asked questions about stream data analytics and its tasks.
Check task status
/linkedge/gateway/build/bin/lectl sc show
running parameter is true, the task is running.
========================= TOTALCOUNT 02 =========================
------------------------------- 01 -------------------------------
ID: sca6xxxxxxxxxxxxxxxxxxxxxxxxxxxx34
Name: High temperature alarm
Running: true
SQLPath: /linkedge/run/stream-compute/sql/sca6xxxxxxxxxxxxxxxxxxxxxxxxxxxx34.sql
SQLMd5: 8a76629992c7710ee742709658ffa7dc
LogPath: /linkedge/run/logger/stream-compute/sca6xxxxxxxxxxxxxxxxxxxxxxxxxxxx34/log.INFO
------------------------------- 02 -------------------------------
ID: sc62xxxxxxxxxxxxxxxxxxxxxxxxxxxxf6
Name: Average temperature
Running: true
SQLPath: /linkedge/run/stream-compute/sql/sc62xxxxxxxxxxxxxxxxxxxxxxxxxxxxf6.sql
SQLMd5: 1a037f7e4dcb7ab6910dba23b4d93ce2
LogPath: /linkedge/run/logger/stream-compute/sc62xxxxxxxxxxxxxxxxxxxxxxxxxxxxf6/log.INFO
| Field | Description |
| ID | The unique ID of the task (streamID). |
| Name | The name of the task. |
| Running | The running status of the task.
|
| SQLPath | The storage path of the SQL file. |
| SQLMd5 | The MD5 hash of the SQL file. |
| LogPath | The path of the task log. |
Check if the task receives device data
- In the remote console, use tool_config to set the log level to
debug./linkedge/gateway/build/bin/tool_config -s gw_logger_level debug - Run the following command to view the task log. The output shows the device data that the task receives.
tail -f /linkedge/run/logger/stream-compute/sc62xxxxxxxxxxxxxxxxxxxxxxxxxxxxf6/log.INFO | grep DATA_INPUTIn the command,
sc62xxxxxxxxxxxxxxxxxxxxxxxxxxxxf6is the unique ID of the task (streamID).
Why does a task stop running?
To determine why a task stopped, check the task log. The following are common reasons:
- SQL syntax error
Solution: In the IoT Platform console, go to the page. Validate the SQL for the task in the editor. After the SQL is validated, publish the task. For more information, see SQL-based tasks.
- The SQL statement includes a database, but the database connection fails.
Solution: See Why does a database connection fail?.
- The SQL statement includes a database, but the task fails to read from or insert data into it.
Solution: Ensure that the table format in the output database matches the format defined in the stream data analytics SQL.
How to resume a stopped task
- To update the task content, follow these steps:
In the IoT Platform console, go to the page. Modify the task and redeploy it to the edge. For more information, see SQL-based tasks.
- If you do not need to update the task content, follow these steps:
Log on to the remote console and run the following command to start the task:
/linkedge/gateway/build/bin/sctl start scxxxxxxxxIn the command,
scxxxxxxxxis the unique ID of the task that you want to start.
Check if the computing result is sent to the edge message bus
- Log on to the remote console.
- Use
dbus-monitorto print real-time messages from the edge message bus. If the output contains the message topic, the computing result was sent to the message bus./linkedge/gateway/build/bin/dbus-monitor --address unix:path=/tmp/var/run/mbusd/mbusd_socket
Database connection fails
- Verify that the database username and password are configured in the configuration center.
If they are not configured, run the following commands to save the username and password to the configuration center:
cd /linkedge/gateway/build/bin ./tool_config -s your_username_key your_username_value ./tool_config -s your_password_key your_password_keyNote- Replace your_username_key and your_password_key with the keys defined in the stream data analytics SQL.
- Replace your_username_value and your_password_value with the actual database username and password.
- Verify that the host, port, username, and password are correct.