How to set up a remote MariaDB server
MariaDB server must be running the version corresponding to the relevant Abiquo API server version.
During this process, the Abiquo platform must be offline and there must be no connections to the database server.
MariaDB server must allow connections to the MariaDB port from the Abiquo API server.
This guide explains how to configure the Abiquo Server and the accounting integration with a remote MariaDB server. You must also update any other services that rely on access to Abiquo databases so they continue working.
Description
This guide shows how to configure Abiquo to use a remote MariaDB server, instead of running it locally on the Abiquo Server itself. Using a remote DB server may help to improve the security and performance of the Abiquo platform. In this guide, we will assume that the MariaDB server is already installed and running. And we make the following assumptions for the examples:
MariaDB server administrator credentials as
ADMUSER:ADMPASS
Abiquo API server at IP address
10.60.13.5
MariaDB server at IP address
10.60.13.39
Configure databases in MariaDB server
Depending on when the remote MariaDB server is configured, we will be in one of the situations below:
The API server has been just deployed and there is no data yet in the Abiquo databases. In this case, we need to create new Abiquo databases.
The API server is already being use, and the Abiquo databases have already been used. In this case, we have to import already existing Abiquo databases.
Create new Abiquo databases
The Abiquo DB schemas belong to the abiquo-server package. Import them onto the remote MariaDB server by running the commands below on the Abiquo Server. Adapt them according to your settings:
mysql -uADMINUSER -pADMINPASS -h10.60.13.39 < /usr/share/doc/abiquo-server/database/kinton-schema.sql
mysql -uADMINUSER -pADMINPASS -h10.60.13.39 < /usr/share/doc/abiquo-server/database/src/accounting/kinton_accounting.sql
Import already existing databases
Export the Abiquo databases and import the dump into the remote MariaDB server by adapting the commands below according to your configuration:
mysqldump --routines --triggers --databases kinton kinton_accounting > abiquo.sql
mysql -uADMUSER -pADMPASS -h10.60.13.39 < abiquo.sql
Configure Abiquo credentials
Create a user on the MariaDB server for the Abiquo server and grant it privileges for the Abiquo databases. Modify the commands below according to your settings and run them at the MariaDB server prompt:
create user 'abquser'@'10.60.13.5';
grant all privileges on kinton.* to 'abquser'@'10.60.13.5' identified by 'abqpass';
grant all privileges on kinton_accounting.* to 'abquser'@'10.60.13.5' identified by 'abqpass';
flush privileges;
Configure Abiquo server
Change the DB settings in the abiquoDB
section of /opt/abiquo/tomcat/conf/Catalina/localhost/api.xml
accordingly. In our example:
/opt/abiquo/tomcat/conf/Catalina/localhost/api.xm
Configure accounting stored procedures
See Configure accounting section on Abiquo accounting services integration for full details.
By default, the Abiquo Accounting stored procedures run periodically on the Abiquo Server to update accounting and delete old events. These stored procedures are run by a cron job and access the Abiquo databases. There are two ways to configure this cron job when using a remote MariaDB server:
Modify the default cron job on the Abiquo Server
Create a new cron job on the remote MariaDB server
Modify the default cron job on the Abiquo server
Log in to the Abiquo Server and modify the default cron job at /etc/cron.d/abiquo-accounting
according to your setup. In our example:
Create a new cronjob on the remote MariaDB server
If you do not want to use the standard cron job on the Abiquo server, you can disable it and create a new cron job on the remote MariaDB server. Log in to the remote MariaDB server and create a /etc/cron.d/abiquo-accounting
similar to the one below. Modify the username and password according to your settings. In our example:
Restart Abiquo
Once you have changed all DB related settings, start Abiquo services again on the Abiquo Server:
Copyright © 2006-2024, Abiquo Holdings SL. All rights reserved