设置:两个WSO2 APIM指向同一MYSQL。这两个WSO2实例位于LB后面,发布者会话很粘滞。 API会话不粘滞。我已经发布了API“ /public/1.0.0/abc”,以前它指向“ / api / app / v1 / xyz”。我更新了已发布的API,使其现在指向“ / api / app / v1 / abc”。
问题:现在更新之后,通过curl访问已发布的API时,有时会返回预期结果,但有时会抛出403错误。似乎一个实例中的更新没有传播到另一个实例中?要使其正常运行,请按以下步骤进行操作,这意味着停机,我们正在努力避免停机。
完成这项工作的唯一方法是执行以下操作:
1. Shutdown the wso2am app on the working instance (Instance1)
2. Update the API again on WSO2 publisher so Instance2 picks up the change
3. Start back the Instance1 wso2am app
WSO2 Instance1记录调用工作的位置:
==> /usr/lib64/wso2/wso2am/2.6.0/repository/logs/http_access_.log <==
- <private-subnet-ip> - - [04/Jun/2019:20:02:00 +0000] "GET /services/Version HTTP/1.1" - - "-" "ELB-HealthChecker/2.0"
<my-ip> <private-subnet-ip> - - [04/Jun/2019:20:02:22 +0000] "GET /public/1.0.0/abc HTTP/1.1" - - "-" "curl/7.54.0"
<my-ip> <private-subnet-ip> - - [04/Jun/2019:20:02:22 +0000] "GET /api/app/v1/abc HTTP/1.1" - - "-" "Synapse-PT-HttpComponents-NIO"
- <private-subnet-ip> - [04/Jun/2019:20:02:00 +0000] "- - " 200 - "-" "-"
- <private-subnet-ip> - [04/Jun/2019:20:02:22 +0000] "- - " 200 - "-" "-"
- <private-subnet-ip> - [04/Jun/2019:20:02:22 +0000] "- - " 200 - "-" "-"
WSO2 Instance2记录呼叫不起作用的地方:
==> /usr/lib64/wso2/wso2am/2.6.0/repository/logs/wso2carbon.log <==
TID: [-1234] [] [2019-06-04 20:01:24,511] WARN {org.apache.synapse.rest.API} - Trying to access API : admin--PublicAPI on restricted transport chanel [https] {org.apache.synapse.rest.API}
==> /usr/lib64/wso2/wso2am/2.6.0/repository/logs/wso2-apigw-errors.log <==
2019-06-04 20:01:24,511 [-] [PassThroughMessageProcessor-123] WARN API Trying to access API : admin--PublicAPI on restricted transport chanel [https]
==> /usr/lib64/wso2/wso2am/2.6.0/repository/logs/wso2carbon.log <==
TID: [-1234] [] [2019-06-04 20:01:24,511] INFO {org.apache.synapse.mediators.builtin.LogMediator} - STATUS = Message dispatched to the main sequence. Invalid URL., RESOURCE = /public/1.0.0/abc {org.apache.synapse.mediators.builtin.LogMediator}
==> /usr/lib64/wso2/wso2am/2.6.0/repository/logs/wso2-apigw-service.log <==
2019-06-04 20:01:24,511 [-] [PassThroughMessageProcessor-123] INFO __SynapseService STATUS = Message dispatched to the main sequence. Invalid URL., RESOURCE = /public/1.0.0/abc
答案 0 :(得分:0)
如果您没有在两个服务器之间共享API构件,则会发生这种情况。只有一台服务器具有更新的工件。发布API时,它会创建一个Synapse(API)工件,该工件存储在服务器的文件系统中。该位置是SERVER_HOME /存储库/部署/服务器/突触/默认/ api位置。如果您正在运行多个实例,则应具有一种在服务器之间同步这些工件的机制。有几种选择。