...
Make sure the jvmRoute parameter is different in each host as this will be used by Apache tomcat to route requests to each host.
To do that, edit the /opt/abiquo/tomcat/conf/server.xml file inside the tomcat directory and edit the following values:
Code Block |
---|
<Engine name="Catalina" defaultHost="localhost" jvmRoute="node1"> |
You need to import LoadBalancer's Apache SSL certificate and CA into Java truststore in order to enable API complete SSL connections to API endpoints. In case you are using a self-certificate for testing purposes, it will be enough importing the SSL certificate
This should be done in every node running the API webapp:
Code Block |
---|
# echo -n | openssl s_client -connect abiquo.example.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > abiquo.example.com.cert # /usr/java/default/bin/keytool -import -file abiquo.example.com.cert -keystore /path/to/cacerts # /usr/java/default/bin/keytool -import -trustcacerts -file /path/to/ca/ca.pem -alias CA_ALIAS -keystore /path/to/cacerts |
Tip | ||
---|---|---|
| ||
|
Restart tomcat after the change to apply new configuration.
Now, accessing access your balancer IP at https://abiquo.example.com/ui/ or https://abiquo.example.com/api/, will balance requests . Requests between the two backend nodes will be adequately balanced.
Tip | ||
---|---|---|
Check the API balancing with the following curl command:
Make sure the href links returned by the curl API call point to the correct location. Otherwise, check your configuration again. |
Other setups
The configuration example described in this document covers the setup of a balanced API and Abiquo UI cluster but you can change node distribution and LoadBalancer configuration to provide different setups depending on your requirements. For example, you may want to provide separate nodes for Abiquo UI and Abiquo API or maybe you may want just to cluster Abiquo UI and provide a single and shared Abiquo API node, etc.