当前位置:网站首页>apisix-Getting Started
apisix-Getting Started
2022-08-02 06:09:00 【web15286201346】
I. Introduction
(I am new to apisix, many functions and components are not very good, so I will try the most basic load balancing function)
(1) dashboard-Routes
Routes are entry points for requests, which define matching rules between client requests and services.A route can be associated with a service (Service) and an upstream (Upstream), a service can correspond to a set of routes, and a route can correspond to an upstream object (a set of back-end service nodes). Therefore, each request matching a route will be processed by the gateway.Proxy to the upstream service bound by the route.
Personal understanding: According to different rules and forwarding rules, forward the api request to the corresponding back-end server.
(2) dashboard-upstream
The upstream (upstream) list contains the created upstream services (ie, back-end services), which can target multiple upstream servicesNodes perform load balancing and health checks.
Personal understanding: configure the ip and port of the back-end service and the weight rules and other configurations
Second, configuration
(1) Prepare two back-end services
Because it is a salted fish, temporarily use nginx to open two http services with different ports to test
nginx's reference configuration file
Then create a file and put some content in the file for easy viewing
mkdir -p /usr/share/nginx/801/hellomkdir -p /usr/share/nginx/802/helloecho "801" >>/usr/share/nginx/801/hello/testecho "802" >>/usr/share/nginx/802/hello/testMake sure the nginx configuration file is correct, then start nginx
nginx -tnginx(2) Create an upstream service (upstream)
Name: test
Load Balancing Algorithm: Weighted Round Robin
Upstream Type: Node
Target Node: Hostname 10.0.47.43 Port 801Weight 1
Hostname 10.0.47.43 Port 802 Weight 1
Protocol: http
Other defaults are fine
(3) Create a route
Name: test001
Path/hello/*
Other defaults, next step
Select the upstream service test we just created
Next, do not select any plug-ins, then preview, it should be no problem, click submit
(4) Test
Simply use the curl command to try
10.0.47.42 is the IP address where apisix is deployed
The port is 9080
You can see that 801 and 802 are output respectively (is this successful? Hey)
Three, follow-up
apisix has a lot more content, keep learning
Let me introduce myself first. The editor graduated from Shanghai Jiaotong University in 2013. I worked in a small company and went to big factories such as Huawei and OPPO. I joined Alibaba in 2018, until now.I know that most junior and intermediate java engineers want to upgrade their skills, they often need to explore their own growth or sign up to study, but for training institutions, the tuition fee is nearly 10,000 yuan, which is really stressful.Self-learning that is not systematic is very inefficient and lengthy, and it is easy to hit the ceiling and the technology stops.Therefore, I collected a "full set of learning materials for java development" for everyone. The original intention is also very simple. I hope to help friends who want to learn by themselves but don't know where to start, and at the same time reduce everyone's burden.Add the business card below to get a full set of learning materials
边栏推荐
- MYSQL unique constraint
- 简道云-灵活易用的应用搭建平台
- 单调队列模板 滑动窗口
- "Digital reconstruction of the system, getting the CEO is the first step"
- 迅为RK3568开发板编译Buildroot-全自动编译
- MP更新操作方式
- Android studio connects to MySQL and completes simple login and registration functions
- 合作的小伙伴,缺乏主人翁(owner)意识,好苦恼
- [QNX Hypervisor 2.2用户手册]9.18 unsupported
- MySQL 8.0.29 set and modify the default password
猜你喜欢

MySQL String Concatenation - Various String Concatenation Practical Cases

Detailed explanation of mysql stored procedure

mysql 存储过程详解

Jmeter使用多线程测试web接口

一线大厂软件测试流程(思维导图)详解

go语言中的goroutine(协程)

公司不重视软件测试,新来的阿里P8给我们撰写了测试用例编写规范

interrupt()、interrupted()和isInterrupted()你真的懂了吗

Android Studio 实现登录注册-源代码 (连接MySql数据库)

元宇宙:活在未来
随机推荐
Jmeter使用多线程测试web接口
12 reasons for MySQL slow query
安全测试常见问题
Go语学习笔记 - 处理超时问题 - Context使用 从零开始Go语言
mysql实现按照自定义(指定顺序)排序
mysql练习题
21天学习挑战赛安排
Grid布局介绍
H5接入支付流程-微信支付&支付宝支付
公司不重视软件测试,新来的阿里P8给我们撰写了测试用例编写规范
golang的time包:时间间隔格式化和秒、毫秒、纳秒等时间戳格式输出的方法
MySQL multi-table association one-to-many query to get the latest data
MySQL 用户授权
Mysql 回表
【QT】Qt Creator生成动态库(DLL)并调用
Navicat报错:1045-Access denied for user [email protected](using passwordYES)
AMQP协议详解
ES6——class类实现继承
MES系统物料管理的五大功能,建议收藏
MySQL 5.7升级到8.0详细过程