Strorm学习02--Storm安装

    xiaoxiao2021-03-25  151

    一、安装启动zookeeper

    ZK为什么要用3.4.5,因为它支持磁盘的快照和namenode的定期删除, 避免磁盘被打满

    配置:

    # The number of milliseconds of each tick tickTime=2000 # The number of ticks that the initial synchronization phase can take initLimit=10 # The number of ticks that can pass between sending a request and getting an acknowledgement syncLimit=5 # the directory where the snapshot is stored. # do not use /tmp for storage, /tmp here is just example sakes. dataDir=/zookeepertest/data autopurge.purgeInterval=1 # the port at which the clients will connect clientPort=2181 server.1=test:2888:3888 server.2=test1:2888:3888 server.3=test2:2888:388 dataDi ZK所有的数据都写在dataDir下面autopurge.purgeInterval autopurge.purgeInterval=1这是什么意思呢,就是每隔一小 时,它来清理dataDir里面的数据,因为ZK会产生snapshot 和binlog,产生的速度非常快,用不了几天就会把磁盘给打满, 我们一小时清理一次就可以有效的避免这个问题,清理的规则 是清理的时候它会保留最新的3个文件,当然这个3也是可以 配置的server.1=test:2888:3888 server.x 的x在myid中设置的编号

    storm 集群

    二、安装Storm

    下载,解压缩

    2.1 配置Storm的配置文件storm.yaml

    cd /usr/local/storm/conf vi storm.yaml

    修改如下:添加集群, 设置主节点

    分发到各节点

    scp

    三、启动Storm

    3.1、启动nimbus

    在主节点启动nimbus

    cd /usr/local/storm mkdir logs ./bin/storm nimbus >> logs/nimbus.out 2>&1 &

    3.2启动UI

    cd /usr/local/storm ./bin/storm ui >> logs/ui.out 2>&1 &

    3.3 启动logviewer

    启动在8000端口

    cd /usr/local/storm ./bin/storm logviewer >> logs/logviewer 2>&1 &

    3.4、启动superviour

    在每个节点启动supervisor

    cd /usr/local/storm ./bin/storm supervisor >> logs/supervisor .out 2>&1 &

    3.5验证 打开浏览器

    http://test:8080

    3.6提交 Topology

    cd /usr/local/storm ./bin/storm jar examples/storm-starter/storm-startertopologies-0.9.4.jar storm.starter.WordCountTopology wordcount
    转载请注明原文地址: https://ju.6miu.com/read-5552.html

    最新回复(0)