day2-采集数据

采集数据

三台机开zkServer.sh start

spark01开start-all.sh

1 准备

  1. 日志文件

    mkdir -p /export/data/log/2023

  2. 采集方案配置文件

    mkdir /export/data/flume_conf

第一种方法(vim),第二种方法(scp):把素材的文件上传

  1. 移动python文件和拦截器

    mv g* /export/servers/

    mv FlumeInterceptor.jar /export/servers/flume-1.10.1/lib

2 采集

在spark03运行

  1. 启动Flume Agent

    复制代码
    cd /export/servers/flume-1.10.1/

    flume-ng agent --name a1 --conf /export/servers/flume-1.10.1/conf/ --conf-file /export/data/flume_conf/flume-logs-history.conf -Dflume.root.logger=INFO,console

  2. 开启新的xshell命令窗口,启动Python程序,采集历史数据

    python /export/servers/generate_user_data_history.py

  3. 检查采集的历史用户行为数据

    复制代码
    hdfs dfs -ls /origin_data/log/user_behaviors
    
    hdfs dfs -ls /origin_data/log/user_behaviors/2023-01-06
相关推荐
用户36105886261210 小时前
SparkStreaming 之 updateStateByKey 算子详解及代码实现
大数据·spark
用户3610588626121 天前
SparkStreaming 之 transform 算子详解及代码实现
大数据·spark
starzy19902 天前
SparkStreaming 之 Direct 模式深度剖析
大数据·spark
JLWcai202510092 天前
树脂砂轮质保与科学存放
mongodb·zookeeper·spark·memcached·storm
用户3610588626122 天前
SparkStreaming 之 DStream 底层结构剖析
大数据·spark
Code知行合壹3 天前
数据中台设计
大数据·分布式·spark
weixin_307779133 天前
PySpark根据输入的表名和过滤条件生成 INSERT 语句
python·spark·云计算·big data
阿里云大数据AI技术4 天前
一套 Spark SQL,打通多种 Catalog:EMR Serverless Spark 统一数据处理实践
人工智能·sql·spark
绿算技术4 天前
大模型本地化的经济账:DeepSeek V4 Flash 部署实测
人工智能·科技·算法·spark