apisix 本地开发环境部署

2024-08-31 04:20

本文主要是介绍apisix 本地开发环境部署,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

apisix 本地开发环境部署

本地开发环境部署可以采用 docker-compose 部署,配置文件如下

apisix 配置文件

apisix:node_listen: 9080 # APISIX 节点监听地址enable_ipv6: falsehttp:port: 9080 # APISIX HTTP 端口#https:#  port: 9443 # APISIX HTTPS 端口#  ssl_cert: /usr/local/apisix/ssl/apisix.crt # APISIX HTTPS 证书#  ssl_cert_key: /usr/local/apisix/ssl/apisix.key # APISIX HTTPS 证书密钥log:level: debug # APISIX 日志级别ouput: ./data/apisix/logs/apisix.log # APISIX 日志输出路径control:ip: "0.0.0.0"port: 9092deployment:type: "single" # 部署模式admin:allow_admin:- 0.0.0.0/0admin_key:- name: "admin" # APISIX Dashboard 管理员用户名key: "edd1c9f034335f136f87ad84b625c8f1" # APISIX Dashboard 管理员密码role: adminetcd:host:- "http://etcd:2379" # ETCD 集群地址timeout: 30 # ETCD 连接超时时间prefix: /apisixhealth_check_retry: 2tls:verify: falseplugins:                           # plugin list (sorted by priority)- request-id                     # priority: 12015- zipkin                         # priority: 12011#- skywalking                    # priority: 12010- opentelemetry                 # priority: 12009- ext-plugin-pre-req             # priority: 12000- fault-injection                # priority: 11000- mocking                        # priority: 10900- serverless-pre-function        # priority: 10000#- batch-requests                # priority: 4010- cors                           # priority: 4000- ip-restriction                 # priority: 3000- ua-restriction                 # priority: 2999- referer-restriction            # priority: 2990- csrf                           # priority: 2980- uri-blocker                    # priority: 2900- request-validation             # priority: 2800- chaitin-waf                    # priority: 2700- multi-auth                     # priority: 2600- openid-connect                 # priority: 2599- cas-auth                       # priority: 2597- authz-casbin                   # priority: 2560- authz-casdoor                  # priority: 2559- wolf-rbac                      # priority: 2555- ldap-auth                      # priority: 2540- hmac-auth                      # priority: 2530- basic-auth                     # priority: 2520- jwt-auth                       # priority: 2510- jwe-decrypt                    # priority: 2509- key-auth                       # priority: 2500- consumer-restriction           # priority: 2400- forward-auth                   # priority: 2002- opa                            # priority: 2001- authz-keycloak                 # priority: 2000#- error-log-logger              # priority: 1091- proxy-cache                    # priority: 1085- body-transformer               # priority: 1080- proxy-mirror                   # priority: 1010- proxy-rewrite                  # priority: 1008- workflow                       # priority: 1006- api-breaker                    # priority: 1005- limit-conn                     # priority: 1003- limit-count                    # priority: 1002- limit-req                      # priority: 1001#- node-status                   # priority: 1000#- brotli                        # priority: 996- gzip                           # priority: 995- server-info                    # priority: 990- traffic-split                  # priority: 966- redirect                       # priority: 900- response-rewrite               # priority: 899- degraphql                      # priority: 509- kafka-proxy                    # priority: 508#- dubbo-proxy                   # priority: 507- grpc-transcode                 # priority: 506- grpc-web                       # priority: 505- public-api                     # priority: 501- prometheus                     # priority: 500- datadog                        # priority: 495- loki-logger                    # priority: 414- elasticsearch-logger           # priority: 413- echo                           # priority: 412- loggly                         # priority: 411- http-logger                    # priority: 410- splunk-hec-logging             # priority: 409- skywalking-logger              # priority: 408- google-cloud-logging           # priority: 407- sls-logger                     # priority: 406- tcp-logger                     # priority: 405- kafka-logger                   # priority: 403- rocketmq-logger                # priority: 402- syslog                         # priority: 401- udp-logger                     # priority: 400- file-logger                    # priority: 399- clickhouse-logger              # priority: 398- tencent-cloud-cls              # priority: 397- inspect                        # priority: 200#- log-rotate                    # priority: 100# <- recommend to use priority (0, 100) for your custom plugins- example-plugin                 # priority: 0#- gm                            # priority: -43- aws-lambda                     # priority: -1899- azure-functions                # priority: -1900- openwhisk                      # priority: -1901- openfunction                   # priority: -1902- serverless-post-function       # priority: -2000- ext-plugin-post-req            # priority: -3000- ext-plugin-post-resp           # priority: -4000stream_plugins:                    # stream plugin list (sorted by priority)- ip-restriction                 # priority: 3000- limit-conn                     # priority: 1003- mqtt-proxy                     # priority: 1000#- prometheus                    # priority: 500- syslog                         # priority: 401# <- recommend to use priority (0, 100) for your custom plugins# wasm:
#   plugins:
#     - name: wasm_log
#       priority: 7999
#       file: t/wasm/log/main.go.wasm# xrpc:
#   protocols:
#     - name: pingpong
plugin_attr:opentelemetry:batch_span_processor:batch_timeout: 2drop_on_queue_full: falseinactive_timeout: 1max_export_batch_size: 2max_queue_size: 6collector:address: otel-collector:4318request_timeout: 3resource:service.name: APISIXtrace_id_source: x-request-id%

