apisix部署
2、使用rpm部署apisix,官网还有docker、helm、deb、源码等方式部署,详情参看官网:https://apisix.apache.org/docs/apisix/installation-guide/。
yum install -y yum-utils yum install -y https://repos.apiseven.com/packages/centos/apache-apisix-repo-1.0-1.noarch.rpm yum-config-manager --add-repo https://repos.apiseven.com/packages/centos/apache-apisix.repo yum install -y apisix
3、修改apisix配置
假设这里部署的是etcd集群模式,需要tls验证。
3.1、创建etcd证书目录,复制server证书到该目录
mkdir /usr/local/apisix/etcd/ssl
scp etcd1:/data/etcd/ssl/*.pem .
3.2、修改apisix配置文件。
mv /usr/local/apisix/conf/config.yaml /usr/local/apisix/conf/config.yaml.bak cat > /usr/local/apisix/conf/config.yaml << EOF apisix: ssl: ssl_trusted_certificate: /usr/local/apisix/etcd/ssl/ca.pem deployment: role: traditional role_traditional: config_provider: etcd admin: admin_key: - name: admin key: edd1c9f034335f136f87ad84b625c8f2 role: admin etcd: host: - "https://192.168.110.12:2379" - "https://192.168.110.13:2379" - "https://192.168.110.15:2379" prefix: /apisix timeout: 30 watch_timeout: 50 startup_retry: 2 tls: cert: /usr/local/apisix/etcd/ssl/server.pem key: /usr/local/apisix/etcd/ssl/server-key.pem verify: true EOF
4、启动apisix,设置为开机启动。
systemctl start apisix systemctl enable apisix
5、验证apisix服务启动是否成功。
curl "http://127.0.0.1:9080" --head | grep Server Server: APISIX/3.9.1
标签:部署,yum,usr,etcd,local,apisix From: https://www.cnblogs.com/NanZhiHan/p/18367438