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

相关文章

python常见环境管理工具超全解析

《python常见环境管理工具超全解析》在Python开发中,管理多个项目及其依赖项通常是一个挑战,下面:本文主要介绍python常见环境管理工具的相关资料,文中通过代码介绍的非常详细,需要的朋友... 目录1. conda2. pip3. uvuv 工具自动创建和管理环境的特点4. setup.py5.

Python实例题之pygame开发打飞机游戏实例代码

《Python实例题之pygame开发打飞机游戏实例代码》对于python的学习者,能够写出一个飞机大战的程序代码,是不是感觉到非常的开心,:本文主要介绍Python实例题之pygame开发打飞机... 目录题目pygame-aircraft-game使用 Pygame 开发的打飞机游戏脚本代码解释初始化部

Java使用HttpClient实现图片下载与本地保存功能

《Java使用HttpClient实现图片下载与本地保存功能》在当今数字化时代,网络资源的获取与处理已成为软件开发中的常见需求,其中,图片作为网络上最常见的资源之一,其下载与保存功能在许多应用场景中都... 目录引言一、Apache HttpClient简介二、技术栈与环境准备三、实现图片下载与保存功能1.

Python中使用uv创建环境及原理举例详解

《Python中使用uv创建环境及原理举例详解》uv是Astral团队开发的高性能Python工具,整合包管理、虚拟环境、Python版本控制等功能,:本文主要介绍Python中使用uv创建环境及... 目录一、uv工具简介核心特点:二、安装uv1. 通过pip安装2. 通过脚本安装验证安装:配置镜像源(可

使用Python开发一个现代化屏幕取色器

《使用Python开发一个现代化屏幕取色器》在UI设计、网页开发等场景中,颜色拾取是高频需求,:本文主要介绍如何使用Python开发一个现代化屏幕取色器,有需要的小伙伴可以参考一下... 目录一、项目概述二、核心功能解析2.1 实时颜色追踪2.2 智能颜色显示三、效果展示四、实现步骤详解4.1 环境配置4.

Python使用smtplib库开发一个邮件自动发送工具

《Python使用smtplib库开发一个邮件自动发送工具》在现代软件开发中,自动化邮件发送是一个非常实用的功能,无论是系统通知、营销邮件、还是日常工作报告,Python的smtplib库都能帮助我们... 目录代码实现与知识点解析1. 导入必要的库2. 配置邮件服务器参数3. 创建邮件发送类4. 实现邮件

python获取cmd环境变量值的实现代码

《python获取cmd环境变量值的实现代码》:本文主要介绍在Python中获取命令行(cmd)环境变量的值,可以使用标准库中的os模块,需要的朋友可以参考下... 前言全局说明在执行py过程中,总要使用到系统环境变量一、说明1.1 环境:Windows 11 家庭版 24H2 26100.4061

基于Python开发一个有趣的工作时长计算器

《基于Python开发一个有趣的工作时长计算器》随着远程办公和弹性工作制的兴起,个人及团队对于工作时长的准确统计需求日益增长,本文将使用Python和PyQt5打造一个工作时长计算器,感兴趣的小伙伴可... 目录概述功能介绍界面展示php软件使用步骤说明代码详解1.窗口初始化与布局2.工作时长计算核心逻辑3

pytest+allure环境搭建+自动化实践过程

《pytest+allure环境搭建+自动化实践过程》:本文主要介绍pytest+allure环境搭建+自动化实践过程,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐... 目录一、pytest下载安装1.1、安装pytest1.2、检测是否安装成功二、allure下载安装2.

VS配置好Qt环境之后但无法打开ui界面的问题解决

《VS配置好Qt环境之后但无法打开ui界面的问题解决》本文主要介绍了VS配置好Qt环境之后但无法打开ui界面的问题解决,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要... 目UKeLvb录找到Qt安装目录中designer.UKeLvBexe的路径找到vs中的解决方案资源