0

i am using wso2 api-manager 02.01.00 on a linux system. The Api-Manager is deployed at Folder A. The Databases (h2) are deployed ad Folder B which is not in Folder A. The datasources in /repository/conf/datasources/master-datasources.xml are pointing correctly to the databases in Folder B. I configured it like that, because i want do preserve the databases if there is a deployment. (Becaus a fiew Developer are using the API-Manager and they don't want to loose their Data.) But it seem, that WSO2AM_DB.h2.db is created new if there is an api-manager-depoyment. I think this, because i had a look to the DB-Size. I started with a Size of 1750KB for WSO2AM_DB.h2.db. I published a view API's in the Manager and the Size increases to 2774KB. Then i did a Deployment and the size returned to 1750KB. Effect is that API-Store/Publisher says "There are no APIS published yet". But i could see the APIS at Application Subscriptions and in Carbon Resources at /_system/governance/apimgt/applicationdata/provider/admin. I tried to force a new Indexing with this, but it doesn't change anything. Could i configure at any place, that the Database should not be created/manipulated at start?

Meanwhile i'm really desperated of not solving this problem.

Maybe you could help me.

Thank you for your Time.

Community
  • 1
  • 1
Killm
  • 31
  • 5
  • The Deployment is done by a configuration management tool. For each installation, the WSO directory is deleted and overwritten with the new changes / patches (in Folder A). – Killm May 18 '17 at 12:43

1 Answers1

0

WSO2 does not recommend to run on H2 database. You need to use a production database such as mysql, oracle, etc. H2 is only for tryouts.

Basically, WSO2 servers store data in databases as well as use the file system. For this kind of a deployment, you need to do the following.

  1. Point to an external database. If you are using this for demo purposes, still you can go with the current mode (H2 database).

  2. Use dep-sync. The content which comes under the WSO2_HOME/repository/deployment/server location needs to be preserved. You can use SVN based dep-sync or rsync. Basic idea is that for a new deployment, you need to have the data of the previous deployment.

  3. Solr Indexing preservation. If you have hundreds/thousands of APIs in the system, it would take time for indexing. To avoid that you can copy the content of WSO2_HOME/solr to the new deployment.

Pubci
  • 3,834
  • 1
  • 13
  • 28
  • The Management Tool don't support the way you suggested. But i tried a nearby way. The repository/deployment/server location was moved to Folder B. The config-Files which point to it where edited. If i add APIS i could find them in the new Location in B and they are shown in the UI. But the Problem ist the same. If i do a deployment the API's in the UI are deleted/not shown. But they exist at repository/deployment/server/... and at carbon-resources. I tried also to force new indexing and the files under solr where created new, but it don't solve the problem. – Killm May 18 '17 at 12:54
  • Sometimes i could get back my API's and they are all shown in the UI, but i don't know what action caused this. Most time they are not shown. – Killm May 18 '17 at 12:56
  • by the way, server startup throws an OperationNotSupportedException [2017-05-18 14:35:20,492]-[DEBUG]-[org.springframework.jndi.JndiTemplate]-[]-[]-[]-[]-[Could not close JNDI InitialContext] javax.naming.OperationNotSupportedException: Context is read only at org.apache.naming.NamingContext.checkWritable(NamingContext.java:967) but i read that should be no problem. – Killm May 18 '17 at 13:33