apisix-dashboard 配置文件

conf:listen:host: 0.0.0.0port: 9000etcd:endpoints:- http://etcd:2379prefix: /apisixauthentication:expire_time: 3600users:- username: adminpassword: admin- username: userpassword: user%

dashboard-compose 配置文件

version: '3.8'services:apisix:container_name: apisixplatform: linux/amd64restart: alwaysimage: apache/apisix:latestvolumes:- ./deploy/apisix.yml:/usr/local/apisix/conf/config.yaml:ro- ./data/apisix:/dataports:- 9080:9080- 9180:9180- 9091:9091- 9443:9443- 9092:9092networks:- apisixdashboard:container_name: apisix-dashboardplatform: linux/amd64image: apache/apisix-dashboard:2.8restart: alwaysvolumes:- ./deploy/apisix-dashboard.yml:/usr/local/apisix-dashboard/conf/conf.yaml:ro- ./deploy/apisix-dashboard/schema.json:/usr/local/apisix-dashboard/conf/schema.json- ./data/dashboard:/datadepends_on:- etcdports:- "9000:9000/tcp"networks:- apisixetcd:container_name: etcdimage: bitnami/etcd:3platform: linux/amd64volumes:- ./data/etcd/data:/bitnami/etcd/dataenvironment:- ALLOW_NONE_AUTHENTICATION=yes- ETCD_ADVERTISE_CLIENT_URLS=http://etcd:2379ports:- 2379:2379- 2380:2380networks:- apisix
networks:apisix:driver: bridge
  • 其中,在 dashboard-compose 新建 deploy 文件存放 apisix-dashboard.yml 和 apisix.yml 文件,deploy/apisix-dashboard 存放 schema.json 这个schema.json 是 apisix-dashboard 的插件配置文件
  • 在 /data/etcd/data 下存放 etcd配置文件,配置文件如下
name: 'etcd'
data-dir: '/bitnami/etcd/data'
listen-client-urls: 'http://0.0.0.0:2379'
advertise-client-urls: 'http://etcd:2379'
listen-peer-urls: 'http://0.0.0.0:2380'
initial-advertise-peer-urls: 'http://etcd:2380'
initial-cluster: 'etcd=http://etcd:2380'
initial-cluster-token: 'etcd-cluster'
initial-cluster-state: 'new'

最终我们的目录结构

在这里插入图片描述

使用 docker-compose -f dashboard-compose-local.yaml up -d 将apisix 在本地部署起来

这篇关于apisix 本地开发环境部署的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1122869

相关文章

