我尝试使用教程{@ 3}}将wso2 api manager 1.10网关集群到3个主机中,但有些步骤令人困惑。 据我所知,wso2 api管理器有两个传输
1。)位于9443(https)端口的servlet传输(tomcat)和用于提供碳相关服务的9763(http)
2.。)PTT / NIO传输(axis2)位于端口8243(https)和8280(http),用于处理对部署工件的请求。
我不能从教程中理解:
1。)为什么在网关管理器组件的集群配置(位于axis2配置中)中应该有端口映射?
<parameter name="properties">
<property name="backendServerURL" value="https://${hostName}:${httpsPort}/services/"/>
<property name="mgtConsoleURL" value="https://${hostName}:${httpsPort}/"/>
<property name="subDomain" value="mgt"/>
<property name="port.mapping.80" value="9763"/>
<property name="port.mapping.443" value="9443"/>
</parameter>
尚未在负载均衡器(nginx)配置中定义
server {
listen 443;
server_name mgt.am.wso2.com;
ssl on;
ssl_certificate /etc/nginx/ssl/mgt.crt;
ssl_certificate_key /etc/nginx/ssl/mgt.key;
location / {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_read_timeout 5m;
proxy_send_timeout 5m;
proxy_pass https://xxx.xxx.xxx.xx3:9443/;
}
error_log /var/log/nginx/mgt-error.log ;
access_log /var/log/nginx/mgt-access.log;
}
并在tomcat配置中?
<Connector protocol="org.apache.coyote.http11.Http11NioProtocol" port="9763" proxyPort="80" ... />
<Connector protocol="org.apache.coyote.http11.Http11NioProtocol" port="9443" proxyPort="443"/>
2.。)为什么网关工作者的负载均衡器配置使用servlet端口?不应该是PTT / NIO端口吗? (因为网关工作者用于处理对部署工件的请求)
upstream wso2.am.com {
sticky cookie JSESSIONID;
server xxx.xxx.xxx.xx4:9763;
server xxx.xxx.xxx.xx5:9763;
}
server {
listen 80;
server_name am.wso2.com;
location / {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_read_timeout 5m;
proxy_send_timeout 5m;
proxy_pass http://wso2.am.com;
}
}
upstream ssl.wso2.am.com {
sticky cookie JSESSIONID;
server xxx.xxx.xxx.xx4:9443;
server xxx.xxx.xxx.xx5:9443;
}
server {
listen 443;
server_name am.wso2.com;
ssl on;
ssl_certificate /etc/nginx/ssl/wrk.crt;
ssl_certificate_key /etc/nginx/ssl/wrk.key;
location / {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_read_timeout 5m;
proxy_send_timeout 5m;
proxy_pass https://ssl.wso2.am.com;
}
}
答案 0 :(得分:0)
API Manager,PTT和servlet中有两个传输端口。当请求进入API管理器时,它始终转到默认传输,即PTT / NIO传输。 调用管理服务时(例如:发布API),您发送servlet请求。如果未在管理器节点中指定端口映射参数,则它将触发PTT / NIO传输,请求将失败。
这里,它为负载均衡器配置指定了一个常见示例。您的配置需要根据Gateway工作人员进行更改。