apisix 本地开发环境部署

news2024/9/26 1:22:10

apisix 本地开发环境部署

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

apisix 配置文件

apisix:
  node_listen: 9080 # APISIX 节点监听地址
  enable_ipv6: false
  http:
    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: 9092

deployment:
  type: "single" # 部署模式
  admin:
    allow_admin:
      - 0.0.0.0/0
    admin_key:
      - name: "admin" # APISIX Dashboard 管理员用户名
        key: "edd1c9f034335f136f87ad84b625c8f1" # APISIX Dashboard 管理员密码
        role: admin

  etcd:
    host:
      - "http://etcd:2379" # ETCD 集群地址
    timeout: 30 # ETCD 连接超时时间
    prefix: /apisix
    health_check_retry: 2
    tls:
      verify: false

plugins:                           # 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: -4000

stream_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: 2
      drop_on_queue_full: false
      inactive_timeout: 1
      max_export_batch_size: 2
      max_queue_size: 6
    collector:
      address: otel-collector:4318
      request_timeout: 3
    resource:
      service.name: APISIX
    trace_id_source: x-request-id%

apisix-dashboard 配置文件

conf:
  listen:
    host: 0.0.0.0
    port: 9000
  etcd:
    endpoints:
      - http://etcd:2379
    prefix: /apisix

authentication:
  expire_time: 3600
  users:
    - username: admin
      password: admin
    - username: user
      password: user%

dashboard-compose 配置文件

version: '3.8'

services:
  apisix:
    container_name: apisix
    platform: linux/amd64
    restart: always
    image: apache/apisix:latest
    volumes:
      - ./deploy/apisix.yml:/usr/local/apisix/conf/config.yaml:ro
      - ./data/apisix:/data
    ports:
      - 9080:9080
      - 9180:9180
      - 9091:9091
      - 9443:9443
      - 9092:9092
    networks:
      - apisix
  dashboard:
    container_name: apisix-dashboard
    platform: linux/amd64
    image: apache/apisix-dashboard:2.8
    restart: always
    volumes:
      - ./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:/data
    depends_on:
      - etcd
    ports:
      - "9000:9000/tcp"
    networks:
      - apisix

  etcd:
    container_name: etcd
    image: bitnami/etcd:3
    platform: linux/amd64
    volumes:
      - ./data/etcd/data:/bitnami/etcd/data
    environment:
      - ALLOW_NONE_AUTHENTICATION=yes
      - ETCD_ADVERTISE_CLIENT_URLS=http://etcd:2379
    ports:
      - 2379:2379
      - 2380:2380
    networks:
      - 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 在本地部署起来

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2089591.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

《机器学习》K-means 聚类 原理、参数解析、案例实现

1. 引言 随着数据的快速增长和复杂性的不断提高,如何从大量数据中提取有用信息已成为数据科学和人工智能领域的核心挑战。聚类作为一种无监督学习方法,通过将数据分为若干组,使得同一组内的样本具有较高的相似性,而不同组之间的样本差异显著。这种方法被广泛应用于数据分析…

探索极速Python:Sanic框架的魔力

文章目录 探索极速Python&#xff1a;Sanic框架的魔力背景&#xff1a;为什么选择Sanic&#xff1f;Sanic是什么&#xff1f;如何安装Sanic&#xff1f;简单的库函数使用方法场景应用示例常见Bug及解决方案总结 探索极速Python&#xff1a;Sanic框架的魔力 背景&#xff1a;为什…

带你了解RS485通讯网关-天拓四方

在当今工业自动化和智能化的浪潮中&#xff0c;高效、可靠的数据通讯是确保系统运行顺畅的关键。RS485通讯网关作为工业通讯网络中的核心设备&#xff0c;承担着数据传输的重要任务。本文将从RS485通讯网关的技术背景、功能特性、应用场景以及选购要点等方面进行深入探讨&#…

【智能算法应用】基于融合改进A星-麻雀搜索算法求解六边形栅格地图路径规划

目录 1.算法原理2.结果展示3.参考文献4.代码获取 1.算法原理 【智能算法】麻雀搜索算法&#xff08;SSA&#xff09;原理及实现 六边形栅格地图 分析一下地图&#xff1a; 六边形栅格地图上移动可以看做6领域运动&#xff0c;偶数列与奇数列移动方式有所差异&#xff0c;将六…

[每周一更]-(第112期):WDL(Workflow Description Language)说明及使用示例

文章目录 什么是WDL&#xff1f;WDL的基本结构示例 WDL 文件示例任务&#xff1a;字符串反转示例工作流&#xff1a;字符串处理 WDL 文件详解任务&#xff08;Task&#xff09;工作流&#xff08;Workflow&#xff09; 运行示例总结报错参考 什么是WDL&#xff1f; WDL&#x…

Java图形用户界面之Applet设计

Applet设计 前言一、Applet的基本工作原理与使用局限Applet的基本工作原理代码示例 Java Applet 的使用局限Java沙箱安全机制原理 Applet的生命周期与运行方式 二、Applet类Applet类的层次结构常用方法生命周期方法显示方法多媒体支持方法其他方法 三、Applet和GUI基于AWT和Swi…

字符操作函数和内存操作函数

1 字符操作函数 1.strlen size_t strlen ( const char * str ); 函数功能&#xff1a;返回以\0结尾的字符串长度&#xff0c;不包含\0。 注&#xff1a;strlen返回值是一个无符号整数size_t。 #include <stdio.h>int main() {const char*str1 "abcdef";const…

