WSO2与Docker不兼容

我不得不closureswso2server来testing同一台机器上的其他APIpipe理工具。 另一个工具提供了在Docker上运行的快速设置,所以我不得不安装docker。

现在,当我closures所有docker服务并再次启动wso2server时,它看起来像一些服务检测docker虚拟接口IP(172.17.0.1),而不是使用真正的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 

从前一天以预期IPlogin:

 [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不对应任何东西。

我能做些什么才能再次检测到真实的IP?

您可以在carbon.xml设置所需的IP

 <!-- Host name or IP address of the machine hosting this server eg 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中用所需的IPreplace${carbon.local.ip}

除了上面我们还需要编辑/wso2am-2.0.0/repository/conf/api-manager.xml文件并更改<GatewayEndpoint> url值replace${carbon.local.ip}