大数据全系列 教程
1869个小节阅读:467k
目录
408考研
JAVA全系列 教程
面向对象的程序设计语言
Python全系列 教程
Python3.x版本,未来主流的版本
人工智能 教程
顺势而为,AI创新未来
大厂算法 教程
算法,程序员自我提升必经之路
C++ 教程
一门通用计算机编程语言
微服务 教程
目前业界流行的框架组合
web前端全系列 教程
通向WEB技术世界的钥匙
大数据全系列 教程
站在云端操控万千数据
AIGC全能工具班
A A
White Night
启动zk集群(node2、node3、node4),并查看状态。
xxxxxxxxxx
[root@node2 ~]# zkServer.sh start
Starting zookeeper ... STARTED
[root@node2 ~]# zkServer.sh status
Mode: follower
node2上调用脚步启动Kafka集群(node2、node3、node4)。
xxxxxxxxxx
[root@node2 ~]# kafka.sh start
--------start node2's kafka----------
--------start node3's kafka----------
--------start node4's kafka----------
在Kafka中创建对应的日志接收topic
xxxxxxxxxx
[root@node2 ~]# kafka-topics.sh --bootstrap-server node3:9092 --create --partitions 3 --replication-factor 2 --topic songinfo
Created topic userlog.
[root@node2 ~]# kafka-topics.sh --bootstrap-server node3:9092 --list
......
songinfo
node3上删除之前测试产生的日志
xxxxxxxxxx
[root@node3 ~]# rm -rf /var/music_logs/userplaysong
node3节点上将日志接口程序启动
xxxxxxxxxx
[root@node3 ~]# cd /opt/www/
[root@node3 www]# ls
LogCollector-0.0.1-SNAPSHOT.jar
[root@node3 www]# java -jar LogCollector-0.0.1-SNAPSHOT.jar
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.2.5.RELEASE)
Starting UserlogcollectorApplication v0.0.1-SNAPSHOT on node3 with PID 3443
......
Started UserlogcollectorApplication in 1.392 seconds (JVM running for 1.685)
node3上启动Flume日志采集脚本监控目录日志
xxxxxxxxxx
flume-ng agent --name b -f /opt/flume-1.9.0/jobs/music_song.properties -Dflume.root.logger=INFO,console
启动redis
xxxxxxxxxx
[root@node4 ~]# cd /usr/local/redis/
[root@node4 redis]# redis-server redis.conf
修改MakeData项目的ProdeceUserPlaySongInfoLog.java
类,然后运行该类
xxxxxxxxxx
String url="http://node3:8686/collector/common/"+logType;
运行RealTimeHotSong
检查redis的db6
检查MySQL的songresult.hotsong
表中的数据