Linux基础软件-selinux库文件swap

作者介绍&#xff1a;简历上没有一个精通的运维工程师。希望大家多多关注作者&#xff0c;下面的思维导图也是预计更新的内容和当前进度(不定时更新)。 Linux进阶部分又分了很多小的部分,我们刚讲完了Linux日常运维。讲的那些东西都算是系统自带的&#xff0c;但是Linux作为一个…

LVGL 控件之圆弧(lv_arc)

目录 一、圆弧部件1、部件组成2、lv_art_t3、圆弧部件角度设置4、圆弧部件旋转设置5、圆弧的模式选择6、圆弧部件的变化率设置7、移除旋钮8、事件9、获取/设置信息相关的 API 二、例程 一、圆弧部件 1、部件组成 圆弧&#xff08;lv_arc&#xff09;部件由三个部分组成&#…

学习之SQL语言之DDL

查询 查询所有数据 SHOW DATABASES&#xff1b; 查询当前数据库 SELECT DATABASE(); 创建 CREATE DATABASE IF NOT EXISTS 数据库名&#xff1b; 删除 DROP DATABASE IF EXISTS 数据库名&#xff1b; 使用 USE 数据库名&#xff1b; 查询当前数据库所有表 SHOW TABLES; 查…

优化大型语言模型微调:MoLA层级专家分配策略

人工智能咨询培训老师叶梓 转载标明出处 大模型&#xff08;LLMs&#xff09;的微调过程中&#xff0c;计算资源的需求巨大&#xff0c;这促使研究者们探索参数高效微调&#xff08;PEFT&#xff09;技术。低秩适应&#xff08;LoRA&#xff09;和专家混合模型&#xff08;MoE…

超分 Real-ESRGAN 使用笔记

效果图 目录 依赖项: 视频推理入口: 图片推理入口文件: RealESRGAN_x4plus 12g显存不够 RealESRGAN_x4plus_anime_6B 的效果 树枝之间产生了蒙版 RealESRNet_x4plus 有点模糊 2022年开源的 GitHub - xinntao/Real-ESRGAN: Real-ESRGAN aims at developing Practical…

操作系统 --王道计算机考研--学习笔记

文章目录 前言第一章 引言1.1 什么是操作系统&#xff1f;1 操作系统作为虚拟机2 操作系统作为资源管理者3 为上层提供服务-- 系统调用 2.操作系统特征与发展分类2.1 操作系统特征1.并发2.共享3.虚拟4.异步 2.2 操作系统发展和分类 3.操作系统的的运行机制和中断异常、系统调用…

vue脚手架的创建

一、安装node环境 切换阿里云镜像 npm config set registry https://registry.npm.taobao.org 2、全局安装vue-cli和webpack 已经安装过node.js之后和淘宝镜像的话&#xff0c;vue的运行环境基本上就搭建好了&#xff0c;只需再安装全局的webpack&#xff08;命令行&#…

【大模型理论篇】RoPE旋转位置编码底层数学原理分析

1. 位置编码对于NLP模型的作用 位置编码&#xff08;Positional Encoding&#xff09;在大模型&#xff08;例如Transformer架构&#xff09;中起到了非常重要的作用。没有位置编码的信息&#xff0c;模型会丧失序列的顺序信息&#xff0c;导致模型退化成一个简单的“词…

物品租赁​​​​​​​|基于SprinBoot+vue的物品租赁​​​​​​​系统(源码+数据库+文档)

物品租赁系统 基于SprinBootvue的物品租赁系统 一、前言 二、系统设计 三、系统功能设计 5.1 系统功能模块 5.2 管理员功能模块实现 四、数据库设计 五、核心代码 六、论文参考 七、最新计算机毕设选题推荐 八、源码获取&#xff1a; 博主介绍&#xff1a;✌️大…

【单片机原理及应用】实验:数码管的中断控制

目录 一、实验目的 二、实验内容 三、实验步骤 四、记录与处理 五、思考 六、成果文件提取链接 一、实验目的 掌握外部中断的工作原理&#xff0c;学习中断编程与程序调试方法。 二、实验内容 【参照图表】 &#xff08;1&#xff09;创建一个包含80C51固件&#xff0c;采用…

汽车乘客热舒适度大挑战,如何利用仿真技术提高汽车环境舒适度

舒适性在人们选择汽车的决定性方面占比越来越重&#xff0c;而汽车乘员舱环境的舒适性是指为乘员提供舒适愉快便利的乘坐环境与条件&#xff0c;包括良好的平顺性、车内的低噪声、适宜的空气环境以及良好的驾驶操作性能。 舒适性 经济性 安全性、动力性 典型的乘员舱热舒适性模…

git常见命令行及分支规范

文章目录 GIT常见命令行原理图基本设置初始化和克隆仓库文件管理提交更改查看状态和历史分支管理远程仓库交互高级功能GIT常见分支风格1. 单一主干分支(Single Main Branch)//极少使用优点:缺点:2. 多主干分支(Multiple Main Branches)//个人小型项目采用优点:缺点:3. …

OpenCV Jet颜色映射和HSV颜色空间对比

目录 一、概述 二、Jet颜色空间映射 2.1优势 2.2颜色变化范围 2.3应用场景 三、HSV 颜色空间 3.1优势 3.2颜色分布 3.3应用场景 四、Jet与HSV区别 4.1对比总结 4.2选择建议 OpenCV图像处理与应用实战算法汇总地址&#xff1a; OpenCV 图像处理应用实战算法列表汇总…