启动时报错

来源:1-2 课程资源获取方式 - 非常重要!!!

慕勒6125681

2021-06-12

GRPC服务启动时使用 127.0.0.0 地址和 0.0.0.0 不会报错 使用 47.242.66.148 IP地址出现下面的错误

47.242.66.148 50051
E0612 03:20:44.603134815 1787294 server_chttp2.cc:49] {“created”:"@1623439244.603096442",“description”:“No address added out of total 1 resolved”,“file”:“src/core/ext/transport/chttp2/server/chttp2_server.cc”,“file_line”:872,“referenced_errors”:[{“created”:"@1623439244.603084454",“description”:“Unable to configure socket”,“fd”:6,“file”:“src/core/lib/iomgr/tcp_server_utils_posix_common.cc”,“file_line”:216,“referenced_errors”:[{“created”:"@1623439244.603080477",“description”:“Cannot assign requested address”,“errno”:99,“file”:“src/core/lib/iomgr/tcp_server_utils_posix_common.cc”,“file_line”:190,“os_error”:“Cannot assign requested address”,“syscall”:“bind”}]}]}
Traceback (most recent call last):
File “/data/AlTrading/user_srv/server.py”, line 38, in
serve()
File “/data/AlTrading/user_srv/server.py”, line 24, in serve
server.add_insecure_port(f’{args.host}:{args.port}’)
File “/root/.virtualenvs/AlTrading/lib/python3.8/site-packages/grpc/_server.py”, line 970, in add_insecure_port
return _common.validate_port_binding_result(
File “/root/.virtualenvs/AlTrading/lib/python3.8/site-packages/grpc/_common.py”, line 166, in validate_port_binding_result
raise RuntimeError(_ERROR_MESSAGE_PORT_BINDING_FAILED % address)
RuntimeError: Failed to bind to address 47.242.66.148:50051; set GRPC_VERBOSITY=debug environment variable to see detailed error message.

写回答

1回答

bobby

2021-06-13

47.242.66.148  这个ip地址是对外的ip地址吗? 一般这种出现错误一般都是ip地址写错了,你可以在本地ping一下看看是否能ping通

0
1
只是为了好玩
【在本地ping一下看看是否能ping通】这解决了我的问题。
2021-12-18
共1条回复

Go+Python打造电商系统 自研微服务框架 抓紧高薪机遇

快速转型Go工程师,成为具备双语言后端能力的开发者

508 学习 · 530 问题

查看课程