...
As you can see, this is very similar to the command to check that HAproxy is working, but this time we are connecting to the virtual IP, which is supplied by Keepalived, to check Keepalived.
...
Changes to API
...
and UI
To make the Abiquo API use the virtual IP, log in to the server and do the following steps:
Go to the configuration folder:
Code Block cd /opt/abiquo/tomcat/conf/Catalina/localhost/
Edit the
api.xml
fileRemove configuration that uses the services nodes:
driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://ip1.example.com:3306,ip2.example.com:3306,ip3.example.com:3306/kinton?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8"/>
Add the virtual IP configuration:
driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://"VirtualIP":3306/kinton?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8"/>
Check the default configuration in this format.Code Block <Context> <Resource name="jdbc/abiquoDB" auth="Container" type="javax.sql.DataSource" factory="com.zaxxer.hikari.HikariJNDIFactory" dataSourceClassName="org.mariadb.jdbc.MariaDbDataSource" connectionTimeout="120000" maximumPoolSize="100" username="${server.database.username}" password="${server.database.password}" dataSource.url="jdbc:mariadb://${server.database.host}:${server.database.port}/kinton" /> </Context>
Remove the ${server.database.host} and replace it with the virtual IP
Code Block dataSource.url="jdbc:mariadb://${virtual.ip}:${database.port}/kinton"
Restart the tomcat service
Code Block service abiquo-tomcat restart
...