Configure API Portal multi-datacenter deployment

This topic describes how to deploy API Portal in multiple datacenters using the recommended deployment architecture (Multi-datacenter deployment with shared file system).

Configure the database cluster for multiple datacenters

You must configure a relational database management system (RDBMS) to store API Portal data. Use a RDBMS cluster solution that supports connectivity across geographically distributed datacenters.

Note   You must install and configure the database on each database node in both datacenters before installing and configuring API Portal.

The database cluster has the following requirements in a multi-datacenter production environment:

  • The database must be supported by API Portal. For more information on supported databases, see Software requirements.
  • You must have at least three database nodes per datacenter for high availability (HA). Install the database on each node.
  • Choose a unique name for the database cluster.
  • Do not start any of the databases until the database cluster is fully configured.
  • You must synchronize time on all servers.
  • Renaming a datacenter is not possible, so choose names carefully and determine a naming convention for each datacenter and rack. For example:
    • DC1, DC2
    • RACK1, RACK2, RACK3
  • To avoid firewall issues, you must open the RDBMS ports needed to allow bidirectional communication among the database nodes.

For more details on installing and configuring your database, see MySQL documentation or MariaDB documentation.

Configure the shared file storage

You must set up a shared file system between API Portal instances to keep them synchronized. For better performance, it is recommended to have a local shared file system in each datacenter, and sync the shared file systems between datacenters.

Configure API Portal

After setting up the database cluster, install API Portal. For HA, you must have at least two API Portal instances per datacenter.

Install API Portal in multiple datacenters as a software installation

For HA you must first install API Portal on each node with a separate database schema. Use the already configured database cluster located in the same datacenter for the database schemas. After all nodes are successfully installed you must reconfigure each node to use the same database (referred to in the following steps as main).

  1. Install API Portal on the first node as detailed in Install API Portal as software installation.
    • When prompted for database connection settings during the API Portal software installation, enter the access host of the database you created for this node.
  2. Repeat the installation steps on the remaining API Portal nodes.
  3. When all API Portal nodes are installed, choose one of the databases as the main database.
  4. Reconfigure all nodes to use the main database. On each API Portal node, edit the /opt/axway/apiportal/htdoc/configuration.php file as follows:
  5. public $host = '<access host of the database>';
    public $user = '<user from the database>’;
    public $password = '<password if set for the user from the database>';
    public $db = '<database name in the database>';
    
  6. Note   If you are using the same database server or cluster only the database name will be different.
  7. When you have reconfigured all the API Portal nodes to use the main database, you can remove the other databases.

Install API Portal in multiple datacenters as a virtual appliance

  1. On the first datacenter, create at least two API Portal instances from the virtual appliance image as detailed in Install API Portal as virtual appliance installation.
  2. Installation creates the API Portal database schema on the local MySQL server on each virtual appliance. Dump the database schema from one of the local MySQL servers, and import it to the database cluster located in the same datacenter.
  3. To configure all API Portal instances to use the database cluster, on each API Portal instance, edit the /opt/axway/apiportal/htdoc/configuration.php file as follows:
  4. public $host = '<access host of the database cluster>';
    public $user = '<user from the database cluster>’;
    public $password = '<password if set for the user from the database cluster>';
    public $db = '<database name in the database cluster>';
  5. Stop the local MySQL server on each API Portal instance.
  6. Repeat the installation steps for the other datacenters.

Upgrade API Portal in multiple datacenters as a software installation or virtual appliance

For HA upgrade you must first duplicate your existing database schema (referred to in the following steps as main) so that you can configure each node to be upgraded with a separate database schema. Use the already configured database cluster located in the same datacenter for the database schemas. After all nodes are successfully upgraded you must reconfigure each node to use the main database again.

  1. Duplicate your existing database schema (main) in the configured database cluster as many times as required to result in a database for each of your API Portal nodes. For example, if you have 3 API Portal nodes, you will need 2 duplicates resulting in main, duplicate1 and duplicate2.
  2. Configure each node to use one of the databases from the preceding step. For example, configure the first node to use the main database, the second node to use duplicate1 and the third node to use duplicate2. On each API Portal node, edit the /opt/axway/apiportal/htdoc/configuration.php file as follows:
  3. public $host = '<access host of the database>';
    public $user = '<user from the database>’;
    public $password = '<password if set for the user from the database>';
    public $db = '<database name in the database>';
    
  4. Note   If you are using the same database server or cluster only the database name will be different.
  5. Install the upgrade package and perform the post-upgrade steps on each API Portal node as detailed in Upgrade existing API Portal installation.
  6. Reconfigure all nodes to use the main database again by editing the /opt/axway/apiportal/htdoc/configuration.php file on each API Portal node (see Step 2).
  7. When you have reconfigured all the API Portal nodes to use the main database again, you can remove the duplicates.

Configure load balancers

Configuring the load balancer may vary depending on the load balancer in question. Set up and configure the load balancer as instructed in the documentation of your load balancer.

You must situate the external load balancer to route traffic between the datacenters, and an internal load balancer in each datacenter to route the traffic between the API Portal instances.

Related Links