使用scrapyd部署项目时出错 [英] error in deploying a project using scrapyd

查看:57
本文介绍了使用scrapyd部署项目时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的项目文件夹中有多个蜘蛛并且想一次运行所有蜘蛛,所以我决定使用scrapyd服务运行它们.我已经开始通过查看这里

I had multiple spiders in my project folder and want to run all the spiders at once, so i decided to run them using scrapyd service. I have started doing this by seeing here

首先我在当前项目文件夹中

First of all i am in current project folder

  1. 我打开了 scrapy.cfg 文件并在

[部署]

我运行了 scrapy server 命令,运行正常,scrapyd 服务器运行

I had run scrapy server command, that works fine and scrapyd server runs

我试过这个命令 scrapy deploy -l

结果:default http://localhost:6800/

结果:

Usage
=====
  scrapy deploy [options] [ [target] | -l | -L <target> ]

deploy: error: Unknown target: scrapyd

当我尝试使用此命令部署项目时 scrapy deploy scrapyd -p default 出现以下错误

when i tried to deploy the project with this command scrapy deploy scrapyd -p default got following error

Usage
=====
  scrapy deploy [options] [ [target] | -l | -L <target> ]

deploy: error: Unknown target: scrapyd

我真的无法确定乳清scrapyd是否显示上述错误,可以引导我找到如何将项目部署到scrapyd的正确方法

I am really unable to identify whey scrapyd is showing the above errors, can lead me in to a correct way of how to deploy a project in to scrapyd

提前致谢.......

Thanks in advance..........

编辑代码:

看到Peter Kirby的回答后,我在scrapy.cfg中命名为target,并在我的项目文件夹中尝试了以下命令,

After seeing the answer of Peter Kirby,i named target in scrapy.cfg and tried the following command in my project folder,

命令:

scrapy deploy ebsite -p ebsite

然后我得到以下错误

Building egg of ebsite-1341808241
'build/lib' does not exist -- can't clean it
'build/bdist.linux-x86_64' does not exist -- can't clean it
'build/scripts-2.7' does not exist -- can't clean it
zip_safe flag not set; analyzing archive contents...
Deploying ebsite-1341808241 to http://localhost:6800/addversion.json
Deploy failed: <urlopen error [Errno 111] Connection refused>

如何解决这个问题.....

How to solve this.....

推荐答案

来自 scrapyd 服务文档:(http://scrapy.readthedocs.org/en/latest/topics/scrapyd.html?highlight=scrapyd)

From scrapyd service documentation: (http://scrapy.readthedocs.org/en/latest/topics/scrapyd.html?highlight=scrapyd)

您可以通过将目标添加到项目的 scrapy.cfg 来定义目标文件...这是定义新目标scrapyd2的示例通过 HTTP 基本身份验证限制访问:

You can define targets by adding them to your project’s scrapy.cfg file... Here’s an example of defining a new target scrapyd2 with restricted access through HTTP basic authentication:

[deploy:scrapyd2]
url = http://scrapyd.mydomain.com/api/scrapyd/
username = john
password = secret

基本上你的错误意味着你的目标"名称不正确.如果我没记错的话,scrapy.cfg 文件将初始目标名称设置为默认".您应该输入的内容类似于:

Essentially what your error means is that your "target" name is not correct. If I remember correctly, the scrapy.cfg file sets the initial target name as "default". What you should be typing is something like:

scrapy deploy default -p project_name

这篇关于使用scrapyd部署项目时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