天翼云上搭建apisix

一、申请ecs资源

创建弹性云主机ECS,根据自己的需要评估申请的大小,此处以天翼云centos7.6版本,规格4C8G举例
在这里插入图片描述

二、安装apisix及apisix-dashboard

1. 安装 OpenResty 和 Apache APISIX 的 RPM 仓库
yum install -y https://repos.apiseven.com/packages/centos/apache-apisix-repo-1.0-1.noarch.rpm
2. 安装apisix
#安装最新的 apisix 软件包
yum install apisix -y
3. 安装etcd

可以从https://github.com/etcd-io/etcd/releases搜索对应的版本,根据文档描述获取下载链接

本文以etcd-v3.4.13-linux-amd64.tar.gz为例;

###下载
curl -L https://storage.googleapis.com/etcd/v3.4.13/etcd-v3.4.13-linux-amd64.tar.gz -o /tmp/etcd-v3.4.13-linux-amd64.tar.gz
###创建目录
mkdir /tmp/etcd
###解压文件
tar xzvf /tmp/etcd-v3.4.13-linux-amd64.tar.gz -C /tmp/etcd --strip-components=1
###进入解压缩目录
cd /tmp/etcd
###备份文件
cp -a etcd etcdctl /usr/bin/
###启动etcd
nohup etcd >/tmp/etcd.log 2>&1 &
###显示是否启动成功
netstat -lntp| grep 2379

在这里插入图片描述

4. 配置apisix

去除ip访问限制

cd /usr/local/apisix/conf/
vim config-default.yaml

在这里插入图片描述

开启日志切割功能

在这里插入图片描述

调整日志切割间隔周期(此处设置一天),开放可以访问的ip给prometheus(若有必要)

在这里插入图片描述

systemctl start apisix

netstat -lnpt | grep 9080

在这里插入图片描述

5. 安装apisix-dashboard
yum -y install apisix-dashboard-2.10.1-0.el7.x86_64.rpm

cd /usr/local/apisix/dashboard/conf/

vim conf.yaml

去除访问限制

在这里插入图片描述

systemctl start apisix-dashboard

netstat -lnpt | grep 9000

在这里插入图片描述

6. 开通弹性公网ip

将公网ip绑定到对应的ecs服务器上
在这里插入图片描述

7.开放入站端口

在访问控制-安全组下创建安全组
在这里插入图片描述
在入方向规则下添加9000端口
在这里插入图片描述

8.访问apisix dashboard验证安装结果

访问http://公网ip:9000出现以下页面即可登陆dashboard
默认用户名密码为admin/admin

在这里插入图片描述

参考资料:
https://apisix.apache.org/zh/docs/apisix/install-dependencies
https://apisix.apache.org/zh/docs/apisix/how-to-build
https://github.com/apache/apisix-dashboard/blob/master/docs/en/latest/install.md

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值