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.
Prerequisites
Be sure that you meet the following system requirements before you download and deploy an On-Prem Gateway:
Physical |
For high concurrencies and better performance you can use 4 Cores. Disk space is based on the expected storage requirement calculated by considering file uploads and backup policies. |
---|---|
Virtual Machine (VM) |
~ 512 MB heap size. This is generally sufficient to process typical SOAP messages but the requirements vary with larger message sizes and the number of messages processed concurrently. |
EC2 |
|
Download an On-Prem Gateway instance
Log in to WSO2 API Cloud (https://api.cloud.wso2.com) as an Admin User
In the API Publisher, click On-Prem Gateways.
- Click Download On-Prem Gateway to start the download.
- You will receive a notification as shown below, when the download begins.
Now you have download a single instance of the On-Prem Gateway. Next you can configure the On-Prem Gateway deployment depending on your use case.
Configure the On-Prem Gateway deployment
Test the deployment
Follow the steps below to test your On-Prem Gateway deployment:
- Log 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:
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://gateway.api.cloud.wso2.com:443 in the above curl command with your On-Prem Gateway URL as indicated below, and run it. The response to this curl should be identical to that received in the previous step.
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'
Note 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.
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.
./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.
<Offset>1</Offset>
If your request is successful, your response will be similar to the following.
<?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>
Now that you understand how to configure a single node deployment as well as a high availability deployment.