openYuanrong frontend部署指南:从单机到集群的完整方案
openYuanrong frontend部署指南从单机到集群的完整方案【免费下载链接】yuanrong-frontendopenYuanrong frontendopenYuanrong 网关支持函数创建、调用等功能项目地址: https://gitcode.com/openeuler/yuanrong-frontend前往项目官网免费下载https://ar.openeuler.org/ar/openYuanrong frontend是openYuanrong网关的核心组件支持函数创建、调用等关键功能是构建Serverless分布式计算引擎的重要一环。本指南将提供从单机快速部署到Kubernetes集群部署的完整方案帮助新手用户轻松上手。openYuanrong frontend架构概览openYuanrong作为Serverless分布式计算引擎能够支持微服务、大数据分析、HPC、AI推理、AI训练等多种分布式负载其架构如下该架构主要包含多语言函数运行时、函数系统和数据系统能够高效利用CPU、NPU、GPU和超节点组成的异构算力集群。前置准备工作在开始部署前请确保您的环境满足以下要求Linux操作系统推荐Ubuntu 20.04或CentOS 7GitGo 1.16Docker和Docker Compose单机部署Kubernetes集群1.20集群部署kubectl工具集群部署首先克隆项目代码库git clone https://gitcode.com/openeuler/yuanrong-frontend cd yuanrong-frontend单机快速部署方案安装依赖组件单机部署需要安装Prometheus和Grafana作为监控组件Ubuntu/Debian:# 安装Prometheus sudo apt-get update sudo apt-get install -y prometheus # 安装Grafana sudo apt-get install -y software-properties-common sudo add-apt-repository deb https://packages.grafana.com/oss/deb stable main wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - sudo apt-get update sudo apt-get install -y grafanaCentOS/RHEL:# 安装Prometheus sudo yum install -y prometheus # 安装Grafana sudo yum install -y grafana配置和启动服务修改Prometheus配置将targets中的端口改为你的Frontend服务实际端口- targets: [localhost:8888] # 改为实际端口使用脚本快速启动服务cd docs/monitoring ./start-monitoring.sh或者手动启动# 启动Prometheus prometheus --config.fileprometheus.yml --storage.tsdb.path./data --web.listen-address:9090 # 启动Grafana grafana-server --config/etc/grafana/grafana.ini --homepath/usr/share/grafana 验证单机部署访问指标端点http://localhost:8888/metrics应该能看到function_invocations_total等指标访问Prometheushttp://localhost:9090/targets确认yuanrong-frontend目标状态为UP访问Grafanahttp://localhost:3000默认用户名/密码admin/adminDocker Compose部署对于需要更灵活部署的场景可以使用Docker Compose来部署服务栈cd docs/monitoring/docker chmod x start.sh ./start.shDocker Compose配置文件路径docs/monitoring/docker/docker-compose.yml该部署方式会自动启动Prometheus、Grafana、Loki和Tempo等组件形成完整的监控体系。Kubernetes集群部署方案对于生产环境推荐使用Kubernetes集群部署以获得更好的可扩展性和可靠性。前置要求Kubernetes集群 (1.20)kubectl已配置并可以访问集群集群有足够资源建议至少4 CPU, 8GB内存StorageClass已配置用于PVC快速部署cd docs/monitoring/k8s chmod x deploy.sh undeploy.sh # 脚本部署推荐 ./deploy.sh # 或使用Kustomize一键部署 kubectl apply -k .Kustomize配置文件路径docs/monitoring/k8s/kustomization.yaml服务访问方式端口转发测试用kubectl port-forward -n monitoring svc/grafana 3000:3000 kubectl port-forward -n monitoring svc/prometheus 9090:9090 kubectl port-forward -n monitoring svc/loki 3100:3100 kubectl port-forward -n monitoring svc/tempo 3200:3200 访问地址Grafana: http://localhost:3000 admin / adminPrometheus: http://localhost:9090Loki: http://localhost:3100Tempo: http://localhost:3200NodePort访问生产环境kubectl get nodes -o wide # 获取节点IP # Prometheus: http://node-ip:30090 # Grafana: http://node-ip:30300集群部署验证查看所有Pod状态kubectl get pods -n monitoring查看PVC状态kubectl get pvc -n monitoring验证Prometheus配置kubectl exec -n monitoring deployment/prometheus -- \ promtool check config /etc/prometheus/prometheus.ymlGrafana监控配置添加Prometheus数据源登录Grafana后点击左侧菜单Configuration - Data Sources点击Add data source选择PrometheusURL填写:http://prometheus:9090点击Save Test导入仪表板点击左侧菜单Dashboards - Import点击Upload JSON file选择grafana-dashboard.json文件路径docs/monitoring/process/grafana-dashboard.json选择Prometheus数据源点击Import常见问题解决Prometheus权限错误若看到permission denied相关错误切换到initContainer方案kubectl apply -f prometheus-initcontainer.yamlOTel Collector无法读取日志检查节点上/home/yr/log目录是否存在并确认Pod调度到了正确节点kubectl get pod -n monitoring -l appotel-collector -o wide停止服务单机部署./stop-monitoring.sh集群部署./undeploy.sh # 完全清除包括数据 kubectl -n monitoring delete pvc --all kubectl delete namespace monitoring生产环境建议替换grafana-secret.yaml中的默认密码或使用外部Secret管理Vault / ESO为各PVC指定合适的storageClassName配置HorizontalPodAutoscaler或资源配额在Grafana前配置Ingress TLS定期备份Prometheus和Grafana数据通过本指南您可以根据实际需求选择适合的部署方案从单机测试到生产集群环境openYuanrong frontend都能提供稳定可靠的函数服务支持。【免费下载链接】yuanrong-frontendopenYuanrong frontendopenYuanrong 网关支持函数创建、调用等功能项目地址: https://gitcode.com/openeuler/yuanrong-frontend创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考

相关新闻