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