Storm集群配置说明

来源:互联网 发布:北京云计算公司 编辑:程序博客网 时间:2024/05/22 12:21

效果Storm集群配置说明

1、软件需求

(1)      操作系统:CentOS6.5 64位,硬盘500G,内存4G,CPU 4核;

(2)      Java版本:jdk1.8.0_112 64位 for Linux;

(3)      Zookeeper版本:zookeeper-3.4.9;

(4)      Storm版本:apache-storm-1.0.2;

(5)      FlashFXP:Centos管理软件;

2、集群节点分布

    整个Storm集群需要4台服务器,服务器上的软件安装如下图:


   

3、FlashFXP连接到CentOS

打开FlashFXP软件,界面如下:

点击按钮弹出如下界面:

   输入address or URL集群地址,UserName和Password点击Connect,连接到CentOS服务器;

4、JDK1.8安装

(1)   用FlashFXP,把JDK1.8拷贝到服务器的opt目录下;

 

(2)   配置JDK环境变量:使用 vi /ect/profile 命令,增加如下内容

      exportJAVA_HOME=/opt/jdk1.8.0_112

exportPATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH

(3)   使用source命令使profile生效:source /ect/profile

5、Zookeeper安装

(1)用FlashFXP把Zookeeper拷贝到3台服务器的opt目录下;

(2)修改zoo.cfg配置文件,文件位置zookeeper-3.4.9\conf内容如下:

# The number ofmilliseconds of each tick

tickTime=2000

# The number ofticks that the initial

# synchronizationphase can take

initLimit=10

# The number ofticks that can pass between

# sending a requestand getting an acknowledgement

syncLimit=5

# the directorywhere the snapshot is stored.

# do not use /tmpfor storage, /tmp here is just

# example sakes.

dataDir=/opt/zookeeperdata

dataLogDir=/opt/zookeeperlog

# the port at whichthe clients will connect

clientPort=2181

# the maximumnumber of client connections.

# increase this ifyou need to handle more clients

#maxClientCnxns=60

#

# Be sure to readthe maintenance section of the

# administratorguide before turning on autopurge.

#

#http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance

#

# The number ofsnapshots to retain in dataDir

#autopurge.snapRetainCount=3

# Purge taskinterval in hours

# Set to"0" to disable auto purge feature

#autopurge.purgeInterval=1

server.1=server1:2888:3888

server.2=server2:2888:3888

server.3=server3:2888:3888

      把zoo.cfg文件中的server1,server2,server3修改成服务器IP。

      dataDir中增加myid文件,myid内容与zoo.cfg内容一致,是server.1总的1,2,3值。

(4)   zookeeper启动命令

cd /opt/zookeeper-3.4.9/bin

./zkServer.sh start

 

6、Storm安装

(1)      用FlashFXP把Storm拷贝到4台服务器的opt目录下;

(2)      修改storm.yaml文件内容如下,文件路径apache-storm-1.0.2\conf

########### TheseMUST be filled in for a storm configuration

#ui.port: 9090

storm.zookeeper.servers:

- "server1"

- "server2"

- "server3"

nimbus.seeds:["server1"]

supervisor.slots.ports:

- 6700

- 6701

- 6702

- 6703

         配置文件中的server1,server2,server3是安装zookeeper服务器ip,nimbus.seeds是storm的nimbus服务器ip。

(3)      Storm启动命令

cd/opt/apache-storm-1.0.2/bin

./storm nimbus //启动主调度进程

./storm ui     //启动管理界面

./storm supervisor //启动任务监听进程

(4)      StormUI 界面

访问Url: http://serverui:8080/index.html,界面如下,说明Storm部署成功。

(5)      Storm提交任务

./storm jar xxx.jarcom.hisense.StormMain HiCON_Storm //提交任务

./storm kill HiCON_Storm//停止任务

7、Storm任务监控

8、提交任务日志位置

提交任务会在logs下面的workers-artifacts下,用任务名称-编号的方式标识,点开任务里面有日志文件,如下图:

0 0
原创粉丝点击