Giter VIP home page Giter VIP logo

frontera_example's Introduction

Example frontera project

This is an example frontera project, combining scrapy's quotes example and frontera's cluster-setup example. (links: https://doc.scrapy.org/en/latest/intro/tutorial.html and http://frontera.readthedocs.io/en/v0.7.1/topics/cluster-setup.html

How to run it

First off open a bunch (7 should be enough) of terminal windows (tmux is awesome for this).

First the backend

Run the following cmd to get hbase, kafka, and zookeeper running. It will also create the HBase namespace.

docker-compose -f docker-compose-backend.yml up -d 
echo "waiting for hbase startup (30 seconds)"
sleep 30
echo "create_namespace 'crawler'" | docker exec -i docker_hbase /hbase/bin/hbase shell

Next the Storage workers

In a separate terminal window run python -m frontera.worker.db --config frontier.dbworker --no-incoming In another separate terminal window run python -m frontera.worker.db --no-batches --config frontier.dbworker

Next the strategy workers

In a separate terminal windows run python -m frontera.worker.strategy --config frontier.sworker --partition-id 0 In another separate terminal window run python -m frontera.worker.strategy --config frontier.sworker --partition-id 1

Next the crawlers

In separate terminal windows run:

  • scrapy crawl quotes -L INFO -s SPIDER_PARTITION_ID=0
  • scrapy crawl quotes -L INFO -s SPIDER_PARTITION_ID=1

frontera_example's People

Contributors

colmex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

frontera_example's Issues

[ENCODING] unpack error

Getting following error for reading messages from kafka

2020-09-07 18:51:39 [messagebus-backend] WARNING: Could not decode message: b'http://quotes.toscrape.com/page/1/', error unpack(b) received extra data.

keyerror: Frontier-Request

Getting keyerror frontier-request. Probably due to feeding urls to spider directly and not through frontera

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.