API Gateway: Convert a single Gateway database node into a clustered Gateway database pair.
search cancel

API Gateway: Convert a single Gateway database node into a clustered Gateway database pair.

book

Article ID: 42987

calendar_today

Updated On:

Products

CA API Gateway

Issue/Introduction

This article will discuss how to convert a single Gateway database node and join an existing cluster / put the node into a clustered Gateway database pair.

Environment

This article applies to all supported Gateway Appliance versions. 

For Gateway 10.1 running MySql 8 with GTID enabled make sure to run a mysql -e reset master after cloning the ssg database. 

Resolution

Proceed with the following steps, in this order:

  1. Stop the Gateway service on the existing Gateway database cluster node
  2. Take a full Gateway database backup: mysqldump --all-databases > /tmp/gateway-database.sql
  3. Add MySQL replication grants on the existing Gateway database cluster node: /opt/SecureSpan/Appliance/bin/add_slave_user.sh
  4. Add MySQL replication grants on the new Gateway database cluster node: /opt/SecureSpan/Appliance/bin/add_slave_user.sh
  5. Initialize MySQL replication on the new Gateway database cluster node: /opt/SecureSpan/Appliance/bin/create_slave.sh
  6. When prompted, clone the remote Gateway database
  7. When running GW10 with MySql 8 make sure to run a additional  " On the secondary node after step 6 is completed, reset the master configuration one more time: mysql -e "reset master" 
  8. Initialize MySQL replication on the existing Gateway database cluster node: /opt/SecureSpan/Appliance/bin/create_slave.sh
  9. When prompted, do not clone the remote Gateway database
  10. Install the proper Gateway grants in the new Gateway database cluster node from the MySQL prompt (replace 7layer with the password set in the Primary DB node, and replace gateway with the unprivileged MySQL user):
    1. grant all on ssg.* to gateway@'%';
      grant all on ssg.* to gateway@'localhost';
      grant all on ssg.* to gateway@'localhost.localdomain';
      grant all on ssg.* to gateway@'localhost6';
      grant all on ssg.* to gateway@'localhost6.localdomain6';
      UPDATE mysql.user SET password = PASSWORD('7layer') WHERE user = "gateway";
      flush privileges;
  11. Restart the MySQL server: service mysql restart
  12. Execute the steps in a related KB article to add or replace the ssg.next_hi stored procedure: Gateway database fail over fails: FUNCTION ssg.next_hi does not exist
  13. Configure the existing Gateway database cluster node's fail-over database connection via the Gateway configurator (ssgconfig) menu.
  14. Configure the new Gateway database cluster node's primary and failover database connection via the Gateway configurator menu.
  15. Start the Gateway service on the existing Gateway database cluster node.
  16. Start the Gateway service on the new Gateway database cluster node.
  17. At this point, you should verify that the accounts and grants on both nodes are identical by running the following SQL queries on both database nodes:
    1. SELECT user,host,password FROM mysql.user;
      SELECT user,host,db FROM mysql.db;