安装 API7 企业版
本教程将引导你使用快速启动脚本在 Docker 中安装 API7 企业版。
安装将包含 API7 企业版组件(数据面、控制面、控制台)以及用于管理配置和监控的外部组件(PostgreSQL 和 Prometheus)。
提示
本指南提供了一个用于概念验证(PoC)测试的容器化一体解决方案,其中包含了 PostgreSQL 和 Prometheus。这无需手动设置数据库和监控,从而简化了你的 PoC 流程。
对于生产环境的部署,API7 企业版也支持其他数据库。经过测试并支持的数据库及其版本如下:
- PostgreSQL: 15, 16, 17, 18
- MySQL: 5.7
- OceanBase: 4.2.2
- Microsoft SQL Server: 2022
部署仅支持通过基于容器的方法(如 Docker)或通过 Kubernetes 等容器编排平台进行。不支持使用 deb 或 rpm 包进行安装。
如需获取高可用性和可扩展性解决方案,请联系 API7 专家申请试用。
先决条件
- 安装 Docker 和 Docker Compose。推荐使用 Docker 3.10.0-927 或更高版本。已知 Docker 3.10.0-327 或更低版本存在不兼容问题。
- 安装 cURL。
- 获取 30 天免费试用许可证。
- 操作系统:推荐使用 Linux CentOS 7.6 或更高版本。已知 Linux CentOS 7.2 或更低版本存在不兼容问题。
安装 API7 企业版
curl -sL "https://run.api7.ai/api7/quickstart" | bash
你应该会看到类似于以下的响应:
✔ Container api7-ee-postgresql
✔ Container api7-ee-prometheus
✔ Container api7-ee-api7-ee-dashboard
✔ Container api7-ee-api7-ee-dp-manager
✔ Container api7-ee-api7-ee-gateway
...
✔ API7-EE is ready!
API7-EE Listening: Dashboard(https://192.168.2.102:7443), Control Plane Address(http://192.168.2.102:7900, https://192.168.2.102:7943), Gateway(http://192.168.2.102:9080, https://192.168.2.102:9443)
If you want to access Dashboard with HTTP Endpoint(:7080), you can turn server.listen.disable to false in dashboard_conf/conf.yaml, then restart dashboard container
安装 ADC(可选)
你还可以安装 API 声明式命令行(ADC)来以声明式方式管理 API7 企业版。
curl -sL "https://run.api7.ai/adc/install" | bash
要验证安装,请运行:
adc help
你应该会看到以下响应:
Usage: adc [options] [command]
Options:
-V, --version output the version number
-h, --help display help for command
Commands:
ping [options] Verify connectivity with backend
dump [options] Dump configurations from the backend
diff [options] Show the difference between local and backend configurations
sync [options] Sync local configurations to backend
convert [options] Convert other API spec to ADC configurations
lint [options] Check provided configuration files, local execution only, ensuring inputs meet ADC requirements
help [command] display help for command
有关可用命令和配置的更多详细信息,请参阅命令参考。
激活 API7 企业版
- 访问 API7 企业版控制台
https://{your_inet_ip_addr}:7443并使用默认的用户名admin和密码admin登录(我们建议在首次登录后更改默认密码)。
信息
你也可以在 https://localhost:7443/login 访问控制台。但是,随后在控制台中生成的部署脚本将默认使用 localhost 作为 IP 地址,这可能会导致连接问题,例如在在 Kubernetes 上部署 API7 网关和 Ingress Controller时。
- 选择你要上传的许可证,然后点击 上传 来激活 API7 企业版。