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

ops/2025/2/13 5:10:04/

一、问题背景

笔者想在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.reposudo 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.ppmy.cn/ops/157050.html

相关文章

Elasticsearch 就业形势

聊聊 Elasticsearch 在就业市场的现状和前景。Elasticsearch 作为一种强大的搜索和分析引擎,近年来受到了越来越多企业和开发者的青睐。下面我们就来详细探讨一下 Elasticsearch 的就业形势。 Elasticsearch 就业形势 1. 市场需求概况 技术趋势推动需求增长 随着…

基于深度学习的人工智能量化衰老模型构建与全流程应用研究

一、引言 1.1 研究背景与意义 1.1.1 人口老龄化现状与挑战 人口老龄化是当今全球面临的重要社会趋势之一,其发展态势迅猛且影响深远。根据联合国的相关数据,1980 年,全球 65 岁及以上人口数量仅为 2.6 亿,到 2021 年,这一数字已翻番,达到 7.61 亿,而预计到 2050 年,…

DeepSeek关联WPS使用指南与案例解析

在数字化办公时代,人工智能(AI)技术正深刻地改变着我们处理文档、分析数据和进行创意表达的方式。DeepSeek作为新兴的AI技术代表,与办公软件巨头WPS的结合,为用户带来了前所未有的高效办公体验。本教程将深入探讨如何将…

基于 SpringBoot3 的 SpringSecurity6 + OAuth2 自定义框架模板

前言: 本人独立参考多个视频、项目以及官方文档,耗时7天将大致模板编写完成;如果有补充或者不足,请留言,希望多多支持! 🔖Gitee 项目地址: 基于SpringBoot3的 SpringSecurity6 OAu…

基于keepalived+GTID半同步主从复制的高可用MySQL集群

文章目录 项目架构图项目名称项目环境项目描述ip地址规划项目步骤一.安装好8台全新的centos7.9的系统,关闭firewalld和selinux,配置每台主机的静态ip地址,设置每台主机对应的主机名。1、关闭firewalld2.关闭seLinux3.配置每台主机静态ip地址4…

Chatbox+阿里云免费秘钥打造专属自己的deepseek桌面客户端

一、阿里云百炼创建免费api秘钥 地址:阿里云登录 - 欢迎登录阿里云,安全稳定的云计算服务平台 二、Chatbox自定义模型提供方 1、设置 2、添加 3、配置 API模式: OpenAI API兼容(默认不需要修改) 名称: …

deepseek本地部署和使用(Linux虚拟机)

下载安装Ollama 关于Ollama 在部署deepseek之前,需要首先安装Ollama。那么,Ollama是啥呢?是一个专注于本地运行大型语言模型(LLM)的工具,旨在简化 LLM 的部署和使用。它支持多种开源模型(访问…

蓝桥杯真题 - 像素放置 - 题解

题目链接:https://www.lanqiao.cn/problems/3508/learning/ 个人评价:难度 3 星(满星:5) 前置知识:深度优先搜索 整体思路 深搜,在搜索过程中进行剪枝,剪枝有以下限制条件&#xf…