当前位置: 首页 > article >正文

centos 7.x无法安装kong gateway 3.9X的解决方案

一、问题背景

笔者想在centos7.9上通过yum的方式安装kong gateway 3.9X,安装官网安装指导

 curl -1sLf "https://packages.konghq.com/public/gateway-39/config.rpm.txt?distro=el&codename=$(rpm --eval '%{rhel}')" | sudo tee /etc/yum.repos.d/kong-gateway-39.repo
 sudo yum -q makecache -y --disablerepo='*' --enablerepo='kong-gateway-39'
 sudo yum install -y kong

输出如下信息:

[root@localhost ~]#  sudo yum install -y kong
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
... ...
(1/2): kong-gateway-39-source/primary                                                                                                                                    |  145 B  00:00:01
(2/2): kong-gateway-39-noarch/primary                                                                                                                                    |  145 B  00:00:02
No package kong available.
Error: Nothing to do

发现没有安装上,很是疑惑。后面查阅资料发现,3.9版本已经不支持在centos7.X。版本支持的详情信息见:
链接: kong gateway的版本支持
在这里插入图片描述
从上面的信息来看,对centos系列只有8.X和9.X了。在7.X系列的,最高只支持3.7版本。

二、解决方案

2.1、 升级操作系统到8.X,然后按照官网描述进行安装

2.1.1 安装kong
 curl -1sLf "https://packages.konghq.com/public/gateway-39/config.rpm.txt?distro=el&codename=$(rpm --eval '%{rhel}')" | sudo tee /etc/yum.repos.d/kong-gateway-39.repo
sudo yum -q makecache -y --disablerepo='*' --enablerepo='kong-gateway-39'
sudo yum install -y kong
2.1.2 安装PostgreSQL
# 更新安装的yum源
sudo dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm
#  禁用 CentOS 自带 PostgreSQL 源(避免冲突)
sudo dnf -qy module disable postgresql
# 安装 PostgreSQL(可选最新版本,如 16)
sudo dnf install -y postgresql16-server postgresql16-contrib
# 初始化数据库
sudo /usr/pgsql-16/bin/postgresql-16-setup initdb
# 设置开机自启动
sudo systemctl enable --now postgresql-16
# 配置kong相关的账号
sudo -i -u postgres
psql
CREATE USER kong WITH ENCRYPTED PASSWORD 'kongpass';
CREATE DATABASE kong OWNER kong;
GRANT ALL PRIVILEGES ON DATABASE kong TO kong;
2.1.3 配置kong的启动文件
  #拷贝kong的配置文件
  cp /etc/kong/kong.cnf.default /etc/kong/kong.cnf
  # 修改配置文件
  vi  /etc/kong/kong.cnf
  # 配置数据库相关数据
  database = postgres             # Determines the database (or no database) for
                                # this node
                                # Accepted values are `postgres` and `off`.

pg_host = 127.0.0.1             # Host of the Postgres server.
pg_port = 5432                  # Port of the Postgres server.
pg_timeout = 5000               # Defines the timeout (in ms), for connecting,
                                # reading and writing.

pg_user = kong                  # Postgres user.
pg_password = kongpass          # Postgres user's password.
pg_database = kong              # The database name to connect to.

  
2.1.34 初始化kong
kong migrations bootstrap
2.1.35 启动kong
kong start
2.1.36 测试kong
[root@iZbp1ivu3yaedumdy0va2vZ ~]# curl -X GET http://localhost:8001/services
{"next":null,"data":[]}[root@iZbp1ivu3yaedumdy0va2vZ ~]#

2.2、 使用docker 来进行安装

具体的操作步骤见
链接: 一分钟搞定!在 CentOS 上用 Docker 部署 Kong Gateway 3.9


http://www.kler.cn/a/542557.html

相关文章:

  • 单张照片可生成写实3D头部模型!Adobe提出FaceLift,从单一的人脸图像中重建出360度的头部模型。
  • Flutter PIP 插件 ---- Android
  • 让office集成deepseek,支持office和WPS办公软件!(体验感受)
  • 网易日常实习一面面经
  • Ruby 日期 时间处理指南
  • 【愚公系列】《循序渐进Vue.js 3.x前端开发实践》070-商业项目:电商后台管理系统实战(商品管理模块的开发)
  • 【无人机遥感技术】无人机遥感在农林信息提取中的实现方法与GIS融合应用(如何将无人机真彩色、多光谱和高光谱数据,与农林业应用结合)
  • 【华为OD-E卷 - 119 评论转换输出 100分(python、java、c++、js、c)】
  • Neurlps2024论文解读|Credit Attribution and Stable Compression-water-merged
  • Unity3D MMORPG 任务系统的架构与设计详解
  • 中间件-redis-(ubantu)
  • 聚焦 AUTO TECH China 2025,共探汽车内外饰新未来Automotive Interiors
  • 2025年智慧城市解决方案下载:AI-超脑中台,体系架构整体设计
  • 【ubuntu下验证下菜品识别,训练,部署,验证 CNN + TensorFlow / PyTorch】
  • 14.1 Auto-GPT 项目定位与价值解读:揭开自主智能体的神秘面纱
  • 【CubeMX+STM32】SD卡 U盘文件系统 USB+FATFS
  • 物联网有哪些就业方向?
  • 问卷数据分析|SPSS实操之独立样本T检验
  • 【大数据安全分析】数据传输方式
  • vue知识点2
  • 前端安全问题及防范
  • 分享一款免费的AI大模型字幕工具,支持语音识别、字幕断句、优化、翻译、视频合成等全流程自动处理(支持抖音、B站、油管等国内外多平台视频下载与处理)
  • 宠物咖啡馆平台
  • CSA发布 | 云计算关键领域安全指南v5
  • pytorch笔记:mm VS bmm
  • npm介绍(Node Package Manager)(JavaScript生态中最流行的包管理工具,主要用于Node.js项目的依赖管理)