安装 etcd,使用如下命令:
# 安装 etcd
$ yum install -y etcd
# 启动 etcd
$ service etcd start
安装 APISIX,使用如下命令:
友情提示:这里我们安装的 APISIX 的版本是 1.2 版本。
最新版本的,可以从《APISIX 官方文档 —— 构建 Apache APISIX》获取。
# 安装 APISIX
$ yum install -y https://github.com/apache/incubator-apisix/releases/download/1.2/apisix-1.2-0.el7.noarch.rpm
# 启动 APISIX
$ apisix start
此时,APISIX 安装在 /usr/local/apisix/ 目录,使用如下命令:
$ cd /usr/local/apisix/
$ ls -ls
total 40
4 drwxr-xr-x 8 root root 4096 May 1 20:40 apisix # APISIX 程序
4 drwx------ 2 nobody root 4096 May 1 20:44 client_body_temp
4 drwxr-xr-x 3 root root 4096 May 1 20:50 conf # 配置文件
4 drwxr-xr-x 6 root root 4096 May 1 20:40 dashboard # APISIX 控制台
4 drwxr-xr-x 5 root root 4096 May 1 20:40 deps
4 drwx------ 2 nobody root 4096 May 1 20:44 fastcgi_temp
4 drwxrwxr-x 2 root root 4096 May 1 20:44 logs # 日志文件
4 drwx------ 2 nobody root 4096 May 1 20:44 proxy_temp
4 drwx------ 2 nobody root 4096 May 1 20:44 scgi_temp
4 drwx------ 2 nobody root 4096 May 1 20:44 uwsgi_temp
默认情况下,APISIX 启动在 9080 端口,使用如下命令:
$ curl http://127.0.0.1:9080/
{“error_msg”:“failed to match any routes”}
=================================================================================
APISIX 内置控制台功能,方便我们进行 APISIX 的 Route、Consumer、Service、SSL、Upstream 的查看与维护。如下图所示:
APISIX 控制台
在 /usr/local/apisix/conf/nginx.conf 配置文件中,设置了 APISIX 控制台的访问路径为 /apisix/dashboard。如下图所示: