Wednesday, May 13, 2015

Common configurations which can go wrong when setting up WSO2 API Manager cluster setup. 

Background 

In this post I will be focusing on a set up which has a publisher node, store node, two key manager nodes, one gateway manager node and one gateway worker node. Key manager and gateway cluster is fronted using Nginx.

Observation 01

  • 1.1. Published APIs cannot be seen in the store.
  • 1.2. API can be seen under APIs section of the carbon console of both publisher and store. 
  • 1.3. When you search given the published API is doesn't appear in the search results however when user restart the store node it user can see the API only in search result when user search the API.       
  • When user reindex by deleting the content inside <APIM_Home>/solar folder and changing the last access location under "<indexingConfiguration>" tag in <APIM_Home>/repository/conf/registry.xml, all the APIs created so far get lists yet when her publishes an API after 

Reason for this issue : When you haven't configured cacheId property in registry.xml given the same username which you have used in datasource in  <APIM_Home>/repository/conf/datasources/master-datasources.xml this issue occurs


Observation 02

After starting cluster with no exceptions if your getting "401 username or password incorrect" when trying to login into the system. 

Things to be checked:

  • Check whether hard coded username password inside 
    • publisher 
    • store
    • gateway nodes are correct (should be same as the admin username password given inside <AM_HOME>/repository/conf/user-mgt.xml)
  • If you have configured a load balancer, say Nginx when ip hash or sticky sessions doesn't work properly this can happen.  There issue can occur when authentication call goes one of the key manager node and authorisation call goes to another one.