zoukankan      html  css  js  c++  java
  • STORM_0002_在做好的zookeeper集群上搭建storm的开发环境

    参考文献
    http://www.cnblogs.com/panfeng412/archive/2012/11/30/how-to-install-and-deploy-storm-cluster.html
    按照这个文献安装相应的支持软件

    参考文献
    http://blog.csdn.net/u011362822/article/details/42463695
    提醒我一个关于zeromq的./configure时候的错误

    参考文献
    http://uohzoaix.github.io/studies/2014/04/15/stormCluster/
    提醒我两个关于jzmq安装时候的错误处理

    在~/.bashrc中配置
    #storm
    export STORM_HOME="/home/jason/StormProcessing/apache-storm-1.0.1"
    export PATH=$STORM_HOME/bin:$PATH

    在storm的配置文件中这样去配置

     storm.zookeeper.servers:
         - "192.168.60.129"
         - "192.168.60.132"
         - "192.168.60.133"
     storm.local.dir: "/home/jason/StormProcessing/apache-storm-1.0.1/workdir"
    
     nimbus.host: "192.168.60.129"
    
     supervisor.slots.ports: 
        - 6700
        - 6701
        - 6702
        - 6703

    这个配置文件的格式的要求比较严格要小心

    在其中的一个节点运行下面的命令,让这个节点成为nimbus:
    Nimbus: 在Storm主控节点上运行"bin/storm nimbus >/dev/null 2>&1 &"启动Nimbus后台程序,并放到后台执行;

    在其他的节点运行下面的命令,成为supervisor:
    Supervisor: 在Storm各个工作节点上运行"bin/storm supervisor >/dev/null 2>&1 &"启动Supervisor后台程序,并放到后台执行;

    在nimbus运行下面的命令去看ui监控的情况:
    UI: 在Storm主控节点上运行"bin/storm ui >/dev/null 2>&1 &"启动UI后台程序,并放到后台执行,启动后可以通过http://{nimbus host}:8080观察集群的worker资源使用情况、Topologies的运行状态等信息。

    [小总结]
        bin/storm nimbus >/dev/null 2>&1 &
        bin/storm ui >/dev/null 2>&1 &
        bin/storm supervisor >/dev/null 2>&1 &
        storm/bin/storm logviewer >/dev/null 2>&1 &  

    https://192.168.60.129:8080/
    发现没什么东西

    事实上我的后台程序,没运行就出错退出了。
    为了看到出错的问题
    我不再用后台运行了

    jason@ubuntu:~/StormProcessing/apache-storm-1.0.1/bin$ storm nimbus
    Traceback (most recent call last):
      File "/home/jason/StormProcessing/apache-storm-1.0.1/bin/storm.py", line 766, in <module>
        main()
      File "/home/jason/StormProcessing/apache-storm-1.0.1/bin/storm.py", line 763, in main
        (COMMANDS.get(COMMAND, unknown_command))(*ARGS)
      File "/home/jason/StormProcessing/apache-storm-1.0.1/bin/storm.py", line 526, in nimbus
        jvmopts = parse_args(confvalue("nimbus.childopts", cppaths)) + [
      File "/home/jason/StormProcessing/apache-storm-1.0.1/bin/storm.py", line 144, in confvalue
        p = sub.Popen(command, stdout=sub.PIPE)
      File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
        errread, errwrite)
      File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
        raise child_exception
    OSError: [Errno 8] Exec format error
      File "/home/jason/StormProcessing/apache-storm-1.0.1/bin/storm.py", line 766, in <module>
        main()
      File "/home/jason/StormProcessing/apache-storm-1.0.1/bin/storm.py", line 763, in main
        (COMMANDS.get(COMMAND, unknown_command))(*ARGS)
      File "/home/jason/StormProcessing/apache-storm-1.0.1/bin/storm.py", line 569, in supervisor
        jvmopts = parse_args(confvalue("supervisor.childopts", cppaths)) + [
      File "/home/jason/StormProcessing/apache-storm-1.0.1/bin/storm.py", line 144, in confvalue
        p = sub.Popen(command, stdout=sub.PIPE)
      File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
        errread, errwrite)
      File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
        raise child_exception

    可以看到仿佛是权限或者是python的问题


    那么关闭ubuntu的防火墙
    ufw disable
    ufw enable//重新开启防火墙

    因为我没安装python本身自己带python
    所以配置一下就行了
    #python
    export PYTHON_HOME="/usr/lib/python2.7"
    export PATH=$PYTHON_HOME:$PATH

    但是还是出现很多的错误根本运行不起来
    而且发现虽然这些需要的脚本都在$PATH路径下
    但是用sudo执行的时候还是找不到命令
    有时候zookeeper根本启动不起来

    所以每次运行比如
    sudo ./zkServer.sh start
    sudo ./zkServer.sh status
    sudo ./storm nimbus
    sudo ./storm supervisor
    的时候都需要跑到相应的bin路径下才可以

    无奈没法运行就全部重启,然后就可以看到亲爱的UI界面了

    启动拓扑
    storm jar allmycode.jar org.me.MyTopology arg1 arg2 arg3
    allmycode.jar是包含Topology实现代码的jar包
    org.me.MyTopology的main方法是Topology的入口
    arg1、arg2和arg3为org.me.MyTopology执行时需要传入的参数
    停止拓扑
    storm kill {toponame}
    其中,{toponame}为Topology提交到Storm集群时指定的Topology任务名称。

    为了真实的看到效果
    参考文献
    http://blog.csdn.net/loloxiaoz3/article/details/19294289
    按照上面的方法,下载一个例子程序
    使用maven编译storm_starter源码
    下载:git clone https://github.com/nathanmarz/storm-starter.git
    编译:sudo mvn -f m2-pom.xml compile
    打包:sudo mvn -f m2-pom.xml package
    删除:sudo mvn -f m2-pom.xml clean
    mvn -f 表示强制使用 m2-pom来编译

    但是mvn下载的Jar包比较慢,到现在还没看到结束的迹象,估计今天看不到UI了。


    向storm集群提交storm_starter中的example
    提交topology:
    sudo storm jar storm-starter-0.0.1-SNAPSHOT-jar-with-dependencies.jar storm.starter.WordCountTopology WordCount
    终止topology:
    storm kill WordCount


    万事走心 精益求美


  • 相关阅读:
    Caused by: java.lang.ClassNotFoundException: org.hibernate.annotations.common.reflection.MetadataPro
    Caused by: java.lang.ClassNotFoundException: org.dom4j.DocumentException
    让你的C程序更有效率的10种方法
    c++效率浅析
    Caused by: java.lang.ClassNotFoundException: org.hibernate.engine.FilterDefinition
    Caused by: java.lang.ClassNotFoundException: javax.transaction.TransactionManager
    Caused by: java.lang.NoClassDefFoundError: org/hibernate/cfg/Configuration
    Caused by: java.lang.ClassNotFoundException: org.aspectj.weaver.reflect.ReflectionWorld$ReflectionWo
    Caused by: java.lang.ClassNotFoundException: org.jbpm.pvm.internal.processengine.SpringHelper
    Caused by: java.lang.ClassNotFoundException: org.aopalliance.intercept.MethodInterceptor
  • 原文地址:https://www.cnblogs.com/kongchung/p/5528216.html
Copyright © 2011-2022 走看看