pai icon indicating copy to clipboard operation
pai copied to clipboard

联网环境变化后prometheus无法启动

Open hellocandy opened this issue 7 years ago • 13 comments

Organization Name: Advantech

Short summary about the issue/question:在有外网连接的情况下安装openPAI,安装成功后,把外网的网线拔出,只保留内网。这时候,openPAI的prometheus无法启动。watchdog报错,提示: request cancelled。然后再把外网网线插回,prometheus又可以启动了,watchdog可以正常启动。 使用curl http://:9101在断开外网情况下会一直没有响应,而连接外网后返回正常。另外,在纯内网部署的情况下没有遇到这个问题

Brief what process you are following:

How to reproduce it:

OpenPAI Environment: cluster

  • OpenPAI version: 0.8.3
  • Cloud provider or hardware configuration:
  • OS (e.g. from /etc/os-release):
  • Kernel (e.g. uname -a):
  • Hardware (e.g. core number, memory size, storage size, GPU type etc.):
  • Others:

Anything else we need to know:

hellocandy avatar Feb 18 '19 02:02 hellocandy

prometheus 不能启动,显示的日志是什么?

watchdog 的日志能贴完整些么?

xudifsd avatar Feb 18 '19 02:02 xudifsd

prometheus的log看起来正常,但是curl http://:9101拿不到。 这个是watchdog的log: Traceback (most recent call last): File "/watchdog.py", line 426, in <module> main(args) File "/watchdog.py", line 377, in main httpd = make_server("", int(args.port), app) File "/usr/local/lib/python2.7/wsgiref/simple_server.py", line 151, in make_server server = server_class((host, port), handler_class) File "/usr/local/lib/python2.7/SocketServer.py", line 417, in init self.server_bind() File "/usr/local/lib/python2.7/wsgiref/simple_server.py", line 48, in server_bind HTTPServer.server_bind(self) File "/usr/local/lib/python2.7/BaseHTTPServer.py", line 108, in server_bind SocketServer.TCPServer.server_bind(self) File "/usr/local/lib/python2.7/SocketServer.py", line 431, in server_bind self.socket.bind(self.server_address) File "/usr/local/lib/python2.7/socket.py", line 228, in meth return getattr(self._sock,name)(*args) socket.error: [Errno 98] Address already in use

hellocandy avatar Feb 18 '19 02:02 hellocandy

prometheus listen 的是 9091,不是 9101,9101 是 watchdog listen 的,你给的日志是说 watchdog 无法 listen 那个端口,因为被占用,9101 无法在这种情况下 curl 是正常的。

你可以通过浏览器访问 9091 端口看是否能访问 prometheus。

你能看看是哪个进程在 listen 9101 端口么?

xudifsd avatar Feb 18 '19 02:02 xudifsd

[图片]

hellocandy avatar Feb 18 '19 02:02 hellocandy

