OCI Load Balancer: Listener-Backend Port translation Part-II
This is in continuation to my previous blog, explaining the use case and how to achieve it.
In this blog, we will learn how to create a Load Balancer with Multiple Listeners and each listener with one backend set, where the listener port and the backend port will be different.
The architecture we are trying to achieve is as below:
Pre-Requisites:
- You have full access on the compartment where you are trying to create Load Balancer.
- A VCN already created
- All policies are in place to create Load Balancer
- OIC Instance is provisioned and you have access to the same.
- Users created for individual users.
- You have full access on the OIC Instance.
Set up Load Balancer with Multiple Listeners with 1 backend set each
- In OCI Console, go to Networking → Load Balancer and click on Create.
- Give a name to Load Balancer, be it Public and choose the bandwidth you need.
3. Now, choose the VCN where you want to create the LB, choose subnet to be public and click Next
4. Now, choose Protocol as TCP and populate the Port of your Vendor1 SFTP server in Port. In my case it is 5017 and click Next
5. Now, choose the protocol as TCP on Listener and port as 1000 (you can give any other port of your choice) and click Next
6. In the next screen, choose log group and click Submit. This completes load balancer creation. Now, let us add backend to the backend set created.
7. Click on the Load Balancer created, scroll down to Backend sets on the left side, click on it and click on the backend set name.
8. Now, click on Backends on the left, click on Add backends, select IP Addresses option, populate the Vendor SFTP Host & Port as below and click Add
9. Now, any call on LB IP on port 1000 will translate to 192.29.105.170:5017 and call that SFTP server.
10. To add more listeners and backends. On the Load Balancer page, scroll down and click on Backend Sets. Then click on create Backend Set, populate Health Check as in Step 4 and click on Create backend set. Then click on Listeners on the left, click on Create listener and complete Listener setup as shown in Step 5. Then add backend to new backend set as shown in step 8.
11. Repeat Step 10 for any number of Listeners & backends. But, keep in mind the Service Limits for OCI Load Balancer Listeners/Backend sets/Backends before you start provisioning. You can get the limit from Oracle documentation here.
NOTE: For the purpose of this blog I am creating a Public Load Balancer.
Now, let us try connecting these from Winscp (showing this over creating a connection in OIC as this is easy).
This completes connecting to all the three backend SFTP servers using Load Balancer Host & Port
!! Happy Reading !!