在 wso2 API-Management 中,如何只将网关分离到另一个 vm?

In wso2 API-Management,how to only separate Gateway to another vm?

在 WSO2 中,有 5 个组件(Key Manager、Gateway、Publisher、Developer Portal 和 Traffic Manager),我想将网关分离到另一个 vm,但是他们官方网站上的教程
( https://apim.docs.wso2.com/en/latest/install-and-setup/setup/distributed-deployment/deploying-wso2-api-m-in-a-distributed-setup/#step-1-install-and-configure-wso2-api-m) 仅展示如何将五个组件分离到 5 个 vm。

我尝试 运行 同一台机器上的其余 4 个组件,但端口冲突错误 occurred.So 我想知道如何只将网关分离到另一个 vm。谁能提出一些建议?

这是可能的。如果您在单个 VM 中启动 2 个服务器,您将遇到端口冲突。您可以通过为其中一台服务器提供端口偏移来避免这种情况。默认偏移量是0,你可以在server元素下的repository/conf/deployment.toml中将这个偏移量设置为1。

[server]
offset=1

假设您有 2 台服务器,服务器 1 是除网关之外的所有节点,第二台服务器是网关。您可以遵循分布式设置指南并仅关注以下部分。

  1. 从 API Publisher 和 Devportal,您应该指向网关。所以你可以按照 [1] 并配置服务器 1 连接到服务器 2。
[[apim.gateway.environment]]
name = "Production and Sandbox"
type = "hybrid"
display_in_api_console = true
description = "This is a hybrid gateway that handles both production and sandbox token traffic."
show_as_token_endpoint_url = true
service_url = "https://[SERVER_2_IP]:[SERVER_2_PORT]/services/"
username= "${admin.username}"
password= "${admin.password}"
ws_endpoint = "ws://[API-Gateway-Host-or-IP]:9099"
wss_endpoint = "wss://[API-Gateway-Host-or-IP]:8099"
http_endpoint = "http://[API-Gateway-Host-or-IP]:${http.nio.port}"
https_endpoint = "https://[API-Gateway-Host-or-IP]:${https.nio.port}"
  1. 从网关,它应该连接到流量管理器和密钥管理器。所以按照 [2].

[1] - https://apim.docs.wso2.com/en/latest/install-and-setup/setup/distributed-deployment/deploying-wso2-api-m-in-a-distributed-setup/#step-63-configure-and-start-the-api-publisher

[2] - https://apim.docs.wso2.com/en/latest/install-and-setup/setup/distributed-deployment/deploying-wso2-api-m-in-a-distributed-setup/#step-65-configure-and-start-the-gateway