Spring Boot集成/输出/日志级别控制/持久化开发实践

《SpringBoot集成/输出/日志级别控制/持久化开发实践》SpringBoot默认集成Logback,支持灵活日志级别配置(INFO/DEBUG等),输出包含时间戳、级别、类名等信息,并可通过... 目录一、日志概述1.1、Spring Boot日志简介1.2、日志框架与默认配置1.3、日志的核心作用

SpringBoot多环境配置数据读取方式

《SpringBoot多环境配置数据读取方式》SpringBoot通过环境隔离机制,支持properties/yaml/yml多格式配置,结合@Value、Environment和@Configura... 目录一、多环境配置的核心思路二、3种配置文件格式详解2.1 properties格式(传统格式)1.

使用IDEA部署Docker应用指南分享

《使用IDEA部署Docker应用指南分享》本文介绍了使用IDEA部署Docker应用的四步流程:创建Dockerfile、配置IDEADocker连接、设置运行调试环境、构建运行镜像,并强调需准备本... 目录一、创建 dockerfile 配置文件二、配置 IDEA 的 Docker 连接三、配置 Do

PyQt5 GUI 开发的基础知识

《PyQt5GUI开发的基础知识》Qt是一个跨平台的C++图形用户界面开发框架,支持GUI和非GUI程序开发,本文介绍了使用PyQt5进行界面开发的基础知识,包括创建简单窗口、常用控件、窗口属性设... 目录简介第一个PyQt程序最常用的三个功能模块控件QPushButton(按钮)控件QLable(纯文本

Go语言编译环境设置教程

《Go语言编译环境设置教程》Go语言支持高并发(goroutine)、自动垃圾回收,编译为跨平台二进制文件,云原生兼容且社区活跃,开发便捷,内置测试与vet工具辅助检测错误,依赖模块化管理,提升开发效... 目录Go语言优势下载 Go  配置编译环境配置 GOPROXYIDE 设置(VS Code)一些基本

基于Python开发一个图像水印批量添加工具

《基于Python开发一个图像水印批量添加工具》在当今数字化内容爆炸式增长的时代,图像版权保护已成为创作者和企业的核心需求,本方案将详细介绍一个基于PythonPIL库的工业级图像水印解决方案,有需要... 目录一、系统架构设计1.1 整体处理流程1.2 类结构设计(扩展版本)二、核心算法深入解析2.1 自

MySQL 主从复制部署及验证(示例详解)

《MySQL主从复制部署及验证(示例详解)》本文介绍MySQL主从复制部署步骤及学校管理数据库创建脚本,包含表结构设计、示例数据插入和查询语句,用于验证主从同步功能,感兴趣的朋友一起看看吧... 目录mysql 主从复制部署指南部署步骤1.环境准备2. 主服务器配置3. 创建复制用户4. 获取主服务器状态5

Windows环境下解决Matplotlib中文字体显示问题的详细教程

《Windows环境下解决Matplotlib中文字体显示问题的详细教程》本文详细介绍了在Windows下解决Matplotlib中文显示问题的方法,包括安装字体、更新缓存、配置文件设置及编码調整,并... 目录引言问题分析解决方案详解1. 检查系统已安装字体2. 手动添加中文字体(以SimHei为例)步骤

Java JDK1.8 安装和环境配置教程详解

《JavaJDK1.8安装和环境配置教程详解》文章简要介绍了JDK1.8的安装流程,包括官网下载对应系统版本、安装时选择非系统盘路径、配置JAVA_HOME、CLASSPATH和Path环境变量,... 目录1.下载JDK2.安装JDK3.配置环境变量4.检验JDK官网下载地址:Java Downloads

golang程序打包成脚本部署到Linux系统方式

《golang程序打包成脚本部署到Linux系统方式》Golang程序通过本地编译(设置GOOS为linux生成无后缀二进制文件),上传至Linux服务器后赋权执行,使用nohup命令实现后台运行,完... 目录本地编译golang程序上传Golang二进制文件到linux服务器总结本地编译Golang程序