OCI Load Balancer in front of Oracle Integration Cloud File Server
Oracle Integration Cloud provides a File Server as part of every instance. Customers use it for file based integration pattern. You can learn all about OIC File Server here in the documentation.
I recently came across a requirement where customer wanted to setup a load balancer in front of the file server. There can be many reasons for this, one common reason is when you are setting up a Disaster Recovery setup, where you will setup a secondary OIC instance and setup load balancer in front of two File Servers with a common hostname for files to seamlessly transfer to the active instance. In my case customer wanted a different IP address and port number than what comes by default when you activate the OIC file server. Whatever the reason be, the steps of setting up a load balancer in front will be similar and today we will look at the step by step guide of that.
OIC File Server
In case you have not yet enabled file server with OIC, please follow the steps provided here. It’s free and comes with 500 GB of space so why not. We need to capture the IP Address and Port Number. Log in to your OIC instance go to Settings -> File Server -> Settings and you capture these details.
My File Server IP Address starts with 138 and the Port Number is 5013.
I am assuming you know how to setup users and can connect with File Server, if not please refer to the documentation.
Setting up VCN
Now, I am no networking expert but for our Load Balancer we need a VCN with a public subnet as we will be hosting our load balancer in the public subnet. For setting up the VCN, I will be using the wizard option that sets up a VCN with private and public subnet and do all the basic setup like Gateways, Security Lists etc. You can work with your Networking team and design the network manually as per your specific requirements.
Log in to your tenancy and go to Networking -> Virtual Cloud Network
Next we will click on Start VCN Wizard and select Create VCN with Internet Connectivity.
Wizard guides you through the next steps, you just provide the information like VCN Name, CIDR range for VCN, Public and Private Subnet. I have chosen most things default.
Once done review and click Create and in few seconds you will have your VCN created.
We just need to make one change and that is to add a routing rule in our public subnet route table and establish a rule to connect to File Server Public IP Address via NAT Gateway This is a requirement as documented in the OCI Load Balancer documentation section of Backend Server. If we do not do this, the Load Balancer Backend Server Health check will not pass and our load balancer will throw a connection failure error. Here is the note from the load balancer documentation.
Go to your VCN -> Public Subnet and Click on associated Route Table
We need to add a route rule.
Target Type – NAT Gateway
Destination CIDR – <File Server Public IP Address>/32 (/32 would mean just this single IP Address)
Target NAT Gateway – Select the available NAT Gateway that was created by the wizard
Before we proceed to creating the load balancer, lets have quick look at the Security List rules associated with the public subnet.
The wizard creates these three rules, here we have port 22 open so in our load balancer, I will be selecting this port. If I want to use a different port for my listener, I will have to add a security list rule to open that port. Now this is not a networking blog, but rest assured you have full control on restricting access using the security rules. Let’s proceed?with creating the load balancer.
领英推荐
Creating Load Balancer
Go to Networking -> Load Balancer and click Create Load Balancer
For our requirements, we will be creating the Load Balancer and Not Network Load Balancer.
First we need to provide the basic details like load balancer name. We need a public Load balancer, selecting Ephemeral IP Address, default shape for this i.e. 10 MBPS, it can be altered as per your requirement and at the bottom selecting the VCN and Public Subnet created in our last section
Next on Backends, you may choose the Load Balancing Policy as per your requirement. For me as I have only one File Server, it really does not matter but when you are fronting a load balancer to multiple backend servers select the appropriate policy per your needs.
We will not add a backend now but we will set the Health Check.
For Protocol select TCP and port provide the port of your File Server. As my OIC File Server port is 5013, that is what I have entered here. Rest on health check interval, timeout, retries I have left the default values here.
Next we setup the Listener
Select TCP and port 22, remember in our security list this is the port that is open, if you provide a different port make sure to change the security list rules.
Next you can enable Error and Audit logs and click submit.
It will take a couple of minutes before creating and activating your Load Balancer but in the overall Health you will find it says incomplete
This is because we have not yet created the backend set pointing to our OIC File Server. So let’s do that.
In resources menu at the bottom left, lets click on the Backend Set. We have a single back end set.
Now click on Backends and Add Backend
Here select IP Addresses option and in IP Address provide your OIC File Server IP Address and the File Server Port and click Add.
Now that we have completed the Load Balancer setup. After a few seconds the health check will start automatically and you will see the status of the Load Balancer changing from Incomplete to Pending and finally after a few second to OK.
This means the load balancer is configured successfully. Now you can use the Public IP Address of the Load Balancer and the Listener Port i.e. 22 in our case and use this to connect to OIC File Server. This is a different IP Address and Port than our OIC File Server and that is what we wanted to achieve.. I can test it using any sFTP client like WinSCP.
Conclusion
Today we went through a step by step guide on setting up the load balancer for OIC File Server. One of the great things about working with Oracle Integration Cloud is the Oracle Cloud Infrastructure ecosystem and services. From OCI AI Services, OCI Streaming (Kafka) based services, Autonomous Databases, Server-less Functions, OCI Logging, OCI API Gateway, OCI Load Balancer and the list just continues. Whatever your requirements are we are able to meet them and provide easy steps for you to integrate and maximize business value.