python - pyspider使用redis分布式
問(wèn)題描述
在部署pyspider分布式時(shí),嘗試連接redis集群配置項(xiàng)為: 'message_queue':'redis://127.0.0.1:6380/db'在啟動(dòng)時(shí):報(bào)如下錯(cuò)誤[E 170221 09:40:39 tornado_fetcher:529] MOVED 12068 127.0.0.1:6380
Traceback (most recent call last): File '/usr/lib/python2.6/site-packages/pyspider/fetcher/tornado_fetcher.py', line 515, in queue_loop if self.outqueue.full(): File '/usr/lib/python2.6/site-packages/pyspider/message_queue/redis_queue.py', line 50, in full if self.maxsize and self.qsize() >= self.maxsize: File '/usr/lib/python2.6/site-packages/pyspider/message_queue/redis_queue.py', line 40, in qsize self.last_qsize = self.redis.llen(self.name) File '/usr/lib/python2.6/site-packages/redis/client.py', line 1219, in llen return self.execute_command(’LLEN’, name) File '/usr/lib/python2.6/site-packages/redis/client.py', line 573, in execute_command return self.parse_response(connection, command_name, **options) File '/usr/lib/python2.6/site-packages/redis/client.py', line 585, in parse_response response = connection.read_response() File '/usr/lib/python2.6/site-packages/redis/connection.py', line 582, in read_response raise responseResponseError: MOVED 12068 127.0.0.1:6380
經(jīng)查找,得到:因?yàn)閞edis由單節(jié)點(diǎn)變?yōu)榧海鴓ython的redis連接包暫時(shí)還不支持redis集群連接方式,需要更換連接包(redis-py-cluster)。
在安裝完redis-py-cluster之后,依舊報(bào)上面的錯(cuò)誤。
問(wèn)題解答
回答1:鏈接 redis 使用的庫(kù)是寫(xiě)在代碼里面的,不是你安裝了就會(huì)切換的。就算你要改代碼,也要確認(rèn) API 是兼容的。
相關(guān)文章:
1. python - sqlalchemy更新數(shù)據(jù)報(bào)錯(cuò)2. 運(yùn)行python程序時(shí)出現(xiàn)“應(yīng)用程序發(fā)生異常”的內(nèi)存錯(cuò)誤?3. javascript - h5微信中怎么禁止橫屏4. macos - 無(wú)法source activate python275. empty比isset更嚴(yán)格一點(diǎn)6. thinkphp6使用驗(yàn)證器 信息如何輸出到前端頁(yè)面7. 我在導(dǎo)入模板資源時(shí)遇到無(wú)法顯示的問(wèn)題,請(qǐng)老師解答下8. PHPExcel表格導(dǎo)入數(shù)據(jù)庫(kù)怎么導(dǎo)入9. javascript - 微信網(wǎng)頁(yè)開(kāi)發(fā)從菜單進(jìn)入頁(yè)面后,按返回鍵沒(méi)有關(guān)閉瀏覽器而是刷新當(dāng)前頁(yè)面,求解決?10. 預(yù)訂金和尾款分別支付

網(wǎng)公網(wǎng)安備