Steps and Tips in Distributed Mode——Cola

1. Please ensure your setuptool is the latest version or the coca is unable to work correctly.
2. You need to change the mongo host in master`s "weibo.yaml" file to your master`s real IP, or the worker`s job could not store the crawler to your master mongo database. 

Start master:
coca master -s [ip:port]
The ip and port is not necessary because the master may be allocated an ip and a port automatically.

Start one or more workers:

coca worker -s -m [ip:port]
Please ensure the parameters sequence is correct.
This ip and port is essential and it should be the master`s. You can just fill it with the ip and port showed in the master cmd.
-m means master.

Then run the application(weibo as an example):

coca job -u /path/to/cola/app/weibo -r
'/path/to/cola/app/weibo' this path is necessary in windows system. And pay attention to the blanks exist in file name.
In this circumstance, you can use double quote for the file name. eg. coca job -u "D:My doc/cola/app/weibo" -r

>python -c "import tempfile; print tempfile.gettempdir()"
Then the path showed stores your master or worker data folder.
If the worker refuse to run, you can try to clear these data folder, since it may be polluted after running wrongly in the previous operation.

Kill master to stop the whole cluster:

coca master -k

List all jobs:

coca job -m [ip:port] -l

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值