【网关建设】02-APISIX实战之部署流程

安装部署前置问题

在我的实际工作情况中,对于部署有这么几个硬性的要求:

1. 各个环境的服务器是无法连接外网的,所以没有办法使用在线安装,所以采用的是离线rpm包的方法进行的。

2. 由于生产环境对于root权限管理比较严格,所以要求我们在安装部署的时候,使用root用户进行安装,并确保后续可以使用非root用户进行启动。

关于更多APISIX的基本背景以及参考资料,详情请参考

【网关建设】01-APISIX实战之概要设计

APISIX部署问题汇总

使用RPM离线安装APISIX

本次使用的APISIX版本是2.13

参考官方手册:https://apisix.apache.org/zh/docs/apisix/2.13/how-to-build/

使用本地虚拟机,或者任意可以连接外网的云主机,提前预下载rpm离线包:

sudo mkdir -p apisix
sudo yum install -y https://repos.apiseven.com/packages/centos/apache-apisix-repo-1.0-1.noarch.rpm
sudo yum clean all && yum makecache
sudo yum install -y --downloadonly --downloaddir=./apisix apisix

下载完成后,每次安装时,将rpm包上传到服务器,并执行:

sudo yum install ./apisix/*.rpm

如果提示缺少包依赖,则执行:

rpm -Uvh ./apisix/*.rpm --nodeps --force

root用户安装,非root用户启动

APISIX解决:使用root用户安装,非root用户启动问题,使用root用户RPM包安装完成后,执行如下操作即可:

修改属主属组:

chown -R cfae:cfae /usr/local/apisix/  
chmod -R 775 /usr/local/apisix/  
chown -R cfae:cfae /usr/local/openresty/  
chmod -R 775 /usr/local/openresty/

APISIX 报错汇总

最大文件数报错

[root@bpm-web apisix]# apisix start
/usr/local/openresty/luajit/bin/luajit /usr/local/apisix/apisix/cli/apisix.lua start
Warning! Current maximum number of open file descriptors [1024] is too small, please increase user limits by execute 'ulimit -n <new user limits>' , otherwise the performance is low.
Warning! Request etcd endpoint 'http://127.0.0.1:2379/version' error, connection refused, retry time=1
Warning! Request etcd endpoint 'http://127.0.0.1:2379/version' error, connection refused, retry time=2
request etcd endpoint 'http://127.0.0.1:2379/version' error, connection refused

原因:系统open files设置太少

解决方法:

vim /etc/security/limits.conf

在limits.conf追加两行:

soft nofile 65536
hard nofile 65536

再次启动apisix即可

DNS is Empty

1、编辑DNS配置文件

vim /etc/resolv.conf

2、添加DNS配置信息:

nameserver 47.106.30.119

3、然后执行重启

systemctl restart network

某些生产环境的DNS配置文件是由脚本生成,无法永久修改并生效

解决方案:直接修改配置文件,不重启network服务,临时修改完成后,直接执行sudo apisix init 即可

下一节:【网关建设】03-APISIX实战之插件使用

以上就是帖子的全部内容啦,关注我,我会定期更新,期待与你的共同进步!

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值