Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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
titleTips
  • You can easily find cacerts files by simple executing:
    # find / -iname cacerts
  • It's highly recommended make a copy/backup of the cacerts file before adding/removing certificates
  • Note that default password for a JVM truststore is changeit. Also note you may need to adjust paths for both keytool command and cacerts truststore depending on your java version.

 

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:

Code Block
# curl -k -u admin:xabiquo --silent -X GET https://abiquo.example.com/api/login

{"links":[{"title":"Abiquo","rel":"enterprise","type":"application/vnd.abiquo.enterprise+json","href":"https://abiquo.example.com:443/api/admin/enterprises/1"},{"title":"CLOUD_ADMIN","rel":"role","type":"application/vnd.abiquo.role+json","href":"https://abiquo.example.com:443/api/admin/roles/1"},{"title":"CLOUD_ADMIN","rel":"edit","type":"application/vnd.abiquo.user+json","href":"https://abiquo.example.com:443/api/admin/enterprises/1/users/1"},{"title":"virtual machines","rel":"virtualmachines","type":"application/vnd.abiquo.virtualmachines+json","href":"https://abiquo.example.com:443/api/admin/enterprises/1/users/1/action/virtualmachines"},{"title":"pending tasks","rel":"pendingtasks","type":"application/vnd.abiquo.tasks+json","href":"https://abiquo.example.com:443/api/admin/enterprises/1/users/1/action/pendingtasks"},{"title":"applications","rel":"applications","type":"application/vnd.abiquo.applications+json","href":"https://abiquo.example.com:443/api/admin/enterprises/1/users/1/applications"}],"id":1,"name":"Cloud","nick":"admin","locale":"en_US","surname":"Administrator","active":true,"email":"","description":"Main administrator","authType":"ABIQUO"}

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.