Lý Thành
05/25/2026, 5:04 AMRocky
05/25/2026, 5:04 AMALTER DATABASE statement. By default, the database storage quota is unlimited.
Syntax
sql
ALTER DATABASE <db_name> SET DATA QUOTA <quota>;
You can specify the quota using units such as B, K, KB, M, MB, G, GB, T, TB, P, or PB.
Example
To set a maximum limit of 100GB for a database named customer, run:
sql
ALTER DATABASE customer SET DATA QUOTA 100GB;
Additional Notes
* Replica Quota: You can also limit the number of replicas (tablets) in a database:
sql
ALTER DATABASE customer SET REPLICA QUOTA 100000;
* Update Interval: StarRocks updates the tracked storage usage periodically. This is controlled by the FE configuration db_used_data_quota_update_interval_secs (default is 300 seconds/5 minutes).
* Checking Current Data: To see the current storage size of your databases and tables, use:
sql
SHOW DATA;
References
• faq/Others.md
• sql-reference/sql-statements/Database/ALTER_DATABASE.md
• administration/management/resource_management/Query_management.md
• quick_start/shared-data.md
• administration/management/FE_configuration.md
• faq/Sql_faq.md
• knowledge/usage/best-practice.md
• administration/management/monitor_manage_big_queries.mdLý Thành
05/25/2026, 9:25 AMRocky
05/25/2026, 9:25 AMAuditLoader plugin is installed but no data is showing in your audit table, it is usually due to one of the following reasons.
1. Check Table Partitions
The audit table is typically created with Dynamic Partitioning. By default, StarRocks creates the first partition about 10 minutes after the table is created. If there are no partitions, the loader cannot insert data.
* Verify: Run SHOW PARTITIONS FROM starrocks_audit_db*.starrocks_audit_tbl*;.
* Fix: If no partitions exist, wait 10 minutes or manually add a partition for today.
2. Verify plugin.conf Configuration
The AuditLoader reads its configuration (user, password, FE port) from a file called plugin.conf inside the zip package you used for installation. If you did not edit this file before zipping and installing, the loader will fail to connect.
* Important: You cannot edit plugin.conf after the plugin is installed.
* Fix:
1. Uninstall: UNINSTALL PLUGIN AuditLoader;
2. Unzip your auditloader.zip.
3. Edit plugin.conf to ensure user, password, and frontend_host_port (usually 127.0.0.1:8030) are correct.
4. Zip it back: zip -q -m -r auditloader.zip auditloader.jar plugin.conf plugin.properties
5. Re-install: INSTALL PLUGIN FROM "/path/to/auditloader.zip";
3. Audit Log Format Conflict
Recent StarRocks versions (v3.2.7+) introduced an FE configuration audit_log_json_format.
* The AuditLoader plugin expects the text/pipe-separated format. If you set audit_log_json_format = true in your fe.conf, the plugin will fail to parse the logs.
* Fix: Ensure audit_log_json_format is false (the default).
4. Check fe.log for Errors
The AuditLoader runs as a background thread in the FE. Any errors (like "Access Denied" or "Table not found") are logged in the standard fe.log.
* Action: Search your fe.log for the keyword `audit`:
bash
grep -i "audit" fe.log
Look for errors related to Stream Load or AuditLoaderPlugin.
5. Check if fe.audit.log exists
The plugin works by reading the local fe.audit.log file.
* Action: Ensure that the file fe/log/fe.audit.log exists and is being updated with new queries. If this file is empty, the plugin has nothing to load.
6. Batch Interval
The loader does not insert rows instantly. It buffers them based on max_batch_interval_sec (default is 60 seconds). Wait at least a minute after running some test queries before checking the table again.
References
• administration/management/audit_loader.md
• administration/management/FE_configuration.md
• administration/management/logs.md
• sql-reference/sql-statements/cluster-management/plugin/SHOW_PLUGINS.md
References
• administration/management/FE_configuration.md
• administration/management/logs.md
• administration/management/audit_loader.mdLý Thành
05/25/2026, 10:17 AMRocky
05/25/2026, 10:17 AMreplication_num = 1 because it offers no data redundancy. If the node (BE) storing that data fails, the data becomes unavailable and may be permanently lost.
Whether you should choose 2 or 3 depends on your cluster size and reliability needs:
1. The Standard: 3 Replicas
StarRocks is designed to work best with 3 replicas (the default).
* High Availability: It can tolerate the complete failure of one BE node without any downtime or data loss.
* Quorum: By default, StarRocks uses a "Majority" write quorum. With 3 replicas, it only needs 2 to acknowledge a write to succeed, which balances performance and safety.
2. The Middle Ground: 2 Replicas
You should only use 2 replicas if you are limited by hardware (e.g., you only have 2 BE nodes).
* Risk: While better than 1, if one node is down and the second node experiences a disk failure, your data is gone.
* Requirement: You must have at least 2 BE nodes to set this.
Summary Comparison
Replicas | Data Loss Risk | Availability | Min. BE Nodes
1 | High (Single point of failure) | No HA | 1
2 | Medium | Low HA (Tolerates 1 node failure, but no buffer) | 2
3 | Low | Full HA (Standard production setup) | 3
──────────
How to change the replication number
If you decide to increase the replicas, use the following commands. Note that this will trigger a background task to clone data, which consumes disk space and IO.
For a non-partitioned table:
sql
ALTER TABLE your_table_name SET ("replication_num" = "3");
For a partitioned table (to update existing and future partitions):
sql
-- 1. Update all existing partitions
ALTER TABLE your_table_name MODIFY PARTITION (*) SET ("replication_num" = "3");
-- 2. Update the default for future partitions
ALTER TABLE your_table_name SET ("default.replication_num" = "3");
-- 3. If using Dynamic Partitioning, update that property too
ALTER TABLE your_table_name SET ("dynamic_partition.replication_num" = "3");
Recommendation: If you have 3 or more BE nodes, change it to 3. If you only have 2 BE nodes, change it to 2.
References
• knowledge/usage/best-practice.md
• administration/management/resource_management/Replica.md
• sql-reference/sql-statements/table_bucket_part_index/CREATE_TABLE.md
)
References
• administration/management/resource_management/Replica.md
• knowledge/usage/best-practice.md
• administration/management/FE_configuration.md
• sql-reference/sql-statements/table_bucket_part_index/CREATE_TABLE.md
• administration/management/BE_configuration.mdLý Thành
05/25/2026, 10:21 AMRocky
05/25/2026, 10:21 AMALTER TABLE command to increase replication_num, you are essentially telling the Frontend (FE) that each tablet in that table now "needs" one more replica.
What happens behind the scenes:
1. Detection: The FE's "Tablet Checker" background process (which runs every 20 seconds by default) scans the table and notices that the actual number of replicas (1) is less than your new target (2). It marks these tablets as having a REPLICA_MISSING status.
2. Scheduling: The FE's "Tablet Scheduler" generates Clone Tasks. It identifies a healthy source BE (the one that has the existing data) and selects a target BE (the second node) to host the new replica.
3. Data Copy (Cloning): The target BE pulls a copy of the data files from the source BE. This is a physical file copy (cloning).
4. Completion: Once the target BE finishes copying and reports success to the FE, the FE updates its metadata. The table is now considered healthy with 2 replicas.
Important details:
* Availability: Your table remains online and readable/writable during this process.
* Performance: The copying happens in the background. StarRocks limits the number of concurrent clone tasks (default 2 per disk) to prevent the background copy from overwhelming your cluster's I/O and network.
* Space: You must ensure the second BE has enough disk space to hold the new copy of the data.
How to monitor the progress:
You can see the actual background tasks being executed by the Tablet Scheduler using these commands:
* Check pending tasks:
sql
SHOW PROC '/cluster_balance/pending_tablets';
* Check currently running copy tasks:
sql
SHOW PROC '/cluster_balance/running_tablets';
* Check if the table is healthy (all replicas reached):
sql
-- Replace 'db_name' and 'table_name' with yours
SHOW TABLE STATUS FROM db_name LIKE 'table_name';
Alternatively, check the tablet health directly:
sql
SHOW TABLETS FROM table_name;
In the output of SHOW TABLETS, you will see a ReplicaCount column. Once the process is finished, it should show 2 for every tablet.
References
• administration/management/resource_management/Replica.md
• sql-reference/sql-statements/table_bucket_part_index/ALTER_TABLE.md
• knowledge/usage/best-practice.md
References
• administration/management/resource_management/Replica.mdLý Thành
05/26/2026, 2:22 AMbrpc_port) does this need to open in firewall between my 2 BE? what port need openRocky
05/26/2026, 2:22 AM8060 (bRPC port) must be open between your BE nodes.
In StarRocks, the brpc_port is used for internal data transmission. Specifically, when you run a query that requires a shuffle (data exchange) or when data needs to be copied between BEs for replication (cloning), the BEs communicate with each other over this port using the bRPC protocol.
If this port is blocked, your cluster might start, but queries will fail with "RPC" or "Connection Refused" errors, and data replication between nodes will fail.
All Required BE Ports
You should ensure the following ports are open between all BEs and between FEs and BEs:
Port | Name | Purpose | Communication Type
8060 | brpc_port | Data Exchange / RPC | BE $\leftrightarrow$ BE, FE $\to$ BE
9060 | be_port | Thrift Server (Requests) | FE $\to$ BE
9050 | heartbeat_service_port | Heartbeat & Status | FE $\to$ BE
8040 | be_http_port | HTTP Service (Download/Upload) | BE $\leftrightarrow$ BE, FE $\to$ BE
9070 | starlet_port | Internal agent service | BE $\leftrightarrow$ BE
Summary Recommendation
* BE $\leftrightarrow$ BE: Open 8060, 8040, and 9070.
* FE $\to$ BE: Open 9060, 9050, 8060, and 8040.
If you are using a security group or firewall (like iptables or firewalld), it is usually easiest to allow all traffic on all ports between the internal IP addresses of your cluster nodes (FE and BE) to avoid performance issues or unexpected failures.
References
• deployment/environment_configurations.md
• administration/management/BE_configuration.md
• deployment/deploy_manually.md
References
• administration/management/BE_configuration.md
• deployment/environment_configurations.md
• deployment/deploy_manually.md
• administration/management/FE_configuration.md
• faq/Deploy_faq.mdLý Thành
05/26/2026, 3:15 AMRocky
05/26/2026, 3:15 AM[E112] Not connected to 10.0.27.71:8060 yet (with Host is down) means one of your StarRocks BE nodes tried to send data to the node at 10.0.27.71, but the network connection failed.
Since you just changed your replication number, StarRocks is trying to copy data between nodes using this port, and the failure is preventing it from completing.
Troubleshooting Steps
1. Check if the BE process is running
On the target machine (10.0.27.71), check if the StarRocks BE process is actually alive:
bash
ps aux | grep starrocks_be
If it's not running, check the log/be.INFO or log/be.WARNING files on that machine to see if it crashed or failed to start.
2. Check if port 8060 is listening
On 10.0.27.71, verify the BE has successfully bound to the bRPC port:
bash
# You may need sudo for -p
netstat -tlnp | grep 8060
If nothing shows up, the BE did not start correctly or failed to bind to that port.
3. Test connectivity from the SOURCE node
Go to the other BE node (the one that threw the error) and try to connect to the target node manually:
bash
telnet 10.0.27.71 8060
# OR
nc -zv 10.0.27.71 8060
* If it times out: A firewall (iptables, firewalld) or a Cloud Security Group (AWS/GCP/Azure) is blocking port 8060.
* If it says "Connection refused": The target BE is reachable, but it isn't listening on that port (see Step 1 & 2).
4. Verify priority_networks
If your machines have multiple network interfaces (e.g., a public and a private IP), StarRocks might be trying to connect to the wrong one.
Check conf/be.conf on all nodes:
* Ensure priority_networks is set to the correct CIDR (e.g., priority_networks = 10.0.27.0/24).
* If you change this, you must restart the BE.
Why this happened now?
When you changed replication_num from 1 to 2, StarRocks immediately triggered a "Clone Task." This task requires the BEs to talk to each other over the brpc_port (8060) to transfer the data. If this port was blocked all along, you wouldn't have noticed it until you added a second node or increased the cluster tried to use for replication or distributed queries.
References
• administration/management/BE_configuration.md
• deployment/environment_configurations.md
• faq/operation_maintenance_faq.md
• faq/loading/Loading_faq.md
References
• faq/Deploy_faq.md
• knowledge/usage/best-practice.md
• faq/operation_maintenance_faq.md
• administration/Meta_recovery.md
• administration/management/BE_configuration.mdLý Thành
05/26/2026, 6:40 AMRocky
05/26/2026, 6:41 AMDECIMAL256 was introduced) and hitting a known limitation in the CSV parsing logic for this high-precision data type.
What is happening?
The StarRocks Backend (BE) has a dedicated parser for CSV data. For DECIMAL256 (precision > 38), the current CSV scanner in your version does not yet support direct mapping to this specific internal 256-bit type, resulting in the Unsupported CSV type DECIMAL256(58, 40) error.
How to fix it
There are two primary ways to resolve this:
1. Switch to JSON format (Recommended)
As indicated by your own pipeline's retry logic (Retrying with local_json_stream_load (DECIMAL256-safe)), the JSON format uses a different parsing path that correctly handles DECIMAL256.
* Change your header to -H "format: json".
* Ensure your data is formatted as a JSON array of objects or line-delimited JSON.
2. Use the CAST Workaround in CSV
If you must stick with CSV format, you can load the high-precision numbers as strings (temporarily) and then cast them to the target type within the Stream Load command. This bypasses the direct CSV-to-Decimal256 mapping.
Modify your curl command's columns header like this:
1. Identify the column name in the CSV (e.g., MY_DEC_COL).
2. Map it to a temporary name (e.g., MY_DEC_COL_TEMP).
3. Assign the actual column using a cast() function.
Example snippet for the header:
bash
-H "columns: col1, col2, MY_DEC_COL_TEMP, MY_DEC_COL=cast(MY_DEC_COL_TEMP as decimal(58,40))"
Summary of DECIMAL256 in v4.0
* Precision: Supports up to 76 digits (your 58, 40 fits perfectly).
* Availability: Only available in StarRocks v4.0 and later.
* Workload: Best for financial calculations where DECIMAL128 (max 38 digits) might overflow.
If you are seeing this on a version older than 4.0, it means the table was created with an unsupported precision, and you should reduce the precision to DECIMAL(38, S) or less than 38)` or upgrade to v4.0.
References
• sql-reference/data-types/numeric/DECIMAL.md
• release_notes/release-4.0.md
• loading/StreamLoad.md
References
• sql-reference/data-types/numeric/DECIMAL.md
• release_notes/release-4.0.md
• sql-reference/data-types/string-type/BINARY.mdLý Thành
05/26/2026, 6:45 AMRocky
05/26/2026, 6:45 AMDECIMAL256 type, the CSV scanner in current v4.0.x releases has a known limitation where it cannot directly parse CSV strings into 256-bit decimals. This is why you get:
Message: Unsupported CSV type DECIMAL256(58, 40)
Solution (CSV):
You must map the column as a temporary string and then use CAST in the columns header.
Modify your columns parameter in the Stream Load:
bash
# Change: ...COL_NAME...
# To: ...COL_NAME_TEMP, COL_NAME = CAST(COL_NAME_TEMP AS DECIMAL(58,40))...
Solution (JSON):
The JSON parser does support DECIMAL256 directly. Your Airflow script noticed the failure and tried to switch to JSON automatically, but then hit the second error below.
──────────
2. The Connection Error (Port 8040)
The error curl: (28) Failed to connect to 10.0.27.72 port 8040 confirms that your BE HTTP port (8040) is not accessible from your Airflow worker.
In your previous question, we discussed port 8060. However, for Stream Load:
1. You send the request to the FE (port 8030).
2. The FE redirects (HTTP 307) your curl command to a BE (port 8040).
3. Your curl (via --location-trusted) tries to connect to 10.0.27.72:8040 to upload the actual data.
Why it failed:
Your firewall or security group likely allows port 8030 (FE) but is blocking port 8040 on the BEs.
Summary Checklist to Fix:
1. Open Port 8040: Ensure the Airflow worker can reach all BE nodes on port 8040.
2. Verify BE Status: Check if the BE on 10.0.27.72 is running (ps aux | grep starrocks_be).
3. Check `be_http_port`: Confirm in be.conf that be_http_port is indeed 8040 (the default).
4. Priority Networks: Ensure priority_networks in be.conf is set so the BE reports the correct IP (10.0.27.72) to the FE. If the BE reports an IP that the Airflow worker can't "see," the redirect will fail.
Quick fix for the Airflow Job:
If you fix the network for port 8040, the script's automatic retry using JSON will likely succeed, as JSON doesn't suffer from the DECIMAL256 CSV parsing bug.
References
• sql-reference/data-types/numeric/DECIMAL.md
• loading/StreamLoad.md
• administration/management/BE_configuration.md
• deployment/environment_configurations.md
References
• sql-reference/data-types/numeric/DECIMAL.md
• loading/StreamLoad.md
• administration/management/BE_configuration.md
• deployment/environment_configurations.md
• faq/loading/Stream_load_faq.md
• faq/Deploy_faq.md
• release_notes/release-4.0.md
References
• faq/loading/Stream_load_faq.md
• quick_start/helm.md
• loading/StreamLoad.md
• loading/Stream_Load_transaction_interface.md
• sql-reference/sql-statements/loading_unloading/STREAM_LOAD.mdLý Thành
05/26/2026, 7:43 AMapp_code)
COMMENT "Thông tin danh mục hồ sơ khách hàng Master"
DISTRIBUTED BY HASH(app_code) BUCKETS 16
PROPERTIES (
"compression" = "LZ4",
"enable_persistent_index" = "true",
"fast_schema_evolution" = "true",
"replicated_storage" = "true",
"replication_num" = "1"
);Rocky
05/26/2026, 7:43 AMabc, run the following SQL command:
sql
ALTER TABLE abc SET ("replication_num" = "2");
Important Considerations
1. Verification of progress
After running the command, StarRocks does not immediately create the second replica. It starts background Clone Tasks. You can monitor the health and replication status of the tablets using:
sql
SHOW TABLETS FROM abc;
Look at the ReplicaCount column. It should eventually reach 2 for all tablets.
2. Network requirement (Crucial for your cluster)
In your previous messages, you reported transmit chunk rpc failed and Not connected to yet errors.
* The Problem: When you change replication_num to 2, the current BE must send a copy of the data to another BE.
* The Port: This transfer happens over the bRPC port (8060).
* The Risk: If your BEs still cannot communicate with each other on port 8060, the replication will fail. The table will remain with only 1 replica, and you will see "Unhealthy Tablets" in your FE logs.
3. If you have partitions
If your table actually has partitions (though not shown in your snippet), you must also update the historical partitions and the default for future ones:
sql
-- For existing partitions
ALTER TABLE abc MODIFY PARTITION (*) SET ("replication_num" = "2");
-- For future partitions
ALTER TABLE abc SET ("default.replication_num" = "2");
4. Check for errors
If the replicas do not increase after a few minutes, check the FE master logs (fe.log) for "Tablet Scheduler" errors or "Clone Task" failures. These will tell you if the network connection is still blocking the process.
References
• sql-reference/sql-statements/table_bucket_part_index/ALTER_TABLE.md
• knowledge/usage/best-practice.md
• sql-reference/sql-statements/table_bucket_part_index/CREATE_TABLE.md
• faq/operation_maintenance_faq.md
• administration/management/resource_management/Replica.mdLý Thành
05/26/2026, 8:41 AMRocky
05/26/2026, 8:41 AMFILE_SCAN_NODE (which is responsible for reading your CSV/JSON data) shows 0 bytes and 0 rows.
* This confirms that the error you saw earlier (Unsupported CSV type DECIMAL256) happened during the Plan Initialization.
* StarRocks looked at the table schema (which has a DECIMAL256 column) and the load request (which is format: CSV), realized it cannot map those two together, and "Aborted" the task immediately without reading a single line of your file.
3. "OlapTableSink: OpenTime: 39.692ms"
The sink is the part that writes data to the disks.
* The OpenTime is very low, but notice that SendDataTime, PackChunkTime, and WaitResponseTime are all 0ns.
* This means the load failed so early that it never even tried to send data to the replicas.
Why did this happen?
Based on your previous logs, this profile is the "behind-the-scenes" look at the Unsupported CSV type DECIMAL256(58, 40) error.
The sequence was:
1. Airflow sent the curl request.
2. StarRocks FE created a plan and sent it to the BE (10.0.27.71).
3. The BE checked the plan, saw it was supposed to scan CSV data into a DECIMAL256 column, and realized it doesn't have the internal code to do that specific conversion for CSVs.
4. The BE immediately Aborted the fragment.
5. The BE sent the error message back to your Airflow task.
How to fix it (Recap)
Since you are on v4.0.10, you must bypass the CSV parser's limitation for `DECIMAL256`:
1. Switch to JSON: Your Airflow log showed a retry with JSON. Fix the Port 8040 network issue so that retry can succeed.
2. Use CAST in CSV: If you must use CSV, change your columns header to read the decimal column as a string first:
_ _Instead of:* ..., MY_COL, ...
_ _Use:* ..., MY_COL_TEMP, MY_COL = CAST(MY_COL_TEMP AS DECIMAL(58,40)), ...
Once you do one of these, you will see RowsRead and BytesRead increase in the profile.