Code Monkey home page Code Monkey logo

scrapy_redis_cluster's Introduction

Note: 已从爬虫脱坑,不在维护了。请酌情使用,

scrpy-reids的集群版

这是改造原项目以满足自己生产环境的需要

  1. 更改了去重为bloom filer

  2. 添加了Redis集群支持

原项目:scrpy-redis

配置示例:

pip install scrapy-redis-cluster

原版本的所有配置都支持

# Redis集群地址
REDIS_MASTER_NODES = [
    {"host": "192.168.10.233", "port": "30001"},
    {"host": "192.168.10.234", "port": "30002"},
    {"host": "192.168.10.235", "port": "30003"},
]

# 使用的哈希函数数,默认为6  
BLOOMFILTER_HASH_NUMBER = 6

# Bloomfilter使用的Redis内存位,30表示2 ^ 30 = 128MB,默认为22 (1MB 可去重130W URL)  
BLOOMFILTER_BIT = 22

# 不清空redis队列  
SCHEDULER_PERSIST = True  
# 调度队列  
SCHEDULER = "scrapy_redis_cluster.scheduler.Scheduler"  
# 去重 
DUPEFILTER_CLASS = "scrapy_redis_cluster.dupefilter.RFPDupeFilter"  
# queue  
SCHEDULER_QUEUE_CLASS = 'scrapy_redis_cluster.queue.PriorityQueue'

Note:当使用集群时单机不生效

Note: 只有示例配置经过生产环境测试

scrapy_redis_cluster's People

Contributors

thsheep avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.