所有安装的资源可以在https://apisix.apache.org/downloads/
去查看, 如果需要通过docker安装请查看:
http://www.hdget.com/docker-install-config-apisix/
一、 安装etcd
etcd是一个分布式的key-value数据库,apisix的配置保存在etcd上,支持热加载和更新, 可以在https://github.com/etcd-io/etcd/releases/
上找到最新稳定版本的etcd
ETCD_VER=v3.5.7
wget https://github.com/etcd-io/etcd/releases/download/${ETCD_VER}/etcd-${ETCD_VER}-linux-amd64.tar.gz
tar xzvf etcd-${ETCD_VER}-linux-amd64.tar.gz
cp etcd*/etcd etcd*/etcdctl /usr/local/bin/
二、启动etcd
nohup etcd > /var/log/etcd.log 2>&1 &
三、 安装apisix
这里选择的apisix版本为LTS版本,当前最新的LTS版本为2.15.2,具体可以去github上查看对应的tags
yum install -y https://repos.apiseven.com/packages/centos/apache-apisix-repo-1.0-1.noarch.rpm
yum install -y apisix-2.15.2
四、安装apisix dashboard
当前apisix-dashboard v2.15.0支持apisix 2.15.x
rpm -ivh https://github.com/apache/apisix-dashboard/releases/download/v2.15.0/apisix-dashboard-2.15.0-0.el7.x86_64.rpm
五、 初始化apisix
下面命令会初始化apisix和openresty
- apisix:
/usr/local/apisix/
- openresty:
/usr/local/openresty/
# apisix init
六、 配置apisix
修改/usr/local/apisix/conf/config.yaml
, 这里都默认用apisix缺省的监听端口,做了最小化的变更
apisix:
admin_key:
- name: admin
key: 替换成自己的key
role: admin
etcd:
host:
- http://127.0.0.1:2379
六、启动apisix和apisix-dashboard
systemctl restart apisix
curl http://127.0.0.1:9080/apisix/admin/routes?api_key=<admin_key> -i
systemctl start apisix-dashboard