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 和 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:
- 重命名
文件中的/repository/conf/registry.xml
元素.如果您使用集群/分布式 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 Manager,备份并删除
<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屋!