3
votes

I'm having another problem using WSO2 API Manager 2.0.0: I have installed it in docker using three containers (one for APIM, one for Analytics and one for MySQL) and I replace some configuration files with my custom version (e.g. DB, server name, gateway setup...). Both APIM and Analytics are configured to save data in the MySQL container and I am able to see changes in the DB.

The issue is that I cannot find my APIs neither in the publisher nor in the store after the container has been rebuilt. Changes in the DB persists, I can see the statistics for all my APIs and I get an error if I try to create a new API using the same name or context, but the store is always empty after a new build.

I have also tried to put both /repository/deployment/server/synapse-config/default and /repository/tenants/ in two volumes and I can see the files created in /.../default/api/ for my APIs, but I cannot figure out the issue. Should I persists some additional directory not mentioned in the guide?

I don't want to put the whole APIM and Analytics homes in volumes if possible.

2

2 Answers

2
votes

First, check whether artifacts can be located in Resources Browser.

Resources Browser

If you can find the API related files, then the issue is related to indexing. Do the following to re-index the artifacts in the registry:

  1. Rename the <lastAccessTimeLocation> element in the <APIM_2.0.0_HOME>/repository/conf/registry.xml file. If you use a clustered/distributed API Manager setup, change the file in the API Publisher node. For example, change the /_system/local/repository/components/org.wso2.carbon.registry/indexing/lastaccesstime registry path to /_system/local/repository/components/org.wso2.carbon.registry/indexing/lastaccesstime_1.
  2. Shut down the API Manager, back up and delete the <APIM_2.0.0_HOME>/solr directory.
  3. Finally start the API Manager.
1
votes

The Api Information resides in the DB and in the File system.(/repository/deployment/server/synapse-config/default/api) It is possible that the registry artifacts are not indexed properly. Can you try following?

  1. Delete the solar directory.
  2. Open registry.xml and change the following line as shown below. < lastAccessTimeLocation>/_system/local/repository/components/org.wso2.carbon.registry/indexing/lastaccesstime-1
  3. Now restart the server. Server will re-index all the files again.

Also make sure the Databases are properly configured. Specially Registry mounting related configurations.