2
votes

In WSO2 ,there is 5 components(Key Manager, Gateway, Publisher, Developer Portal, and Traffic Manager),I want to Separate Gateway to another vm ,but the Tutorials on their official website
(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) only show how to Separate five component to 5 vm.

I hava try to Run the remaining 4 components on the same machine,but Port conflict error occurred.So I want to know how to only separate Gateway to another vm. anyone can put some suggestions?

1

1 Answers

1
votes

This is possible. If you are starting 2 servers in a single VM, you will get port conflicts. You can avoid this by giving a port offset to one of the servers. The default offset is 0. You can set this offset to 1 in repository/conf/deployment.toml under the server element.

[server]
offset=1

Let's assume you have 2 servers and server 1 is the all in one node except gateway and the second server is the gateway. You can follow the distributed setup guide and focus only the following sections.

  1. From the API Publisher and the Devportal, you should point to the gateway. So you can follow [1] and configure server 1 to connect to server 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. From the gateway, it should connect to the traffic manager and key manager. So follow [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