The topics in this section describe how you can quickly configure and test a single node On-Prem Gateway deployment and a high availability deployment scenario. This section walks you through the following Microgateway deployment scenarios:
- A single node Microgateway deployment.
- A high availability deployment scenario where you have two Microgateway instances fronted by a load balancer.
Tip |
---|
If you want to run the Microgateway on Docker, see Deploying the Microgateway as a Docker Container. |
The following topics provide step-by-step instructions to get started with your Microgateway deployment:
Table of Contents | ||||
---|---|---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
To download and run the Microgateway:
Excerpt | |||||
---|---|---|---|---|---|
|
...
|
...
|
Download
...
a Microgateway instance
Log Sign in to WSO2 API Cloud (https://api.cloud.wso2.com) as an Admin UserIn admin user.
On the API Publisher, click On-Prem GatewaysMicrogateways.
Click Download On-Prem Gateway to
- Click DOWNLOAD MICROGATEWAY to start the download.
- You will receive a notification as shown below, when the download begins.
...
-
Once the Microgateway download completes, you can configure the
...
- Microgateway deployment depending on your use case.
Configure the
...
Microgateway deployment
Expand | |||||
---|---|---|---|---|---|
| |||||
Now you have configured a single On-Prem Gateway Microgateway instance. Next let's The next step is to test the deployment. |
Expand | |||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||||||||
Now you have configured the high availability deployment. Next let's The next step is to test the deployment. |
Anchor | ||||
---|---|---|---|---|
|
Test the deployment
Follow the steps below to test your On-Prem Gateway Microgateway deployment:
- Log Sign in to WSO2 API Cloud and create an API.
- Subscribe to and invoke the API.
Invoke the API using curl .
The curl command to invoke the GET method of the API should be similar to the following:
Code Block curl -k -X GET --header 'Accept: text/xml' --header 'Authorization: Bearer dXNlckBvcmcuY29tQHRlc3RPcmcxMjM6UGFzc3dvcmQ=’ 'https://gateway.api.cloud.wso2.com:443/t/ccc2222/phoneverify/1.0.0/CheckPhoneNumber?PhoneNumber=18006785432&LicenseKey=0'
Replace https
https://gateway.api.cloud.wso2.com:443
in the above curl command with your On-Prem Gateway URL as Microgateway URL as indicated below, and then run it. The response to this curl should be identical to that received in the previous step.
Code Block curl -k -X GET --header 'Accept: text/xml' --header 'Authorization: Bearer dXNlckBvcmcuY29tQHRlc3RPcmcxMjM6UGFzc3dvcmQ=’ 'https://on-premise-gateway-ip:8243/t/ccc2222/phoneverify/1.0.0/CheckPhoneNumber?PhoneNumber=18006785432&LicenseKey=0'
Info infoNote that you can also use the HTTP port for API invocations. The HTTP port number would be 8280 by default. An example is given below.
Code Block curl -X GET --header 'Accept: text/xml' --header 'Authorization: Bearer dXNlckBvcmcuY29tQHRlc3RPcmcxMjM6UGFzc3dvcmQ=’ 'http://on-premise-gateway-ip:8280/t/ccc2222/phoneverify/1.0.0/CheckPhoneNumber?PhoneNumber=18006785432&LicenseKey=0'
When you run multiple On-Prem Gateway instances on the same server or virtual machine (VM), you must change the default port of each Gateway with an offset value to avoid port conflicts. An offset defines the number by which all ports in the runtime (e.g., HTTP/S ports) will be increased. For example, if the default HTTPS port is 8243 and the offset is 1, the effective HTTPS port will change to 8244. For each additional On-Premise Gateway instance that you run in the same server or virtual machine, you have to set the port offset to a unique value. The offset of the default port is considered to be 0.
There are two ways to set an offset to a port:
- Pass the port offset to the server during start up. The following command starts the server with the default port incremented by 1.
Code Block ./wso2server.sh -DportOffset=1
- Set the port offset in the Ports section in the
<ON-PREM_GATEWAY_HOME>/repository/conf/carbon.xml
file as shown below.
Code Block <Offset>1</Offset>
If your request is successful, your response will be similar to the following.
Code Block <?xml version="1.0" encoding="utf-8"?> <PhoneReturn xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://ws.cdyne.com/PhoneVerify/query"> <Company>Toll Free</Company> <Valid>true</Valid> <Use>Assigned to a code holder for normal use.</Use> <State>TF</State> <RC /> <OCN /> <OriginalNumber>18006785432</OriginalNumber> <CleanNumber>8006785432</CleanNumber> <SwitchName /> <SwitchType /> <Country>United States</Country> <CLLI /> <PrefixType>Landline</PrefixType> <LATA /> <sms>Landline</sms> <Email /> <AssignDate>Unknown</AssignDate> <TelecomCity /> <TelecomCounty /> <TelecomState>TF</TelecomState> <TelecomZip /> <TimeZone /> <Lat /> <Long /> <Wireless>false</Wireless> <LRN /> </PhoneReturn>
...