Search


print PDF
Load Balancing IP

DESCRIPTION


Load Balancing IP is carried by the OVH network and distributes the load between the IP addresses of your various services. It gives you better performance, fault tolerance and higher SLA and response time optimized closer to the users through the Anycast technology.

Via the API


Backend IP


To add a backend ip behind the ip loadblancing you must first, retrieve the name of your IP loadlancing service. To use this function:


GET /ip/loadBalancing



Here is an example return:


[

"ip-91.121.59.140",
"ip-37.187.86.25"

]


We have in our example of 2 loadbalancing Ips.



Add ip

We can add backend Ips now:

To use this function:

GET /ip/loadBalancing/{serviceName}/allowedBackends


Here is an example return:


[
- {
ip: "94.23.239.28/32"
type: "dedicated"
}
- {
ip: "91.121.23.123/32"
type: "dedicated"
}
- {
ip: "46.105.10.113/32"
type: "vps"
}
- {
ip: "46.105.55.31/32"
type: "dedicated"
}
- {
ip: "176.31.231.216/32"
type: "dedicated"
}
- {
ip: "178.33.26.208/28"
type: "pcc"
}


]


Here you can see that we can put a dedicated server ips, ips of a vps and dedicated a cloud (PCC).


Now we will add the ip: 91.121.23.123

Use the:


POST /ip/loadBalancing/{serviceName}/backend


with parameters:

serviceName : Load Balancing IP service name retrieved in the first step.
IpBackend : Ip you of the backend.
probe : Check made for your server to receive requests.


Possible values ​​are:

-http ( http server is accessed via a TCP connection on port 80 with a GET request to / if the return is 200 then the server receives requests)
-icmp ( the server responds to the icmp request)
-none ( no verification )
-oco (audit conducted via the probe oco ).



Here is an example return:


{

zone: "rbx"
backend: "91.121.23.123"
probe: "http"

}


Remove IP

Use the following function to retrieve the list of backend IPs:


GET /ip/loadBalancing/{serviceName}/backend


With the parameters:

serviceName : Load Balancing IP service name retrieved in the first step.

Here is an example return:


[

"91.121.23.123"

]


We can remove the IP 91.121.23.123 (note that only the IP backend not used much.)

To use this function:

DELETE /ip/loadBalancing/{serviceName}/backend/{backend}


With the parameters:


serviceName : Load Balancing IP service name retrieved in the first step.
ipBackend : IP you for the backend.


Here is an example of return:


null




SSL Certificate


You can either order an SSL certificate for your domain, or import your SSL certificate for your domain after ordering one provided by OVH.

Note:

When you have ordered the certificate and enable SSL on the ip loabalancing, all requests will be redirected to port 80 and not 443 on your dedicated servers.



Order

You can order an ssl certificate for your Iploadbalancing associated with your domain, it will be automatically configured on the Iploadbalancing.

To order the certificate using the function:

POST /order/ip/loadBalancing/{serviceName}/ssl


With the parameters:

serviceName : service name of your IP loadbalancing, recoverable with the function : GET /ip/loadBalancing)
domain: The domain for which you want an SSL option.


Important:

A confirmation email creation for the certification will be sent to the email address postmaster@yourdomain.tld, it imperative to ensure that this email address exists before the payment of the order



Here is an example return:


{
{

orderId: YYYYYY
url: https://www.ovh.com/cgi-bin/order/displayOrder.cgi?orderId=YYYYYYYY&orderPassword=XXXX
-
details: [
+
{ … }
+
{ … }
]
+
contracts: [ … ]
+
prices: { … }


}



In return you link the order to pay, that is directly click-able.

Thereafter you will receive an email to confirm the creation of the SSL certificate.


Import your SSL certificate

Important:

To install your own certificate you must have previously activated the certificate provided by OVH. For this I invite you to read the previous section. This design has the effect of activating the option for ssl ip Loadbalancing.


To install your certificate using the function:

POST /ip/loadBalancing/{serviceName}/importCustomSsl


With the parameters:

serviceName : Your Service Name Load Balancing IP (recoverable with the function: GET /ip/loadBalancing).
certificate : File contents of your certificate.
chain : File contents of your certification chain.
key : File contents of your private key (deprotected).



Note:

You can use the following command in linux to unprotect your private key:
openssl rsa -in private.key > www.mon-domaine.com.key



My configure servers


On your server, you simply configure your domains on IP that you declared for each backend server.

So in your web server:

On Server A you declare the domain on IP A
On server B you must declare the IP B

In your server logs you can change the log management, change the settings of your web server to add:

LogFormat "%{X-Forwarded-For}i-%h- %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" loadbalancing


Then theVirtualHostput domain:

CustomLog /chemin/fichier.log loadbalancing


Then in the logs of your domains you have this:

213.186.50.98-10.71.9.110- - - [26/Dec/2013:15:49:34 +0100] "GET / HTTP/1.1" 200 302 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Firefox/24.0"


213.186.50.98 ip is the customer in this example.
10.71.9.110 Nat ip loadbalancing in our example.

For your site you can install the apache module for rpaf if you want to retrieve the IP of the client in the variable REMOTE_ADDR instead of Nat ip loadbalancing . Otherwise, the IP is provided in the header of the request with X-Forwarded-For.

To find the ip Nat loabalancing use the function:

GET /ip/loadBalancing/{serviceName}/internalNatIp


With in parameters:


serviceName:Reference ip loadbalancing
Zone:Zone is announced ip loadbalancing.


Example return:

"10.71.9.104/29"