Centos部署Kong
服务器
ssh user@47.x.x.x 123456+
安装Kong
官方文档
sudo yum update -ysudo yum install -y wget
wget https://bintray.com/kong/kong-rpm/rpm -O bintray-kong-kong-rpm.repo
export major_version=`grep -oE "[0-9]+.[0-9]+" /etc/redhat-release | cut -d "." -f1`
sed -i -e "s/baseurl.*/&/centos/"$major_version""/ bintray-kong-kong-rpm.repo
sudo mv bintray-kong-kong-rpm.repo /etc/yum.repos.d/
sudo yum update -y
sudo yum install -y kong
安装postgresql
官方文档
dnf install https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpmdnf -qy module disable postgresql
dnf install postgresql96-server
安装位置:
`/usr/pgsql-9.6/bin`
配置数据库目录:
sudo su - postgres #要切换用户来启动initdb -D /mnt/data/pgsql/data #初次配置
pg_ctl -D /mnt/data/pgsql/data -l logfile start #启动数据库
psql -U postgres
数据迁移
sudo /usr/local/bin/kong migrations bootstrap [-c /etc/kong/kong.conf]
Kong配置
插件安装位置:/usr/local/share/lua/5.1/kong/plugins/配置文件位置:/etc/kong/kong.conf
1.安装相关依赖库
sudo /usr/local/bin/luarocks install lua-resty-kafka
2.更改配置文件
sudo vim /etc/kong/kong.confplugins = bundled,router-by-jwt-claim,jwt-blacklist,kafka-log
3.上传插件
scp -r kong/plugins/* user@47.94.101.44:kong-plugins/ #本地机器cp ~/kong-plugins/* /usr/local/share/lua/5.1/kong/plugins/ #服务器
4.启动
sudo /usr/local/bin/kong start [-c /etc/kong/kong.conf]
以上是 Centos部署Kong 的全部内容, 来源链接: utcz.com/z/519115.html