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

news/2025/2/9 5:15:14 标签: centos, kong, gateway

一、问题背景

笔者想在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,然后按照官网描述进行安装

kong_27">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;
kong_52">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.

  
kong_74">2.1.34 初始化kong
kong migrations bootstrap
kong_78">2.1.35 启动kong
kong start
kong_82">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.niftyadmin.cn/n/5845525.html

相关文章

自动化测试工具:selenium

🍅 点击文末小卡片 ,免费获取软件测试全套资料,资料在手,涨薪更快 Selenium是一个用于Web应用程序测试的工具。是一个开源的Web的自动化测试工具,最初是为网站自动化测试而开发的,类型像我们玩游戏用的按键…

Java 读取 Word 模板文档并替换内容生成新文档

嘿,朋友们!在实际开发中,经常会遇到需要根据 Word 模板生成特定文档的需求,比如合同、报告等。咱们可以使用 Apache POI 库来读取 Word 模板文档,然后替换其中的指定内容,最后生成新的文档。下面我就详细给…

计算机毕业设计SparkStreaming+Kafka广告推荐系统 广告预测 广告数据分析可视化 广告爬虫 大数据毕业设计 深度学习 机器学习

温馨提示:文末有 CSDN 平台官方提供的学长联系方式的名片! 温馨提示:文末有 CSDN 平台官方提供的学长联系方式的名片! 温馨提示:文末有 CSDN 平台官方提供的学长联系方式的名片! 作者简介:Java领…

vue3学习四

七 标签ref属性 设置标签ref属性&#xff0c;类似于设置标签id。 普通标签 <template name"test4"> <p ref"title" id"title" click"showinfo">VIEW4</p> <View3/><script lang"ts" setup>…

F - Building Roads S

Description Farmer John had just acquired several new farms! He wants to connect the farms with roads so that he can travel from any farm to any other farm via a sequence of roads; roads already connect some of the farms. Each of the N (1 ≤ N ≤ 1,000) …

UnityShader学习笔记——多种光源

——内容源自唐老狮的shader课程 目录 1.光源类型 2.判断光源类型 2.1.在哪判断 2.2.如何判断 3.光照衰减 3.1.基本概念 3.2.unity中的光照衰减 3.3.光源空间变换矩阵 4.点光源衰减计算 5.聚光灯衰减计算 5.1.聚光灯的cookie&#xff08;灯光遮罩&#xff09; 5.2.聚…

MySql数据库SQL编写规范注意事项

MySQL数据库SQL编写规范对于提高代码可读性、增强代码维护性、优化查询性能、减少错误发生、促进标准化和团队协作以及提升开发效率等方面都具有重要意义。因此&#xff0c;在开发过程中应严格遵守SQL编写规范&#xff0c;以确保代码的质量和效率。 以下是 MySQL 数据库 SQL 编…

golang命令大全12--命令速查表

至此&#xff0c;本系列博文已将golang的各种应用场景的命令都介绍了一遍&#xff0c;通过熟练使用这些命令&#xff0c;开发者可以更高效地开发、测试和维护Go项目&#xff0c;同时也能够更好地理解和学习Go语言的特性和最佳实践。因此&#xff0c;掌握Go命令行工具是成为一名…