Skip to main content

Version: 3.3.0

Synchronize Services between Gateway Groups

Synchronizing published service versions between gateway groups is a helpful part of API version control. For example:

  1. When using gateway groups to isolate environments, such as test and production, you can synchronize a service version from test to production, after all tests are passed.
  2. If you are using gateway groups to separate business segments, such as regions or teams, synchronizing a service can help distribute the service across multiple gateway groups.
note
  • Synchronizing keeps the service version the same between gateway groups, while publishing creates a new service version each time.

Prerequisites

  1. Install API7 Enterprise.
  2. Configure two gateway groups - one for the initial test environment and another as the final destination (e.g., production environment) - each with at least one gateway instance.
  3. Publish a service version in the initial gateway group for test environment.

Steps

  • When publishing or synchronizing the same service version to different gateway groups, you can use different upstream addresses to correspond to the backend services in different environments.
  • Service in "No Version" state can also be synchronized to other gateway groups. After synchronization, both gateway groups will have a same version number for the service.
  • You can only synchronize the currently running service versions, not the older ones.

Using Upstream Nodes

  1. Select Published Services of your initial gateway group from the side navigation bar, then click the service version you want to synchronize, for example, httpbin with version 1.0.0.
  2. Click the button next to Enable/Disable at the page header, then select Sync to Other Gateway Group.
  3. From the dialog box, do the following:
  • In the Gateway Group field, choose your destination gateway group, for example, Production Group, and then click Next.
  1. From the dialog box, do the following:
  • In the How to find the upstream field, choose Use Nodes.
  • Click Add Node. From the dialog box, do the following:
    • In the Host and Port fields, enter httpbin.org as the host and 80 as the port.
    • In the Weight field, use the default value 100.
    • Click Add.
  • Confirm the service information and then click Sync.

Using Service Discovery

  1. Select Published Services of your initial gateway group from the side navigation bar, then click the service version you want to synchronize, for example, httpbin with version 1.0.0.
  2. Click the button next to Enable/Disable at the page header, then select Sync to Other Gateway Group.
  3. From the dialog box, do the following:
  • In the Gateway Group field, choose your destination gateway group, for example, Production Group, and then click Next.
  1. From the dialog box, do the following:
  • In the How to find the upstream field, choose Use Service Discovery.
  • In the Service Registry field, choose Registry for Production, as well as the Namespace and service name in the Registry.
  • Confirm the service information and then click Sync.

Validate the APIs in Production Group

Send a request to validate the API:

# Replace with your production group address.
curl "http://127.0.0.1:9080/headers"

You should see the following response:

{
"headers": {
"Accept": "*/*",
"Host": "httpbin.org",
"User-Agent": "curl/7.74.0",
"X-Amzn-Trace-Id": "Root=1-6650ab7e-32c90eba787abbeb4e3dbb0c",
"X-Forwarded-Host": "127.0.0.1"
}
}

Additional Resources


API7.ai Logo

API Management for Modern Architectures with Edge, API Gateway, Kubernetes, and Service Mesh.

Product

API7 Cloud

SOC2 Type IIISO 27001HIPAAGDPRRed Herring

Copyright © APISEVEN PTE. LTD 2019 – 2024. Apache, Apache APISIX, APISIX, and associated open source project names are trademarks of the

Apache Software Foundation