我们的Ubuntu里面只有openpai,手动kill掉这个占用9101的进程也不行,watchdog的日志如下: 2019-02-18 02:52:12,806 - WARNING - watchdog.py:169 - unkown pod batch-job-hadoop-shfmm 2019-02-18 02:52:12,807 - WARNING - watchdog.py:169 - unkown pod etcd-server-10.0.64.14 2019-02-18 02:52:12,832 - INFO - transport.py:1746 - Connected (version 2.0, client OpenSSH_7.2p2) 2019-02-18 02:52:12,955 - INFO - transport.py:1746 - Authentication (password) successful! 2019-02-18 02:52:12,960 - INFO - watchdog.py:140 - Executing the command on host [10.0.64.14]: sudo systemctl is-active docker | if [ $? -eq 0 ]; then echo "active"; else exit 1 ; fi 2019-02-18 02:52:13,206 - INFO - transport.py:1746 - Connected (version 2.0, client OpenSSH_7.2p2) 2019-02-18 02:52:13,318 - INFO - transport.py:1746 - Authentication (password) successful! 2019-02-18 02:52:13,323 - INFO - watchdog.py:140 - Executing the command on host [10.0.64.15]: sudo systemctl is-active docker | if [ $? -eq 0 ]; then echo "active"; else exit 1 ; fi 2019-02-18 02:52:13,570 - INFO - transport.py:1746 - Connected (version 2.0, client OpenSSH_7.2p2) 2019-02-18 02:52:13,642 - INFO - transport.py:1746 - Authentication (password) successful! 2019-02-18 02:52:13,655 - INFO - watchdog.py:140 - Executing the command on host [10.0.64.16]: sudo systemctl is-active docker | if [ $? -eq 0 ]; then echo "active"; else exit 1 ; fi 2019-02-18 02:52:43,974 - WARNING - watchdog.py:169 - unkown pod batch-job-hadoop-shfmm 2019-02-18 02:52:43,975 - WARNING - watchdog.py:169 - unkown pod etcd-server-10.0.64.14 2019-02-18 02:52:44,003 - INFO - transport.py:1746 - Connected (version 2.0, client OpenSSH_7.2p2) 2019-02-18 02:52:44,115 - INFO - transport.py:1746 - Authentication (password) successful! 2019-02-18 02:52:44,122 - INFO - watchdog.py:140 - Executing the command on host [10.0.64.14]: sudo systemctl is-active docker | if [ $? -eq 0 ]; then echo "active"; else exit 1 ; fi 2019-02-18 02:52:44,367 - INFO - transport.py:1746 - Connected (version 2.0, client OpenSSH_7.2p2) 2019-02-18 02:52:44,437 - INFO - transport.py:1746 - Authentication (password) successful! 2019-02-18 02:52:44,452 - INFO - watchdog.py:140 - Executing the command on host [10.0.64.15]: sudo systemctl is-active docker | if [ $? -eq 0 ]; then echo "active"; else exit 1 ; fi 2019-02-18 02:52:44,703 - INFO - transport.py:1746 - Connected (version 2.0, client OpenSSH_7.2p2) 2019-02-18 02:52:44,811 - INFO - transport.py:1746 - Authentication (password) successful! 2019-02-18 02:52:44,819 - INFO - watchdog.py:140 - Executing the command on host [10.0.64.16]: sudo systemctl is-active docker | if [ $? -eq 0 ]; then echo "active"; else exit 1 ; fi

hellocandy avatar Feb 18 '19 02:02 hellocandy

你的这个日志是 watchdog 正常启动的

xudifsd avatar Feb 18 '19 02:02 xudifsd

另外,你的配置文件里面是不是写的外网地址,你用内网地址重新部署下试试?

xudifsd avatar Feb 18 '19 03:02 xudifsd

K8s的watchdog上显示: Back-off restarting failed container Readiness probe failed: Get http://10.0.64.14:9101/: net/http: request canceled (Client.Timeout exceeded while awaiting headers) 并没有启动成功,我们确定是使用Openstack internal IP部署的

hellocandy avatar Feb 18 '19 03:02 hellocandy

这个 http://10.0.64.14:9101/ 是你们的内网还是外网?

xudifsd avatar Feb 18 '19 06:02 xudifsd

这个是内网

hellocandy avatar Feb 18 '19 08:02 hellocandy

这个可能是由于 make_server 的第一个参数的问题,pai 使用的是空字符串,可能会绑定到外网的网卡上,关于这点你能验证下么?

我们在 0.9 版本切换到了 twisted。你可以试试 0.9 是不是可以解决这个问题。

xudifsd avatar Feb 19 '19 06:02 xudifsd

@hellocandy - upgrade to 0.9.0 guide is in the release note: https://github.com/Microsoft/pai/releases/tag/v0.9.0

scarlett2018 avatar Feb 26 '19 05:02 scarlett2018

我们的部署环境断开外网是从集群的上一层断掉的,Cluster IP在断网前后不会产生变化。

hellocandy avatar Feb 27 '19 03:02 hellocandy