rewrite readme about starrocks

This commit is contained in:
Nicolas 2025-08-20 18:53:25 +08:00
parent 44f8a10431
commit f6f464dbae

View File

@ -1,128 +1,128 @@
# StarRocks 高可用集群部署 # StarRocks High Availability Cluster Deployment
## 概述 ## Overview
本项目使用 StarRocks Kubernetes Operator 直接部署高可用 StarRocks 集群。 This project uses StarRocks Kubernetes Operator to directly deploy a high availability StarRocks cluster.
## 组件架构 ## Component Architecture
- **Frontend (FE)**: 3个副本,负责元数据管理和查询协调 - **Frontend (FE)**: 3 replicas, responsible for metadata management and query coordination
- **Backend (BE)**: 3个副本,负责数据存储和计算 - **Backend (BE)**: 3 replicas, responsible for data storage and computation
- **Compute Node (CN)**: 2个副本,提供弹性计算能力 - **Compute Node (CN)**: 2 replicas, providing elastic computing capabilities
## 文件说明 ## File Description
### 1. ha-starrocks-cluster.yaml ### 1. ha-starrocks-cluster.yaml
高可用 StarRocks 集群的主要配置文件,包含: Main configuration file for the high availability StarRocks cluster, including:
- FE、BE、CN 组件的副本数和镜像配置 - Replica count and image configuration for FE, BE, CN components
- Pod 反亲和性配置,确保高可用 - Pod anti-affinity configuration to ensure high availability
- 服务配置和环境变量 - Service configuration and environment variables
### 2. starrocks-configmaps.yaml ### 2. starrocks-configmaps.yaml
各组件的配置文件: Configuration files for each component:
- **FE配置**: 日志、端口、JVM参数等 - **FE Configuration**: Logs, ports, JVM parameters, etc.
- **BE配置**: 存储、端口、日志级别等 - **BE Configuration**: Storage, ports, log levels, etc.
- **CN配置**: 计算节点端口和日志配置 - **CN Configuration**: Compute node ports and log configuration
### 3. ha-starrocks-values.yaml ### 3. ha-starrocks-values.yaml
Helm values 配置文件(用于参考) Helm values configuration file (for reference)
### 4. values.yaml ### 4. values.yaml
Helm Chart 的默认值配置(用于现有集群) Default Helm Chart configuration (for existing clusters)
### 5. vpa.yaml ### 5. vpa.yaml
垂直 Pod 自动扩缩容配置 Vertical Pod Autoscaler configuration
## 部署步骤 ## Deployment Steps
### 1. 应用配置 ### 1. Apply Configuration
```bash ```bash
# 首先应用 ConfigMap 配置 # First apply ConfigMap configuration
kubectl apply -f starrocks-configmaps.yaml kubectl apply -f starrocks-configmaps.yaml
# 然后应用 StarRocks 集群配置 # Then apply StarRocks cluster configuration
kubectl apply -f ha-starrocks-cluster.yaml kubectl apply -f ha-starrocks-cluster.yaml
``` ```
### 2. 检查部署状态 ### 2. Check Deployment Status
```bash ```bash
# 检查 StarRocks 集群状态 # Check StarRocks cluster status
kubectl get starrockscluster -n freeleaps-data-platform kubectl get starrockscluster -n freeleaps-data-platform
# 检查 Pod 状态 # Check Pod status
kubectl get pods -n freeleaps-data-platform -l app=starrocks kubectl get pods -n freeleaps-data-platform -l app=starrocks
# 检查服务状态 # Check service status
kubectl get svc -n freeleaps-data-platform -l app=starrocks kubectl get svc -n freeleaps-data-platform -l app=starrocks
``` ```
### 3. 查看日志 ### 3. View Logs
```bash ```bash
# 查看 FE 日志 # View FE logs
kubectl logs -n freeleaps-data-platform -l app.kubernetes.io/component=fe kubectl logs -n freeleaps-data-platform -l app.kubernetes.io/component=fe
# 查看 BE 日志 # View BE logs
kubectl logs -n freeleaps-data-platform -l app.kubernetes.io/component=be kubectl logs -n freeleaps-data-platform -l app.kubernetes.io/component=be
# 查看 CN 日志 # View CN logs
kubectl logs -n freeleaps-data-platform -l app.kubernetes.io/component=cn kubectl logs -n freeleaps-data-platform -l app.kubernetes.io/component=cn
``` ```
## 高可用特性 ## High Availability Features
- **FE高可用**: 3个FE节点支持自动故障转移 - **FE High Availability**: 3 FE nodes with automatic failover support
- **BE高可用**: 3个BE节点数据多副本存储 - **BE High Availability**: 3 BE nodes with data multi-replica storage
- **CN弹性**: 支持水平扩展和自动扩缩容 - **CN Elasticity**: Support for horizontal scaling and automatic scaling
- **Pod反亲和性**: 确保组件分布在不同节点上 - **Pod Anti-affinity**: Ensures components are distributed across different nodes
- **自动故障恢复**: Operator自动管理集群状态 - **Automatic Failover Recovery**: Operator automatically manages cluster state
## 网络配置 ## Network Configuration
- **内部服务**: 使用ClusterIP类型 - **Internal Services**: Use ClusterIP type
- **端口映射**: - **Port Mapping**:
- FE: 8030(HTTP), 9010(编辑日志), 9020(RPC), 9030(查询) - FE: 8030(HTTP), 9010(Edit Log), 9020(RPC), 9030(Query)
- BE: 8040(HTTP), 9050(心跳), 8060(BRPC), 9060(BE端口) - BE: 8040(HTTP), 9050(Heartbeat), 8060(BRPC), 9060(BE Port)
- CN: 8040(HTTP), 9050(心跳), 8060(BRPC), 9060(Thrift) - CN: 8040(HTTP), 9050(Heartbeat), 8060(BRPC), 9060(Thrift)
## 存储配置 ## Storage Configuration
- **FE元数据**: 使用现有存储配置 - **FE Metadata**: Uses existing storage configuration
- **BE数据**: 使用现有存储配置 - **BE Data**: Uses existing storage configuration
- **CN缓存**: 使用现有存储配置 - **CN Cache**: Uses existing storage configuration
- **数据持久化**: 支持PVC自动创建和绑定 - **Data Persistence**: Supports automatic PVC creation and binding
## 监控和运维 ## Monitoring and Operations
- **健康检查**: 内置就绪和存活探针 - **Health Checks**: Built-in readiness and liveness probes
- **日志收集**: 结构化日志输出 - **Log Collection**: Structured log output
- **资源监控**: 支持Prometheus指标收集 - **Resource Monitoring**: Supports Prometheus metrics collection
- **自动扩缩容**: VPA支持垂直资源调整 - **Automatic Scaling**: VPA supports vertical resource adjustment
- **Operator管理**: 自动集群生命周期管理 - **Operator Management**: Automatic cluster lifecycle management
## 升级和回滚 ## Upgrade and Rollback
```bash ```bash
# 升级集群配置 # Upgrade cluster configuration
kubectl apply -f ha-starrocks-cluster.yaml kubectl apply -f ha-starrocks-cluster.yaml
# 回滚到上一个版本 # Rollback to previous version
kubectl rollout undo deployment/starrocks-operator -n freeleaps-data-platform kubectl rollout undo deployment/starrocks-operator -n freeleaps-data-platform
# 查看集群状态 # View cluster status
kubectl describe starrockscluster freeleaps-starrocks -n freeleaps-data-platform kubectl describe starrockscluster freeleaps-starrocks -n freeleaps-data-platform
``` ```
## 故障排除 ## Troubleshooting
```bash ```bash
# 检查集群状态 # Check cluster status
kubectl describe starrockscluster freeleaps-starrocks -n freeleaps-data-platform kubectl describe starrockscluster freeleaps-starrocks -n freeleaps-data-platform
# 检查 Pod 事件 # Check Pod events
kubectl get events -n freeleaps-data-platform --sort-by='.lastTimestamp' kubectl get events -n freeleaps-data-platform --sort-by='.lastTimestamp'
# 检查 Operator 日志 # Check Operator logs
kubectl logs -n freeleaps-data-platform -l app=starrocks-operator kubectl logs -n freeleaps-data-platform -l app=starrocks-operator
# 检查存储状态 # Check storage status
kubectl get pvc -n freeleaps-data-platform kubectl get pvc -n freeleaps-data-platform
kubectl get pv kubectl get pv
``` ```
## 注意事项 ## Important Notes
1. **现有集群**: 此配置将升级现有的 `freeleaps-starrocks` 集群 1. **Existing Cluster**: This configuration will upgrade the existing `freeleaps-starrocks` cluster
2. **数据安全**: 升级过程中数据不会丢失 2. **Data Safety**: Data will not be lost during the upgrade process
3. **滚动更新**: Operator 会自动进行滚动更新,确保服务连续性 3. **Rolling Updates**: Operator will automatically perform rolling updates to ensure service continuity
4. **资源需求**: 确保集群有足够的资源支持增加的副本数 4. **Resource Requirements**: Ensure the cluster has sufficient resources to support the increased replica count