Higress离线部署

1.前提条件

检查docker和docker compose是否已经具备 

[root@host151 ~]# docker -v
Docker version 26.1.4, build 5650f9b
[root@host151 ~]# docker compose

Usage:  docker compose [OPTIONS] COMMAND

Define and run multi-container applications with Docker

Options:
      --all-resources              Include all resources, even those not used by services
      --ansi string                Control when to print ANSI control characters ("never"|"always"|"auto") (default "auto")
      --compatibility              Run compose in backward compatibility mode
      --dry-run                    Execute command in dry run mode
      --env-file stringArray       Specify an alternate environment file
  -f, --file stringArray           Compose configuration files
      --parallel int               Control max parallelism, -1 for unlimited (default -1)
      --profile stringArray        Specify a profile to enable
      --progress string            Set type of progress output (auto, tty, plain, quiet) (default "auto")
      --project-directory string   Specify an alternate working directory
                                   (default: the path of the, first specified, Compose file)
  -p, --project-name string        Project name

2.获取独立部署包

​​​​​​https://higress.io/standalone/higress-v2.1.5.tar.gz

3.独立部署

上传虚拟机的Centos中解压,并重命名
[root@host151 by]# tar -xvf higress-v2.1.5.tar.gz
[root@host151 by]# mv higress-standalone-2.1.5 higress

换到bin目录,执行configure编译,弹出选择nacos,端口自定义
[root@host151 by]# cd higress/bin
[root@host151 bin]# ./configure.sh 
==== Configure Config Storage ====
Please select a configuration storage (file/nacos): nacos
Use built-in Nacos service (Y/N): Y
==== Configure Ports to be used by Higress ====
Please input the local HTTP port to access the built-in Nacos service [8848]: 18848
Please input the local HTTP port to access Higress Gateway [80]: 10080
Please input the local HTTPS port to access Higress Gateway [443]: 10443 
Please input the local metrics port to be listened by Higress Gateway [15020]: 
Please input the local port to access Higress Console [8080]: 18080
==== Build Configurations ==== 
Starting built-in Nacos service...

直接执行完成,提示Higress is configured successfully.

启动Higress,自动拉取镜像包部署
[root@host151 bin]# /by/higress/bin/startup.sh
WARN[0000] /by/higress/compose/docker-compose.yml: `version` is obsolete 
[+] Running 74/51
 ✔ console Pulled                                                                                                                                             180.1s 
 ✔ gateway Pulled                                                                                                                                             110.5s 
 ✔ loki Pulled                                                                                                                                                 39.5s 
 ✔ prometheus Pulled                                                                                                                                          185.7s 
 ✔ controller Pulled                                                                                                                                           17.8s 
 ✔ grafana Pulled                                                                                                                                             127.5s 
 ✔ apiserver Pulled                                                                                                                                           133.4s 
 ✔ pilot Pulled                                                                                                                                                31.7s 
 ✔ promtail Pulled 

[+] Running 14/14
 ✔ Network higress_higress-net     Created                                                                                                                             0.1s 
 ✔ Container higress-nacos-1       Started                                                                                                                             1.2s 
 ✔ Container higress-precheck-1    Exited                                                                                                                              9.0s 
 ✔ Container higress-apiserver-1   Healthy                                                                                                                            49.3s 
 ✔ Container higress-prepare-1     Exited                                                                                                                             30.2s 
 ✔ Container higress-controller-1  Healthy                                                                                                                            49.2s 
 ✔ Container higress-loki-1        Healthy                                                                                                                            49.2s 
 ✔ Container higress-console-1     Healthy                                                                                                                            49.2s 
 ✔ Container higress-pilot-1       Healthy                                                                                                                            49.2s 
 ✔ Container higress-gateway-1     Healthy                                                                                                                            49.2s 
 ✔ Container higress-promtail-1    Started                                                                                                                            48.6s 
 ✔ Container higress-prometheus-1  Healthy                                                                                                                            49.1s 
 ✔ Container higress-grafana-1     Healthy                                                                                                                            52.1s 
 ✔ Container higress-postcheck-1   Started                                                                                                                            52.7s 

