Lý Thành
09/29/2026, 7:24 AMRocky
09/29/2026, 7:24 AMLý Thành
09/29/2026, 7:24 AMRocky
09/29/2026, 7:25 AMSQL Error [5064]: Forbidden (Status Code: 403) indicates that StarRocks is unable to authenticate or does not have sufficient permissions to access the S3-compatible storage (in your case, SeaweedFS).
When using S3-compatible storage like SeaweedFS for a StarRocks repository, you must ensure several specific properties are set in your CREATE REPOSITORY statement.
Common Causes and Fixes
1. Missing or Incorrect Endpoint:
Since you are using SeaweedFS (not AWS S3), you must provide the aws.s3.endpoint. Without it, StarRocks tries to connect to AWS's default endpoints, which results in a 403 Forbidden error.
2. Path-Style Access:
Most S3-compatible storages (SeaweedFS, MinIO) require "path-style" access. You should set aws.s3.enable_path_style_access to true.
3. Mandatory Region:
Even if SeaweedFS doesn't strictly use regions, the AWS SDK used by StarRocks often requires a region value (e.g., us-east-1) to sign requests correctly.
Recommended CREATE REPOSITORY Syntax
Try creating the repository using the following template, adjusting the values for your environment:
sql
CREATE REPOSITORY `starrocks_seaweed_repo`
WITH BROKER
ON LOCATION "<s3a://starrocks-uat/backups>" -- Ensure the prefix/path exists or is correct
PROPERTIES (
"aws.s3.endpoint" = "<http://your-seaweedfs-s3-endpoint:8333>", -- Replace with your actual endpoint
"aws.s3.access_key" = "your_access_key",
"aws.s3.secret_key" = "your_secret_key",
"aws.s3.region" = "us-east-1", -- Mandatory for the SDK
"aws.s3.enable_path_style_access" = "true", -- Required for SeaweedFS/MinIO
"aws.s3.enable_ssl" = "false" -- Set to true if using https
);
Verification Steps
* Permissions: Ensure the credentials provided have Read, Write, and List permissions on the bucket starrocks-uat. SeaweedFS's S3 API needs these to perform the initial check on the __repo_info file.
* Network: Verify that your StarRocks FE and BE nodes can reach the SeaweedFS S3 endpoint at the specified IP/port.
* Time Sync: Ensure the system clocks on your StarRocks nodes and the SeaweedFS server are synchronized (e.g., via NTP). S3 authentication signatures fail if the time difference is more than a few minutes.
For more details, you can refer to the CREATE REPOSITORY documentation.
References
• administration/management/FE_configuration.md
• sql-reference/sql-functions/table-functions/files.md
• deployment/shared_data/s3.md
• data_source/file_external_table.md
• sql-reference/sql-statements/loading_unloading/BROKER_LOAD.mdLý Thành
09/30/2026, 1:45 AMRocky
09/30/2026, 1:45 AMSHOW DATA (Nhanh & Đơn giản)
Lệnh này cho phép bạn xem nhanh dung lượng của tất cả các bảng trong database hiện tại.
sql
-- Xem dung lượng của tất cả các bảng trong database đang sử dụng
SHOW DATA;
-- Xem dung lượng chi tiết của một bảng cụ thể (bao gồm các phân vùng)
SHOW DATA FROM <tên_database>.<tên_bảng>;
Kết quả sẽ hiển thị cột Size và ReplicaCount.
──────────
Cách 2: Sử dụng information_schema (Để sắp xếp Top)
Nếu bạn muốn liệt kê và sắp xếp danh sách các bảng lớn nhất trên toàn bộ cluster hoặc database, hãy sử dụng bảng hệ thống.
Liệt kê Top 10 bảng lớn nhất (tính theo Byte):
sql
SELECT
TABLE_SCHEMA AS database_name,
TABLE_NAME AS table_name,
DATA_LENGTH AS total_bytes,
TABLE_ROWS AS row_count,
-- Chuyển đổi sang đơn vị dễ đọc (GB)
ROUND(DATA_LENGTH / 1024 / 1024 / 1024, 2) AS size_gb
FROM information_schema.tables
WHERE TABLE_SCHEMA NOT IN ('information_schema', '_statistics_')
ORDER BY DATA_LENGTH DESC
LIMIT 10;
──────────
Cách 3: Kiểm tra chi tiết mức Partition (Dành cho bản 3.1.9+)
Nếu bạn muốn tìm các phân vùng (partition) chiếm nhiều dung lượng nhất (rất hữu ích để tối ưu hóa lưu trữ):
sql
SELECT
DB_NAME,
TABLE_NAME,
PARTITION_NAME,
DATA_SIZE,
ROW_COUNT
FROM information_schema.partitions_meta
ORDER BY DATA_SIZE DESC
LIMIT 20;
Lưu ý:
* DATA_LENGTH trong information_schema.tables là tổng dung lượng của tất cả các bản sao (replicas). Nếu bạn thiết lập số bản sao là 3, dung lượng này sẽ gấp 3 lần dung lượng dữ liệu thực tế.
* Nếu bạn sử dụng Shared-data mode (Cloud-native), dung lượng sẽ được tính dựa trên dữ liệu lưu trữ trên Object Storage (S3/GCS/HDFS).
References
• sql-reference/information_schema/tables.md
• faq/Sql_faq.md
• sql-reference/sql-statements/Database/SHOW_DATA.md
References
• sql-reference/information_schema/tables.md
• faq/Sql_faq.md
• knowledge/admin_and_operation/shared_data_compaction.md