LINUX搭建PySpider爬虫服务
1.环境搭建
yum update -y
yum install gcc gcc-c++ -y
yum install python-pip python-devel python-distribute libxml2 libxml2-devel python-lxml libxslt libxslt-devel openssl openssl-devel -y
pip install --upgrade pip
2.部署MariaDB
yum install mariadb-server mariadb -y
systemctl start mariadb
mysqladmin -u root password "test"
mysql -u root -p
3.部署Redis
wget http://download.redis.io/redis-stable.tar.gz
tar -xzvf redis-stable.tar.gz
mv redis-stable /usr/local/redis
cd /usr/local/redis
make
make install
mkdir -p /etc/redis
cp /usr/local/redis/redis.conf /etc/redis/redis.conf
修改 /etc/redis/redis.conf 文件的 daemonize 配置项为如下:
daemonize yes /usr/local/bin/redis-server /etc/redis/redis.conf pip install --upgrade chardet
easy_install mysql-connector==2.1.
easy_install redis pip install pyspider mkdir /etc/pyspider
然后 /etc/pyspider
目录下创建 pyspider.conf.json,参考下面的内容。
{
"taskdb": "mysql+taskdb://root:yIyyYemC@127.0.0.1:3306/taskdb",
"projectdb": "mysql+projectdb://root:yIyyYemC@127.0.0.1:3306/projectdb",
"resultdb": "mysql+resultdb://root:yIyyYemC@127.0.0.1:3306/resultdb",
"message_queue": "redis://127.0.0.1:6379/db",
"webui": {
"username": "root",
"password": "yIyyYemC",
"need-auth": true
}
}
root
为您 mysql 的用户名, root:
后面的 yIyyYemC
为您刚设置的密码。webui
配置中的 username 及 password 为您访问 WebUI 时候需要的用户名,你也可以不设置用户名密码,直接将 need-auth
设为 false
即可。pyspider -c /etc/pyspider/pyspider.conf.json
nohup pyspider -c /etc/pyspider/pyspider.conf.json &
此时您可以访问 http://139.199.220.127:5000 使用您的爬虫来搜集数据了,具体 pyspider 爬虫脚本的编写及使用教程可以参考 网上资料。
注:此文参考腾讯云
LINUX搭建PySpider爬虫服务的更多相关文章
- 搭建pyspider爬虫服务
1. 环境准备 首先yum更新 yum update -y 安装开发编译工具 yum install gcc gcc-c++ -y 安装依赖库 yum install python-pip pytho ...
- Linux搭建VNC servere服务
此安装方法只适用于centos7以上的版本 一,安装 以root用户运行以下命令来安装vncserver; yum install tigervnc-server 同样运行以下命令来安装vncvie ...
- linux搭建ntp时间同步服务
1.NTP简介 NTP(Network Time Protocol,网络时间协议)用来使计算机时间同步的一种协议.它可以使计算机对其服务器或时钟源做同步化,它可以提供高精准度的时间校正(LAN上与标准 ...
- Linux—搭建Apache(httpd)服务
1.httpd简介? http是Apache超文本传输协议服务器的主程序.它是一个独立的后台进程,能够处理请求的子进程和线程. http常用用的两个版本是httpd-2.2和httpd-2.4 Cen ...
- Linux搭建Scrapy爬虫集成开发环境
安装Python 下载地址:http://www.python.org/, Python 有 Python 2 和 Python 3 两个版本, 语法有些区别,ubuntu上自带了python2.7. ...
- Linux搭建SVN服务器(服务端)
Linux搭建SVN服务器(服务端) 1 安装SVN SVN客户端:TortoiseSVN,官网下载:https://tortoisesvn.net/downloads.html(客户端) # yum ...
- linux 搭建SVN服务端
搞了个服务器,然后现在想搞点事情,于是乎整个SVN在上面,算是熟悉下svn的操作过程 以下内容转载自: https://yq.aliyun.com/articles/6693 ------------ ...
- Linux搭建mysql、apache、php服务总结
本随笔文章,由个人博客(鸟不拉屎)转移至博客园 写于:2018 年 04 月 22 日 原地址:https://niaobulashi.com/archives/linux-mysql-apache- ...
- Linux 使用 docker 下搭建xunsearch 搜索引擎服务
Linux 使用 docker 下搭建 xunsearch 搜索引擎服务 安装 docker 环境(菜鸟教程有说明) 安装docker说明 下载并运行 xunsearch 的服务端:docker安装x ...
随机推荐
- golang gui library 库
andlabs/ui已经重写,稳定性增强,但是组件很少,只提供了几种基础的控件,慎用.gxui死了,别用.linuxdeepin转QT了,所以…… windows系统最好的选择是walk. 首先,写w ...
- 微服务——RestTemplate
GET请求: 第一种:getForEntity: 此方法返回的是ResponseEntity,该对象是Spring对HTTP请求响应的封装. RestTemplate rt = new RestTem ...
- Scala集合(二)
将函数映射到集合 map方法 val names = List("Peter" , "Paul", "Mary") names.map(_. ...
- Jmeter知识点
聚合报告说明 https://www.cnblogs.com/duanxz/p/5464993.html JMeter之Ramp-up Period(in seconds)说明(可同时并发) http ...
- Elasticsearch6.13 升级6.24 单节点停机升级
Elasticsearch6.x 升级6.y 是支持滚动升级的,目前我们测试环境只有一个节点只能停机升级了 准备工作 禁用分片分配 curl -X PUT "localhost:9200/_ ...
- .Net拾忆:Asp.net请求管道
w3wp.exe应该很熟悉,调试应用时候附加到进程就是这个服务:w3wp.exe和应用池相关联,每个应用池会有一个w3wp; 一.Http请求到iis应用池 IIS 5.x iis运行在inetinf ...
- Amber TUTORIAL 4b: Using Antechamber to Create LEaP Input Files for Simulating Sustiva (efavirenz)-RT complex using the General Amber Force Field (GAFF)
sustiva.pdb PDB: 1FKO Create parameter and coordinate files for Sustiva 1. 加氢: $ reduce sustiva.pdb ...
- 比较两种方式的form请求提交
[一]浏览器form表单提交 表单提交, 适用于浏览器提交.像常见的pc端的网银支付,用户在商户商城购买商品,支付时商家系统把交易数据通过form表单提交到三方支付网关,然后用户在三方网关页面完成支付 ...
- 利用css伪类编写冒泡小三角
HTML代码 <div class="lf otherLogin"> <span>其他方式注册</span> <div class=&qu ...
- G 面经 && Leetcode: Longest Repeating Character Replacement
Given a string that consists of only uppercase English letters, you can replace any letter in the st ...