当前位置:网站首页>apisix-Getting Started
apisix-Getting Started
2022-07-31 11:09:00 【m0_67390379】
I. Introduction
(I am new to apisix, many functions and components are not very good, so 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/test
Make 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
边栏推荐
- 分布式事务——分布式事务简介、分布式事务框架 Seata(AT模式、Tcc模式、Tcc Vs AT)、分布式事务—MQ
- [Part 1 of Cloud Native Monitoring Series] A detailed explanation of Prometheus monitoring system
- Experience innovation and iteration through the development of lucky draw mini-programs
- 半个月时间把MySQL重新巩固了一遍,梳理了一篇几万字 “超硬核” 文章!
- KVM虚拟化作业
- Can I find a Go job in 7 days?Learn Go with arrays and pointers
- 准确率(Accuracy)、精度(Precision)、召回率(Recall)和 mAP 的图解
- 2022/7/28
- Many mock tools, this time I chose the right one
- [Virtualization Ecological Platform] Platform Architecture Diagram & Ideas and Implementation Details
猜你喜欢
"JUC Concurrent Programming - Advanced" 06 - Immutability of Shared Models (Design of Immutable Classes | Use of Immutable Classes | Flyweight Pattern)
单点登录的三种方式
【Web技术】1397- 深入浅出富文本编辑器
SQL - Left join, Right join, Inner join
Three ways of single sign-on
unity-shader-2
In half a month, MySQL has been consolidated again, and a tens of thousands of words "super hard core" article has been sorted out!
PyQt5快速开发与实战 9.5 PyQtGraph在PyQt中的应用 && 9.6 Plotly在PyQt中的应用
Master SSR
【虚拟化生态平台】平台架构图&思路和实现细节
随机推荐
突破传统可靠性测试:混沌工程优秀实践
web安全入门-黑苹果MAC系统安装
SQLServer2019 installation (Windows)
透过开发抽奖小程序,体会创新与迭代
内网渗透学习(四)域横向移动——SMB和WMI服务利用
【软件工程之美 - 专栏笔记】33 | 测试工具:为什么不应该通过QQ/微信/邮件报Bug?
unity-shader-2
文件包含漏洞
【虚拟化生态平台】平台架构图&思路和实现细节
分布式id解决方案
初始JDBC 编程
SQLSERVER merges subquery data into one field
KVM virtualization job
《MySQL高级篇》四、索引的存储结构
下课看着文档走回实验室,我重新拾起了遗忘的SQL运算符
CoCube群机器人预览→资讯剧透←
KVM虚拟化作业
1161. 最大层内元素和 (二叉树的层序遍历)
MySQL中JOIN的用法
IBM SPSS Statistics 28软件安装包下载及安装教程