nginx配置nacos的grpc连接
报错信息:
java.util.concurrent.TimeoutException: Waited 3000 milliseconds (plus 501200 nanoseconds delay) for com.alibaba.nacos.shaded.io.grpc.stub.ClientCallsKaTeX parse error: Expected ‘}’, got ‘EOF’ at end of input: ….ProtoLiteUtilsMessageMarshaller@5981f4a6, responseMarshaller=com.alibaba.nacos.shaded.io.grpc.protobuf.lite.ProtoLiteUtils
M
e
s
s
a
e
M
a
s
a
l
l
e
@
63
f
a
a
0
,
s
e
a
D
e
s
t
o
=
o
.
a
l
a
a
.
n
a
o
s
.
a
.
.
a
u
t
o
.
R
e
q
u
e
s
t
G
p
c
MessageMarshaller@63dfada0, schemaDescriptor=com.alibaba.nacos.api.grpc.auto.RequestGrpc
MessageMarshaller@63dfada0,schemaDescriptor=com.alibaba.nacos.api.grpc.auto.RequestGrpcRequestMethodDescriptorSupplier@6f231ced}}}}}]]
at com.alibaba.nacos.shaded.com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:508) ~[nacos–client-2.0.4.jar:na]
java.util.concurrent.ExecutionException: com.alibaba.nacos.shaded.io.grpc.StatusRuntimeException: UNAVAILABLE: io exception
at com.alibaba.nacos.shaded.com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:566) ~[nacos–client-2.0.4.jar:na]
at com.alibaba.nacos.shaded.com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:445) ~[nacos–client-2.0.4.jar:na]
解决方案:
注意
:如果是docker集群部署还需要把7848
端口也一起暴露出来。(7848 端口则用于节点选举来确定集群领袖Leader
)
http {
# 负载均衡配置
upstream lb-nocos{
server 127.0.0.1:8845 weight=1;
server 127.0.0.1:8847 weight=1;
server 127.0.0.1:8849 weight=1;
}
# nacos服务配置
server {
listen 8848;
server_name localhost;
location / {
# 反向代理
proxy_pass http://lb-nocos;
}
}
}
# nacos的grpc协议配置
stream {
# 负载均衡配置(TCP长连接配置)
upstream lb-nocos-tcp{
server 127.0.0.1:9845 weight=1;
server 127.0.0.1:9847 weight=1;
server 127.0.0.1:9849 weight=1;
}
server {
listen 9848;
proxy_pass lb-nocos-tcp;
}
}
集群部署参考:https://blog.csdn.net/weixin_51311218/article/details/122617027
原文地址:https://blog.csdn.net/weixin_51311218/article/details/123623470
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如若转载,请注明出处:http://www.7code.cn/show_32212.html
如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱:suwngjj01@126.com进行投诉反馈,一经查实,立即删除!