Windows XP Windows 7 Windows 2003 Windows Vista Windows教程綜合 Linux 系統教程
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟件教程
 Windows教程網 >> Linux系統教程 >> Linux系統常見問題解答 >> Linux啟動gearman服務

Linux啟動gearman服務

日期:2017/1/20 17:37:28      編輯:Linux系統常見問題解答
好久沒用Gearman了,服務器上的Gearman server不知道什麼時候被停掉了,所以當執行程序時,報錯:
 File "python/response.py", line 41, in <module>

  File "python/response.py", line 38, in main
    gm_worker.set_client_id('your_worker_client_id_name')
  File "/usr/lib64/python2.7/site-packages/gearman-2.0.2-py2.7.egg/gearman/worker.py", line 98, in work
    continue_working = self.poll_connections_until_stopped(worker_connections, continue_while_connections_alive, timeout=poll_timeout)
  File "/usr/lib64/python2.7/site-packages/gearman-2.0.2-py2.7.egg/gearman/connection_manager.py", line 204, in poll_connections_until_stopped
    raise ServerUnavailable('Found no valid connections in list: %r' % self.connection_list)
gearman.errors.ServerUnavailable: Found no valid connections in list: [<GearmanConnection localhost:4730 connected=False>]

從error log的最後一行ServerUnavailable,可以看出是Gearman的server被停掉了。

1.當我執行gearmand -d命令時,先是提示/var/log/gearman/gearman.log不存在,所以先在這個路徑下創建一個log文件;

2.啟動本機的Server,端口是4730,命令是:

 gearmand --log-file gearmand.log --listen 127.0.0.1 --port=4730 --verbose=INFO &
Copyright © Windows教程網 All Rights Reserved