My studying notes for Java,Ruby,Ajax and other any interesting things.

星期一, 九月 30, 2013

jstorm从源码构建

 
前置条件:(linux下面安装见前面文档)
java
maven
1.将jstorm从github中clone出来:

2.修改pom.xml,以避免zookeeper的cdh3u0版本无法找 到:
       <repository>
          <id>central2</id>
          <name>libs-release</name>
          <url>https://repository.cloudera.com/artifactory/libs-release</url>
        </repository>
增加:utf8支持,避免本地编码的warning
   <properties>
        <powermock.version>1.4.11</powermock.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

3.然后根据deploy文件进行执行:mvn clean mvn package assembly:assembly

途中会有warning提示:
[WARNING] Assembly file: /home/xxxx/code/java/jstorm/target/jstorm-jstorm is not a regular file (it may be a directory). It cannot be attached to the project build for installation or deployment.
[WARNING] NOTE: Currently, inclusion of module dependencies may produce unpredictable results if a version conflict occurs.
[WARNING] The following patterns were never triggered in this artifact exclusion filter:
o  'com.alipay.dw:jstorm-client'
o  'com.alipay.dw:jstorm-client-extension'

[WARNING] The following patterns were never triggered in this artifact exclusion filter:
o  'com.alipay.dw:jstorm-client'
o  'com.alipay.dw:jstorm-client-extension'
应该没有什么问题,主要是目录警告和模块依赖警告,在mvn3和mvn2有些区别?

4.package完毕后,会在target目录中生成一个tgz文件: jstorm-jstorm.tar.gz,可以用于部署:

结构如下:
`-- jstorm
    |-- bin --运行路径
    |   `-- jstorm
    |-- conf --配置目录
    |   |-- jstorm.log4j.properties
    |   `-- storm.yaml
    |-- jstorm-client-0.7.1.jar --客户端jar
    |-- jstorm-client-extension-0.7.1.jar --客户端扩展
    |-- jstorm-server-0.7.1.jar --服务jar
    |-- jstorm-ui-0.7.1.war--可以部署在tomcat中用于管理jstorm的运行
    `-- lib--第三方依赖的jar包

构建完毕需要在jstorm的目录中touch RELEASE文件,否则bin/jstorm在执行的时候会报告错误:
******************************************
The jstorm client can only be run from within a release. You appear to be trying to run the client from a checkout of Storm's source code.

You can download a JStorm release 
******************************************

安装zmq和jzmq:
zmq:
tar -xzf zeromq-2.1.7.tar.gz
cd zeromq-2.1.7
./configure
make
sudo make install
jzmq:
#install jzmq
git clone https://github.com/nathanmarz/jzmq.git
cd jzmq
./autogen.sh
./configure
make
sudo make install

建议使用2.1.7,避免导致各种兼容问题。

refer: https://github.com/nathanmarz/storm/wiki/Installing-native-dependencies


本邮件及其附件含有"赶集网"的保密信息,仅限于发送给上面地址中列出的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、或散发)本邮件中的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本邮件!

This e-mail and its attachments contain confidential information from GanJi, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it!

没有评论: