安装APISIX服务

1、先安装依赖服务

#安装 epel, luarocks 需要它

wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -ivh epel-release-latest-7.noarch.rpm

#添加 OpenResty 源

yum install yum-utils
yum-config-manager --add-repo \
https://openresty.org/package/centos/openresty.repo

#安装 OpenResty, etcd 和 编译工具

yum install -y etcd openresty curl git gcc luarocks lua-devel

#开启 etcd server

systemctl start etcd

如果在访问过程中遇到访问不到的问题可以,可以试着关闭一下防火墙和selinux

#防火墙关闭

systemctl stop firewalld.service
systemctl disable firewalld.service

#关闭selinux

setenforce 0
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config

2、安装APISIX

yum install -y https://github.com/apache/incubator-apisix/releases/download/1.3/apisix-1.3-0.el7.noarch.rpm

启动和关闭apisix

apisix start
apisix stop

查看服务是否启动
查看进程或者监听端口9080

#查看进程

ps aux|grep apisix

#查看端口

netstat -lntp|grep 9080

3、测试

http://127.0.0.1:9080/apisix/dashboard/#/login

admin / 123456

附录

高版本已经内置apisix-dashboard控制台,无需额外安装

  • 7
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
部署 Apache APISIX 集群可以分为以下步骤: 1. 安装 Docker 和 Docker Compose 在两台 CentOS 7 服务器上安装 Docker 和 Docker Compose。 2. 创建 Docker 镜像 在每台服务器上创建一个 Apache APISIX 的 Docker 镜像,可以使用官方提供的 Dockerfile 或者自定义 Dockerfile。 3. 编写 Docker Compose 配置文件 在一个文件夹下创建 docker-compose.yml 文件,配置两个节点的 Apache APISIX 服务,示例文件如下: ``` version: "3" services: apisix-node1: image: apache/apisix:2.9-alpine container_name: apisix-node1 ports: - "9080:9080" - "9443:9443" volumes: - /etc/localtime:/etc/localtime:ro restart: always command: ["sh", "-c", "exec /usr/local/apisix/bin/apisix start && tail -f /dev/null"] apisix-node2: image: apache/apisix:2.9-alpine container_name: apisix-node2 ports: - "9081:9080" - "9444:9443" volumes: - /etc/localtime:/etc/localtime:ro restart: always command: ["sh", "-c", "exec /usr/local/apisix/bin/apisix start && tail -f /dev/null"] ``` 4. 启动 Docker 容器 使用 Docker Compose 启动 Apache APISIX 容器: ``` docker-compose up -d ``` 5. 配置负载均衡 使用负载均衡器对两个节点的 Apache APISIX 服务进行负载均衡配置。 6. 测试 Apache APISIX 集群 使用 Apache Benchmark 工具或其他压测工具对 Apache APISIX 集群进行性能测试。 以上是部署 Apache APISIX 集群的基本步骤,需要注意的是,集群部署需要考虑数据同步和负载均衡等问题,需要进行详细规划和测试。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

BUG弄潮儿

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值