Windows直接部署crawlab

1. 拉取代码

git clone https://github.com/crawlab-team/crawlab

2. 安装 Node 环境

https://github.com/coreybutler/nvm-windows/releases
nvm install 20.18.0
nvm use 20.18.0

3.安装MongoDB

在这里插入图片描述

https://www.mongodb.com/try/download/community

4.安装Redis

在这里插入图片描述

https://www.runoob.com/redis/redis-install.html

5.安装前后端

5.1 安装前端所需库

npm install -g serve

cd frontend

npm install

5.2 修改后端配置

crawlab/backend/conf
api:
  address: "http://localhost:8000"  # API 地址
mongo:
  host: 127.0.0.1  # MongoDB host
  port: 27017  # MongoDB port
  db: crawlab_test  # MongoDB database
  username: ""  # MongoDB username
  password: ""  # MongoDB password
  authSource: "admin"  # MongoDB auth source database
redis:
  address: 127.0.0.1  # Redis host
  password: ""  # Redis password
  database: 1  # Redis database
  port: 6379  # Redis port
log:
  level: info  # Log Level
  path: "/var/logs/crawlab"  # Log Path
  isDeletePeriodically: "N"  # 是否定期删除日志(默认为否)
  deleteFrequency: "@hourly"  # 删除日志频率
server:
  host: 0.0.0.0  # 后端监听地址
  port: 8000  # 后端监听端口
  master: "Y"  # 是否为主节点
  secret: "crawlab"  # JWT secret
  register:
    # mac地址 或者 ip地址,如果是ip,则需要手动指定IP
    type: "mac"
    ip: ""
  lang: # 安装语言环境, Y 为安装,N 为不安装
    python: "Y"
    node: "N"
    java: "N"
    dotnet: "N"
spider:
  path: "/app/spiders"  # 爬虫路径
task:
  workers: 4  # 同时运行任务的执行器数量
other:
  tmppath: "/tmp"  # 临时文件目录
version: 0.4.7  # 版本号
setting:
  allowRegister: "N"  # 是否允许注册
  enableTutorial: "N"  # 是否弃用教程
  runOnMaster: "Y"  # 是否在主节点上运行任务
  demoSpiders: "N"  # 是否加载demo爬虫
  checkScrapy: "Y"  # 是否自动检查Scrapy
notification: # 消息通知
  mail: # 邮箱通知
    server: '' # SMPT 服务器地址
    port: ''  # SMTP 服务器端口
    senderEmail: ''  # 发送者邮箱
    senderIdentity: ''  # 发送者身份
    smtp:  # SMTP
      user: ''  # SMTP 用户名
      password: ''  # SMTP 密码

参考配置https://docs-v05.crawlab.cn/zh/Config/

5.3 安装后端

cd ../backend
go install ./...

5.4 设置master节点

C:\Users\用户名\.crawlab\config.json

将配置中is_master 改为true

这一步主要解决启动不是master节点导致服务无法启动问题

info current node type: worker
context deadline exceeded

在这里插入图片描述

5.5 启动后端

在这里插入图片描述

$env:CRAWLAB_NODE_MASTER="true"
go run main.go server

5.6 启动前端

在这里插入图片描述

# 本地环境运行
npm run serve

# 生产环境运行
npm run build
npm run serve:dist

6.安装Nginx

在这里插入图片描述

https://nginx.org/en/download.html

项目地址 https://github.com/Cocktailpy/crawlab
参考 Crawlab 中文文档

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Cocktail_py

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值