In this tutorial, you will learn how to useOpenResty EdgeTest your gateway configuration changes and push them to the gateway servers in all production environments.
What is a grayscale server
As we know, Edge Admin is responsible for managing and distributing configuration to Edge servers.But distributing major changes directly to all Edge servers may lead to accidents.
To solve this problem, we can mark some Edge servers as grayscale servers.First publish the changes to these grayscale servers, and then publish them to all servers after testing.This is our topic today: grayscale server.
Let's goOpenResty EdgeAdmin Web Console for.This is a sample deployment of our console.Each user has its own local deployment.
Set gateway server as grayscale server
First, let's see how to set the gateway server as a grayscale server.
Click the Gateway Clusters tab to enter the Gateway Clusters page.
We have a gateway cluster with two gateway servers.
Now we will set these two gateway servers as grayscale servers.This can be achieved in two ways.The first is to set the entire gateway cluster as a grayscale cluster.Now let's see how to set it up.
Click to edit the cluster.
There is a switch to set whether a cluster is a grayscale cluster.
The switch is now off.
To set this gateway cluster as a grayscale cluster, you need to turn on this switch.
Click to save this change.
Click the cluster name to enter the server list page.
As you can see from the server list page, these two servers have now been identified as grayscale servers.
Return to the gateway cluster page.
The second method is to directly set a gateway server as a grayscale server.
Click the Edit button again.
Turn off this switch.
You can see that there is a switch under each server to set whether the server is a grayscale server.
Turn on this switch.
Click to save this change.
Click the cluster name.
As you can see, the first server is still a grayscale server.
The second server is no longer a grayscale server.
This is just for the convenience of demonstration.In fact, we do not recommend that a cluster have both grayscale servers and non grayscale servers.Otherwise, the distribution of configuration on the cluster level will cause problems.
Now let's go back to the application list page and see how to publish the changes to the grayscale server.
We can continue to use the previous example application, test-edge.com.
Enter this application.
Create a new page rule to test grayscale publishing.
Click New Page Rule.This rule will return specific content under a specific URI.
First, we add a condition to this rule.
The variable of the condition remains unchanged, that is, the URI.
Select the String=operator.
Input value/testAs the specified URI.
Condition setting is completed.
For the action part of the rule, we can configure an Output response body action.Please note that we chose this action only for the convenience of demonstration.The grayscale server is valid for any configuration.
There are many actions to choose from.
Suggested inputOutputSearch.
Select the action "Output response body".
Select text/plain as the content type.
Enter "Hello World" as the output response body.
Click this option to ensure that the rule is inserted before the existing rule.
Click Create to create this rule.
You can see that this rule has already appeared in the list.
The last step is to publish a new configuration.It will push our changes to the gateway server.
Click this button to make a new release.
Add a comment to this post.
To make a grayscale release, you need to turn on this switch.
All grayscale servers are displayed here.
release.
It is now fully synchronized.
We can still see the changes we just made in the list of unpublished changes.This is because changes are not published to all Edge nodes, but only to grayscale nodes.
The changes we just made can be seen in the list of release history.
As you can see, the publishing type is grayscale publishing.
Test changes on grayscale servers
Now let's enter the gateway cluster list and select the server for testing.
Note that the server whose IP address ends with 226 is a grayscale server.Click to copy this address.
Use this grayscale server
To send the request.
To make the output look clearer, we add a carriage return here.
You can see that Hello World is returned.
Now let's test it with a non grayscale server.Click to copy the server whose IP address ends with 213.
Use this non grayscale server.
You can see that 404 is returned.This means that the changes we just made do not take effect on this server.
About OpenResty Edge
OpenResty EdgeIt is a fully functional gateway software that we independently developed and is most suitable for microservices and distributed traffic.It provides various functions such as page rules, Web Application Firewall (WAF), load balancing, etc.
Zhang Yichun is open sourceOpenResty®Project founder andOpenResty Inc.CEO and founder of the company.
Zhang Yichun (Github ID: agentzh) was born in Jiangsu, China, and now lives in the U.S. Bay Area.He was an advocate and leader of China's early open source technology and culture, and once worked for many internationally renowned high-tech enterprises, such asCloudflareYahoo, Alibaba, the pioneer of "edge computing", "dynamic tracking" and "machine programming", has more than 22 years of programming and 16 years of open source experience. As the leader of open source projects with more than 40 million global domain name users, heOpenResty®High tech enterprises created by open source projectsOpenResty Inc.It is located in the center of Silicon Valley in the United States.Its two main productsOpenResty XRay(UtilizeDynamic trackingTechnology) andOpenResty Edge(The all-purpose gateway software most suitable for microservices and distributed traffic), widely favored by many listed and large enterprises worldwide.Besides OpenResty, Zhang Yichun has contributed more than one million lines of code to many open source projects, including Linux kernel, NginxLuaJIT、GDB、SystemTap、LLVM, Perl, etc., and has written more than 60 open source software libraries.
Follow us
If you like this article, please follow usOpenResty Inc.CorporateBlog Site。You are also welcome to scan our WeChat official account:
translate
We provideEnglish versionOriginal text and Chinese translation (this article).We also welcome readers to provide translations in other languages. As long as the full text translation is not omitted, we will consider using it. Thank you very much!
Related articles
OpenResty XRayMay 8, 2024
OpenResty XRayUpdated on May 17, 2024Estimated reading time: 4 minutes
Enable automatic health check of gateway server in OpenResty Edge
Create a new page rule
Enable health check
test result
About OpenResty Edge
Create a new page rule
Enable health check
test result
About OpenResty Edge
OpenResty XRayApr 28, 2024
OpenResty XRayUpdated on May 6, 2024Estimated reading time: 4 minutes
How to use gateway partition in OpenResty Edge
Create a new partition
Create a new application in the new partition
Create a new page rule
Test the new partition
About OpenResty Edge
Create a new partition
Create a new application in the new partition
Create a new page rule
Test the new partition
About OpenResty Edge
OpenResty XRayDec 4, 2023
OpenResty XRayUpdated on Apr 10, 2024Estimated reading time: 3 minutes
Configure Webhooks in OpenResty Edge
Create a webhook in OpenResty Edge Admin
Trigger this webhook
View the execution history of webhook
Create a webhook in OpenResty Edge Admin
Trigger this webhook
View the execution history of webhook
OpenResty XRayNov 23, 2023
OpenResty XRayUpdated on Apr 10, 2024Estimated reading time: 4 minutes
Configure custom error pages in OpenResty Edge
Custom Template Creation
Application of template
Verification of page rules
Global override rules for error pages
Custom Template Creation
Application of template
Verification of page rules
Global override rules for error pages
OpenResty XRayNov 21, 2023
OpenResty XRayUpdated on Apr 10, 2024Estimated reading time: 4 minutes
Configure DNS records in OpenResty Edge
Add DNS record
Test DNS records
Configure authoritative DNS server
Add DNS record
Test DNS records
Configure authoritative DNS server
Article Contents
Popular articles
OpenResty XRayMay 2, 2016
OpenResty XRayMay 2, 2016
Random talk on dynamic tracking technology
What is dynamic tracking
Advantages of dynamic tracking
DTrace and SystemTap
Application of SystemTap in production
Flame diagram
Methodology
Knowledge is power
Open source and debugging symbols
Linux kernel support
Hardware Tracking
Analysis of the remains of the death process
Traditional debugging technology
A messy debugging world
OpenResty XRay
OpenResty XRaySep 7, 2020
OpenResty XRaySep 7, 2020
Introduction to Lua level CPU flame diagram
What is a flame diagram
Simple Lua sample
Complex Lua applications
Sampling overhead
Security
compatibility
Other types of Lua level flame diagram
OpenResty XRayAug 10, 2020
OpenResty XRayAug 10, 2020
Memory fragmentation in OpenResty and Nginx shared memory areas
Empty shared memory area
Fill similar sized entries
Remove Odd Keys
Delete the key in the first half
Mitigate memory fragmentation
OpenResty XRayAug 4, 2020
OpenResty XRayAug 4, 2020
How does OpenResty and Nginx's shared memory consume physical memory
Slab and memory page
Allocated memory may not be consumed
Spurious memory leak
HUP Reload
OpenResty XRayJan 21, 2020
OpenResty XRayJan 21, 2020
How OpenResty and Nginx allocate and manage memory
System level
Application level
Traditional Nginx server
OPENRESTYApr 25, 2019
OPENRESTYApr 25, 2019
Long term recruitment of outstanding talents
Back end engineer/system engineer
Sales Engineer
Latest articles
OpenResty XRayMay 12, 2024
OpenResty XRayMay 12, 2024
Introduction to OpenResty XRay Mobile Applications
Download and install OpenResty XRay for Android
Log in to OpenResty XRay
Fully automated analysis report
View performance chart data on the dashboard page
Guided analysis function
OpenResty XRayMay 11, 2024
OpenResty XRayMay 11, 2024
Online locating large memory objects in the PHP process (using OpenResty XRay)
Problem: Memory usage is too high
Locating large memory objects or values in the PHP process
Fully automated analysis and reporting
OpenResety EdgeMay 8, 2024
OpenResety EdgeMay 8, 2024
Enable automatic health check of gateway server in OpenResty Edge
Create a new page rule
Enable health check
test result
About OpenResty Edge
OpenResety EdgeApr 28, 2024
OpenResety EdgeApr 28, 2024
How to use gateway partition in OpenResty Edge
Create a new partition
Create a new application in the new partition
Create a new page rule
Test the new partition
About OpenResty Edge
OpenResety EdgeApr 10, 2024
OpenResety EdgeApr 10, 2024
Precisely restore the real client IP address in OpenResty Edge
Set the "Real Source IP Trust Address" and "Real IP Source" in the global configuration
Configure the app to output the client address
Verify the client address received in OpenResty Edge
About OpenResty Edge
Related articles
OpenResety EdgeMay 8, 2024
OpenResety EdgeMay 8, 2024
Enable automatic health check of gateway server in OpenResty Edge