Higress is now started. You can check out its status by executing /by/higress/bin/status.sh

Higress Gateway is listening on:
  http://0.0.0.0:10080
  https://0.0.0.0:10443
Visit Higress Console: http://localhost:18080/

查看镜像包

[root@host151 ~]# docker images
REPOSITORY                                                          TAG       IMAGE ID       CREATED         SIZE
higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/higress        2.1.4     f4c49da9343d   3 weeks ago     192MB
higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/api-server     0.0.23    92fd99887fc6   3 weeks ago     120MB
higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/console        2.1.4     9920df8f224f   3 weeks ago     517MB
higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/gateway        2.1.4     51da25dfa27f   3 weeks ago     1.18GB
higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/pilot          2.1.4     fd7f4a06b021   3 weeks ago     181MB
higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/nacos-server   v3.0.1    2dde287b1800   6 weeks ago     447MB
higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/loki           2.9.4     652b79950756   17 months ago   74.6MB
higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/promtail       2.9.4     1c7475004f2f   17 months ago   198MB
higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/runner         0.0.3     b0f1b78ffe82   23 months ago   95.5MB
higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/grafana        9.3.6     f925787d0f79   2 years ago     317MB
higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/prometheus     v2.40.7   b816c2dd5971   2 years ago     223MB

### Higress 私有化部署方法 Higress 是一款开源的服务网格和 API 网关解决方案,支持多种应用场景下的流量管理和微服务治理。对于私有化部署,官方文档提供了详细的指导[^1],并结合实际案例展示了其灵活性和可扩展性。 #### 一、环境准备 在开始部署之前,需确保目标环境中已具备以下条件: - Kubernetes 集群:Higress 支持主流版本的 Kubernetes 平台。 - Helm 工具:用于简化应用的安装与升级过程。 - Ingress Controller 权限:集群管理员应授予必要的权限以允许 Higress 正常工作。 具体操作步骤如下所示: ```bash # 安装 Helm (如果尚未安装) curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash # 添加 Higress Chart 仓库 helm repo add higress https://higress.io/charts # 更新本地 Chart 缓存 helm repo update ``` 以上命令会初始化 Helm 环境,并准备好后续所需的资源文件[^1]。 --- #### 二、核心组件配置 Higress 的私有化部署主要涉及以下几个模块: 1. **API Gateway**: 负责处理外部请求并与内部服务通信。 2. **Service Mesh**: 提供更细粒度的服务间调用控制能力。 3. **Dashboard UI**: 可视化的管理界面,便于运维人员监控状态及调整参数设置。 针对不同场景可以选择启用部分或全部功能。例如,在仅作为网关使用的场合下,可以关闭 Service Mesh 组件来减少开销[^4]。 以下是自定义安装的一个简单例子: ```yaml global: enableIstio: false # 是否开启 Istio 功能,默认为 true;此处设为 false 表示禁用 service mesh controller: replicaCount: 2 # 设置控制器副本数量以提高可用性 gateway: type: LoadBalancer # 使用负载均衡器暴露公网 IP 地址 ``` 保存上述内容到 `values.yaml` 文件后执行以下指令完成定制化安装: ```bash helm install my-release higress/higress -f values.yaml --namespace higress-system --create-namespace ``` 此过程中可以根据实际情况修改各项参数值以适配具体的生产需求[^1]。 --- #### 三、高级选项说明 为了进一步提升系统的稳定性和性能表现,还可以考虑引入一些额外措施: - 数据持久化:通过 Volume Claims 将日志记录等重要数据存储至远程磁盘中以防丢失; - 自动伸缩策略:依据实时访问量动态增减 Pod 实例数从而达到最佳性价比平衡点; - 定期备份计划:制定周期性的快照方案以便快速恢复因意外事故而损坏的数据结构。 这些附加特性通常需要借助第三方工具或者编写 Shell Script 才能实现自动化维护流程[^2]。 --- ### 总结 综上所述,Higress 的私有化部署既可以通过标准方式迅速启动基础框架,也能灵活应对复杂业务提出的更高层次的要求。建议初次使用者先熟悉基本概念再逐步探索更多可能性[^3]。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值