Closed fengqiangzhao closed 4 years ago
Could you please provide more logs? It seems the codes you post here are the source code, not the error log. Thank you.
Ok, That's the production log.
[2019-08-15 01:00:12]-[EurekaClient]-[line:655] -WARNING: Eureka server [http://admin:*****@*****/eureka/] is down, use next url to try. [2019-08-15 01:00:12]-[EurekaClient]-[line:737] -ERROR: Error! Traceback (most recent call last): File "/***/venv/local/lib/python2.7/site-packages/py_eureka_client/eureka_client.py", line 733, in send_heart_beat self.__try_all_eureka_server(lambda url: send_heart_beat(url, self.__instance["app"], File "/***/venv/local/lib/python2.7/site-packages/py_eureka_client/eureka_client.py", line 665, in __try_all_eureka_server raise urllib2.URLError("All eureka servers are down!") URLError: <urlopen error All eureka servers are down!> [2019-08-15 01:00:12]-[EurekaClient]-[line:738] -INFO: Cannot send heartbeat to server, try to register
PS: I noticed from the log that error reporting seemed to be regular. 01:00 and 19:00 every day the error occur almost.
注册 eureka_client.init 时 app_name 不能有空格
I see, I think I should do some url encoding to the app_name
.
now you can use space, UTF8 chars in app_name now. will quote it before sending to server.
部署的时候经常会出现这个问题,不知道是什么原因? 是否和celery有关?
if len(tried_servers) > 0: untry_servers.extend(tried_servers) self.__eureka_servers = untry_servers if not ok: raise urllib2.URLError("All eureka servers are down!")
def send_heart_beat(self, overridden_status=""): try: self.__try_all_eureka_server(lambda url: send_heart_beat(url, self.__instance["app"], self.__instance["instanceId"], self.__instance["lastDirtyTimestamp"], status=self.__instance["status"], overriddenstatus=overridden_status))