WSO2 与 Docker 不兼容 [英] WSO2 not compatible with Docker

查看:22
本文介绍了WSO2 与 Docker 不兼容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须关闭 wso2server 才能在同一台机器上测试其他 API 管理工具.另一个工具提供了在 Docker 上运行的快速设置,所以我必须安装 docker.

I had to shutdown wso2server to test an other API management tool on the same machine. The other tool provided a quick setup running on Docker so I had to install docker.

现在,当我关闭每个 docker 服务并再次启动 wso2server 时,看起来有些服务检测到 docker 虚拟接口 IP (172.17.0.1) 而不是使用真实 IP (10.22.106.101):

Now, when I shutdown every docker services and start wso2server again, it looks like some services detect docker virtual interface IP (172.17.0.1) instead of using the real IP (10.22.106.101) :

[2016-11-04 16:33:21,452]  INFO - CarbonUIServiceComponent Mgt Console URL  : https://172.17.0.1:9443/carbon/
[2016-11-04 16:33:21,452]  INFO - CarbonUIServiceComponent API Publisher Default Context : https://172.17.0.1:9443/publisher
[2016-11-04 16:33:21,452]  INFO - CarbonUIServiceComponent API Store Default Context : https://172.17.0.1:9443/store

使用预期 IP 记录前一天的日志:

Log from a previous day with expected IP:

[2016-09-15 15:38:24,534]  INFO {org.wso2.carbon.ui.internal.CarbonUIServiceComponent} -  Mgt Console URL  :
 https://10.22.106.101:9443/carbon/ {org.wso2.carbon.ui.internal.CarbonUIServiceComponent}
[2016-09-15 15:38:24,534]  INFO {org.wso2.carbon.ui.internal.CarbonUIServiceComponent} -  API Publisher Defa
ult Context : https://10.22.106.101:9443/publisher {org.wso2.carbon.ui.internal.CarbonUIServiceComponent}
[2016-09-15 15:38:24,534]  INFO {org.wso2.carbon.ui.internal.CarbonUIServiceComponent} -  API Store Default
Context : https://10.22.106.101:9443/store {org.wso2.carbon.ui.internal.CarbonUIServiceComponent}

这不会阻止 WSO2 启动,但会阻止 Swagger-UI 工作,因为它试图访问 172.17.0.1 上的服务,但由于此 IP 不对应任何内容,因此超时结束.

This doesnt prevent WSO2 to start, but it prevents Swagger-UI to work because it's trying to reach services on 172.17.0.1 ending in timeout since this IP doesn't correspond to anything.

如何才能再次检测到真实 IP?

What can I do in order to have the real IP is detected again ?

推荐答案

可以在carbon.xml中设置需要的IP>

You can set required IP in carbon.xml

<!--
   Host name or IP address of the machine hosting this server
   e.g. www.wso2.org, 192.168.1.10
   This is will become part of the End Point Reference of the
   services deployed on this server instance.
-->
<!--HostName>www.wso2.org</HostName-->

<!--
Host name to be used for the Carbon management console
-->
<!--MgtHostName>mgt.wso2.org</MgtHostName-->

您可能还需要将 api-manager.xml 中的 ${carbon.local.ip} 替换为所需的 IP.

And you may have to replace ${carbon.local.ip} in api-manager.xml by required IP too.

这篇关于WSO2 与 Docker 不兼容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