Docker容器中的更改后WSO2丢失API [英] WSO2 loss APIs after changes in docker container
问题描述
我在使用WSO2 API Manager 2.0.0时遇到了另一个问题:我已经使用三个容器(一个用于APIM,一个用于Analytics(分析),一个用于MySQL)在Docker中安装了它,并用自定义版本替换了一些配置文件(例如数据库,服务器名称,网关设置...). APIM和Analytics均已配置为将数据保存在MySQL容器中,并且我能够看到数据库中的更改.
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.
问题是,在重建容器之后,我既无法在发布者中也无法在商店中找到我的API.数据库中的更改仍然存在,我可以查看所有API的统计信息,如果尝试使用相同的名称或上下文创建新的API,则会收到错误消息,但是新构建后存储始终为空.
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.
我还尝试将/repository/deployment/server/synapse-config/default
和/repository/tenants/
放在两个卷中,并且可以看到在/.../default/api/
中为我的API创建的文件,但是我无法弄清问题所在.
我是否应该保留指南中未提及的其他目录?
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?
如果可能的话,我不想将整个APIM和Google Analytics(分析)之家批量放置.
I don't want to put the whole APIM and Analytics homes in volumes if possible.
推荐答案
首先,检查工件是否可以位于资源浏览器中.
First, check whether artifacts can be located in Resources Browser.
如果可以找到与API相关的文件,则问题与索引有关. 执行以下操作以重新索引注册表中的工件:
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:
- 重命名
<APIM_2.0.0_HOME>/repository/conf/registry.xml
文件中的<lastAccessTimeLocation>
元素.如果使用群集/分布式API Manager设置,请在"API Publisher"节点中更改文件.例如,将/_system/local/repository/components/org.wso2.carbon.registry/indexing/lastaccesstime
注册表路径更改为/_system/local/repository/components/org.wso2.carbon.registry/indexing/lastaccesstime_1
. - 关闭API管理器,备份并删除
<APIM_2.0.0_HOME>/solr
目录. - 最后启动API管理器.
- 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
. - Shut down the API Manager, back up and delete the
<APIM_2.0.0_HOME>/solr
directory. - Finally start the API Manager.
这篇关于Docker容器中的更改后WSO2丢失API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!