【Scrapy + Elasticsearch 搜索引擎实战】(一)准备工作

一、安装 Python

Python

# 在 usr 目录下创建 python 目录
mkdir usr/python
# 切换到 python 目录
cd python
# 下载 Python3.9 压缩包
wget https://www.python.org/ftp/python/3.9.4/Python-3.9.4.tgz
# 解压缩
tar -zxvf Python-3.9.4.tgz
# 切换到 Python-3.9.4 目录
cd Python-3.9.4
# 其他准备工作
yum update -y
yum groupinstall -y 'Development Tools'
yum install -y gcc openssl-devel bzip2-devel libffi-devel
# 手动编译
## 配置安装路径
./configure prefix=/usr/local/python3 
## 编译与安装
make && make install
#添加软链接 
ln -s /usr/local/python3/bin/python3.9 /usr/bin/python
ln -s /usr/local/python3/bin/pip3.9 /usr/bin/pip
#测试是否安装成功了 
python -V
# 安装完成,查看Python版本

二、安装 Scrapy

Scrapy 是一个开源的爬虫框架。

pip install scrapy

三、安装 Elasticsearch

Elasticsearch 是一个分布式搜索和数据分析引擎。

准备工作

# 安装 perl-Digest-SHA
yum install perl-Digest-SHA

安装

# 在 usr 目录下创建 elasticsearch 目录
mkdir elasticsearch
# 切换到 elasticsearch 目录
cd elasticsearch
# 下载 elasticsearch
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.12.0-linux-x86_64.tar.gz
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.12.0-linux-x86_64.tar.gz.sha512
# 校验
shasum -a 512 -c elasticsearch-7.12.0-linux-x86_64.tar.gz.sha512
# 解压缩
tar -xzf elasticsearch-7.12.0-linux-x86_64.tar.gz

es5之后不允许root用户启动,需要切换到非root用户

# 创建用户
adduser elasticsearch
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值