KB Article #182569

Clustering Separate API Gateway Domains

Problem

You have two or more separate API Gateway domains and you want to cluster them.

Resolution

There is no option to cluster two domains, you need to reset the topology one one side of the merge, then join that API Gateway install to the existing domain. This requires downtime because any local instances will have to be deleted and recreated during the process and the admin node manager (ANM) will have to be reset as well. You may want to keep the managedomain command reference documentation handy during this. This KB is assuming that you use the --menu option which will prompt you for all necessary information.


Making Backups

  • Make a backup of your API Gateway installs before resetting the local topology. Be sure to keep a .tar.gz file of the /apigateway/groups/ directory handy as you may need to consult individual files from here while recreating instances.
  • Inventory any manually added or modified files that are under /apigateway/groups/ like envSettings.props, JARs that are in the instance's /ext/lib directory, etc. These will need to be copied back after recreating the instances.
  • Download a FED file with Policy Studio from affected instances so you can redeploy at the end.

Resetting the Topology

  • Stop all local instances.
  • Using managedomain --menu option 7 to remove all local instances, then reset the local topology with option 17.
  • Stop the ANM process.
  • Delete the remaining files in the /apigateway/groups/ directory manually.


Note: At this point, you may wish to remove or disable any init.d or systemd scripts for the instances so they don't fail now that the instances are gone. You can also just modify the scripts to point to the new instance directory later, e.g. instance-2 might become instance-4 once it's recreated in the new domain.


Register with the existing domain

  • Run managedomain --menu option 1 (register host).
  • Answer no to the very first question or you will create a standalone domain again. This is not the first ANM in the domain, the other one you want to cluster with is the first ANM in the domain.
  • Give managedomain the address of the existing ANM as well as credentials that work on that ANM.
  • There is a later question that asks if this should be an ANM, you can answer yes there if you wish to have multiple ANMs on the same domain. This will not create a new domain.
  • If you do make an additional ANM in the domain, be sure to copy domain.p12 and the related files as mentioned in the documentation under Admin Node Manager backup and disaster recovery.


Create new instances

  • Using managedomain --menu option 5 to create one or more new instances.
  • Copy the files like envSettings.props to the new instances which you had inventoried earlier.
  • Create init.d or systemd scripts for the new instances if needed, or adjust the instance directory in the old ones.
  • Start all of the new instances.
  • Deploy the FED file backups made earlier.