当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
interrupt()、interrupted()和isInterrupted()你真的懂了吗
MySQL multi-table association one-to-many query to get the latest data
canvas 像素操作(图片像素操作)
Detailed explanation of mysql stored procedure
Centos7.9+mysql8.0开启指定IP远程连接数据库
大屏UI设计-看这一篇就够了
数据湖:流计算处理框架Flink概述
MySQL导入sql文件的三种方法
【MLT】MLT多媒体框架生产消费架构解析(一)
UE4 事件图表不小心拉了很远,找不到一开始创建的节点
The practice of alibaba, data synchronization component canal
12 reasons for MySQL slow query
AMQP协议详解
Google Chrome(谷歌浏览器)安装使用
Navicat报错:1045-Access denied for user [email protected](using passwordYES)
Jmeter使用多线程测试web接口
【HCIE】NO.45 Hub and Spoke配置案例
【疑问】最终推荐的loose pattern 如果依赖module 没有加载完毕,行为如何,是否报错
prisma使用mongodb副本集群报错引发的一些列问题
UE4 创建开始游戏界面UI









