apisix和apisix-dashboard容器化部署
1.docker安装etcd
docker run -it -p 2379:2379 --env ALLOW_NONE_AUTHENTICATION=yes -d bitnami/etcd
2.安装apisix
docker run -v /config.yaml:/usr/local/apisix/conf/config.yaml -p 9080:9080 -d apache/apisix
修改配置文件对应的ip
apisix:
node_listen: 9080 # APISIX listening port
enable_ipv6: false
allow_admin: # http://nginx.org/en/docs/http/ngx_http_access_module.html#allow
- 0.0.0.0/0 # We need to restrict ip access rules for security. 0.0.0.0/0 is for test.
admin_key:
- name: "admin"
key: edd1c9f034335f136f87ad84b625c8f1
role: admin # admin: manage all configuration data
# viewer: only can view configuration data
- name: "viewer"
key: 4054f7cf07e344346cd3f287985e76a2
role: viewer
etcd:
host: # it's possible to define multiple etcd hosts addresses of the same etcd cluster.
- "http://192.168.211.130:2379" # multiple etcd address
prefix: "/apisix" # apisix configurations prefix
timeout: 30 # 30 seconds
3.安装apisix-dashboard
docker run -d -p 9000:9000 -v /conf.yaml:/usr/local/apisix-dashboard/conf/conf.yaml apisix-dashboard
修改配置文件

遇到ip adress not allowed的问题
解决:修改allow_list对应本机网关
通过源码编译镜像
1.编译apisix需要安装luarocks依赖
$wget http://luarocks.org/releases/luarocks-3.7.0.tar.gz
2.解压缩tar -xzvf luarocks-3.7.0.tar.gz
3.cd luarocks-3.7.0/
4…/configure --prefix=/usr/local/openresty/luajit \ 安装到此目录下
–with-lua=/usr/local/openresty/luajit/
–lua-suffix=jit
–with-lua-include=/usr/local/openresty/luajit/include/luajit-2.1
然后找到
在
其中,
lua
安装路径下的lua.h
的位置,即find / -name "lua.h"
,我的路径是usr/local/lua/src/lua.h
在
usr/local/luarocks
下执行./configure --prefix=/usr/local/luarocks --with-lua-include=/usr/local/lua/src
其中,
predix
是指定LuaRocks 安装路径, with-lua-include
指定lua文件位置,默认为$LUA_DIR/include
5. make build
6. sudo make install
7. vi ~/.bash_profile
8. export PATH=$PATH:/usr/local/openresty/luajit/bin 将此项添加进去
9. source /etc/profile
10. reboot
11.luarocks查看是否安装成功
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构