1 Star 1 Fork 0

javahongxi / golab

Create your Gitee Account
Explore and code with more than 6 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Without author's permission, this code is only for learning and cannot be used for other purposes.
Clone or download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

golab

git clone https://github.com/javahongxi/golab.git
go get ./...

About GoLab

  • lang: Go语法学习与经典示例
  • crawler: 爬虫项目单任务版及并发版
  • crawler_distributed: 爬虫项目分布式版
  • pipeline: 搭建并行处理管道
  • gin: The fastest full-featured web framework

爬虫项目并发版演示

go run mockserver/main.go
  • 启动爬虫
go run crawler/main.go

爬虫项目分布式版演示

go run mockserver/main.go
  • 下载ES并本地启动
bin/elasticsearch
  • 启动存储服务(数据存储到ES)
cd crawler_distributed/persist/server
go run itemsaver.go --port=9090
  • 启动多个worker服务(爬取数据)
cd crawler_distributed/worker/server
go run worker.go --port=9091
go run worker.go --port=9092
  • 启动爬虫
cd crawler_distributed
go run main.go --itemsaver_host=:9090 --worker_hosts=:9091,:9092

并行处理管道演示

示例:对大量数据的外部排序进行并行处理

  • 生成大量数据(写到文件)
go run pipeline/createfile/main.go
  • 演示单机版并行处理
go run pipeline/demo/main.go
  • 演示网络版并行处理
go run pipeline/netdemo/main.go

Go Projects

© hongxi.org | go.hongxi.org

Comments ( 0 )

Sign in for post a comment

About

Cancel

Releases

No release

Contributors

All

Activities

load more
can not load any more
Go
1
https://gitee.com/javahongxi/golab.git
git@gitee.com:javahongxi/golab.git
javahongxi
golab
golab
master

Search