python - pyspider 集群报「connect to scheduler error 」
ringa_lee
ringa_lee 2017-04-17 17:09:50
0
1
961

搭建集群 (一主一从,稳定运行后增加四台从,配置一致)后,正常运行
稳定运行6小时左右后,出现异常
点击 Active Tasks 后出现 connect to scheduler error 错误
重启 pyspider,未解决
回溯负载情况,均未见异常

查日志后发现大量在报

[W 160203 16:13:09 index:105] connect to scheduler rpc error: error(111, 'Connection refused')

向前查日志发现几次报错

[E 160203 16:08:30 scheduler:463]

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/pyspider/scheduler/scheduler.py", line 458, in run
    self.run_once()
  File "/usr/local/lib/python2.7/dist-packages/pyspider/scheduler/scheduler.py", line 444, in run_once
    self._check_request()
  File "/usr/local/lib/python2.7/dist-packages/pyspider/scheduler/scheduler.py", line 267, in _check_request
    task = self.on_new_request(task)
  File "/usr/local/lib/python2.7/dist-packages/pyspider/scheduler/scheduler.py", line 573, in on_new_request
    self.put_task(task)
  File "/usr/local/lib/python2.7/dist-packages/pyspider/scheduler/scheduler.py", line 188, in put_task
    exetime=_schedule.get('exetime', self.default_schedule['exetime'])
  File "/usr/local/lib/python2.7/dist-packages/pyspider/scheduler/task_queue.py", line 192, in put
    self.priority_queue.put(task)
  File "/usr/lib/python2.7/Queue.py", line 136, in put
    self._put(item)
  File "/usr/local/lib/python2.7/dist-packages/pyspider/scheduler/task_queue.py", line 79, in _put
    self.queue_dict[item.taskid] = item
MemoryError

数据库用的 MySQL,数据
1h: 59413
1d: 3096065
all: 2952765


目前发现可能和 taskdb 的量级有关,当前在 300万+ 的情况下出现了这个问题。但是从数据库相关监控信息看,CPU、连接数、网络等指标均未异常..

ringa_lee
ringa_lee

ringa_lee

全部回复(1)
大家讲道理

已经发现问题,是内存不足。

另外 pyspider 集群部署方面的文档好像不是很完善,不知作者是否有考虑补充?

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板