爬虫遇到几个奇怪问题

摘要: 最近工作需要抓取很多广告推广数据,渠道多账户多,统计比较费劲,就写个爬虫挨着采集入库方便统计。 1、RedirectException: Maximum redirects (50) exceeded 这个问题说个类: 核心代码这个大家一看就懂了,response返回302重定向,结果形成死循环,超 阅读全文
posted @ 2018-08-27 18:41 Hugh_txp 阅读(543) 评论(0) 推荐(0) 编辑

Linux中find常见用法示例

摘要: 转载的别人的 Linux中find常见用法示例 ·find path -option [ -print ] [ -exec -ok command ] {} \; find命令的参数; pathname: find命令所查找的目录路径。例如用.来表示当前目录,用/来表示系统根目录。-print: f 阅读全文
posted @ 2017-04-14 14:53 Hugh_txp 阅读(158) 评论(0) 推荐(0) 编辑

linux 自动删除n天前文件

摘要: 现在系统每天生成一个日期文件夹,并压缩上传到ftp服务器,造成目录下文件太多,所以决定写个定时删除文件的任务 写脚本文件 find /home/data -mtime +90 -name "*.txt" -exec rm -rf {} \;find /home/data -mtime +90 -na 阅读全文
posted @ 2017-04-14 14:51 Hugh_txp 阅读(436) 评论(0) 推荐(0) 编辑

elasticsearch 插件使用

摘要: 5.3.0新版本好像插件和开源的项目没有以前的多,官网就那么几个 常用的先安装Kibana: 提供炫丽的可视化图形展示并且作为elasticsearch的搜索的小清新客户端 1、下载安装包 wget https://artifacts.elastic.co/downloads/kibana/kiba 阅读全文
posted @ 2017-04-05 11:25 Hugh_txp 阅读(245) 评论(0) 推荐(0) 编辑

elasticsearch 分布式部署

摘要: 修改配置文件 /config/elasticsearch.yml 我用两台机器,内网地址分别为230 和 231 处理启动报错一: [2017-01-12T15:55:55,433][INFO ][o.e.b.BootstrapCheck ] [SfD5sIh] bound or publishin 阅读全文
posted @ 2017-04-05 11:11 Hugh_txp 阅读(635) 评论(0) 推荐(0) 编辑

elasticsearch5.3.0 安装

摘要: 公司有项目打算用elasticsearch,所以研究了下,目前最新版本5.3.0 安装 1、下载包 https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.0.0.tar.gz 2、 解压 tar -xvf elast 阅读全文
posted @ 2017-04-05 11:00 Hugh_txp 阅读(206) 评论(0) 推荐(0) 编辑

事务没有提交导致 锁等待Lock wait timeout exceeded异常

摘要: 异常:Lock wait timeout exceeded; try restarting transaction解决办法: 执行select * from information_schema.innodb_trx 之后找到了一个一直没有提交的只读事务, 找到对应的线程后,执行 kill thre 阅读全文
posted @ 2017-02-03 15:24 Hugh_txp 阅读(157) 评论(0) 推荐(0) 编辑

linux 服务器信息查看

摘要: 写项目总结报告,需要统计需要系统的配合 1、# uname -a (Linux查看版本当前操作系统内核信息) Linux localhost.localdomain 2.4.20-8 #1 Thu Mar 13 17:54:28 EST 2003 i686 athlon i386 GNU/Linux 阅读全文
posted @ 2017-01-23 19:08 Hugh_txp 阅读(323) 评论(0) 推荐(0) 编辑

python2.7安装PIL.Image模块

摘要: 这是大家常用的两种安装方法 sudo pip install PIL pip install PIL --allow-external PIL --allow-unverified PIL 如果安装成功皆大欢喜啊,我的却出现了问题 这个是说明PIL已经找不到,其实现在已经用Pillow代替了PIL, 阅读全文
posted @ 2016-12-30 16:16 Hugh_txp 阅读(8759) 评论(0) 推荐(0) 编辑

ansible 简单使用

摘要: 前面讲完安装,现在说说怎么用 1、创建目录 mkdir -p /etc/ansible 2、 编辑(或创建)/etc/ansible/hosts 并在其中加入一个或多个远程系统:echo '192.168.10.230' > /etc/ansible/hosts 3、执行ping : ansible 阅读全文
posted @ 2016-12-21 17:17 Hugh_txp 阅读(293) 评论(0) 推荐(0) 编辑