2017-02-01 66 views
1

我想運行scrapy集羣跟着this quick-start. 我得到以下錯誤。scrapy-cluster:socket.error:[Errno 98]已經在使用的地址

# python rest_service.py 
2017-02-01 03:02:20,009 [rest-service] INFO: Successfully connected to redis 
2017-02-01 03:02:20,011 [rest-service] INFO: Running main flask method on port 5343 
2017-02-01 03:02:20,014 [rest-service] INFO: Closing Rest Service 
Traceback (most recent call last): 
    File "rest_service.py", line 711, in <module> 
    rest_service.run() 
    File "rest_service.py", line 449, in run 
    self.app.run(host='0.0.0.0', port=self.settings['FLASK_PORT']) 
    File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 843, in run 
    run_simple(host, port, self, **options) 
    File "/usr/local/lib/python2.7/site-packages/werkzeug/serving.py", line 694, in run_simple 
    inner() 
    File "/usr/local/lib/python2.7/site-packages/werkzeug/serving.py", line 656, in inner 
    fd=fd) 
    File "/usr/local/lib/python2.7/site-packages/werkzeug/serving.py", line 550, in make_server 
    passthrough_errors, ssl_context, fd=fd) 
    File "/usr/local/lib/python2.7/site-packages/werkzeug/serving.py", line 464, in __init__ 
    HTTPServer.__init__(self, (host, int(port)), handler) 
    File "/usr/local/lib/python2.7/SocketServer.py", line 417, in __init__ 
    self.server_bind() 
    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 

我應該如何使用另一個端口。

回答

1

你可以檢查哪些進程正在使用使用 sudo netstat -nlp | grep :5343

,然後該端口使用其PID殺死該進程 kill -9 <pid>

相關問題