码迷,mamicode.com
首页 > Web开发 > 详细

metaq入门部署到实战

时间:2017-07-26 17:52:19      阅读:247      评论:0      收藏:0      [点我收藏+]

标签:tom   pop   wrapper   blog   mono   UI   download   订阅   home   

初识metaq

zookeeper部署,这里单机zk为例。

wget http://mirror.bit.edu.cn/apache/zookeeper/zookeeper-3.4.5/zookeeper-3.4.6.tar.gz
tar -zxvf zookeeper-3.4.6.tar.gz
cd  zookeeper-3.4.6
mkdir data
cp conf/zoo_sample.cfg  conf/zoo.cfg

改动zk的配置文件。将data路径dataDir的值设置为zookeeper-3.4.6下的data

hadoop@yard02:~/bigdata/zookeeper-3.4.6$ cat conf/zoo.cfg 
# 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=/home/hadoop/bigdata/zookeeper-3.4.6/data
# the port at which the clients will connect
clientPort=2181
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# Be sure to read the maintenance section of the 
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1

metaq部署

这里使用单机多实例測试

wget http://fnil.net/downloads/metaq-server-1.4.6.2.tar.gz
tar -zxvf metaq-server-1.4.6.2.tar.gz 
cd  taobao/
cp -rf  metamorphosis-server-wrapper ../metaq9123
cp -rf  metamorphosis-server-wrapper ../metaq9124
cp -rf  metamorphosis-server-wrapper ../metaq9125

单机多实例须要解决port冲突的问题

1。改动JMXport,改动服务port,改动dashboardWebport,zk地址

我这里保持metaq9123默认,改动metaq9124。metaq9125

vim metaq9124/conf/server.ini

serverPort=8124
dashboardHttpPort=8121
zk.zkConnect=192.168.137.2:2181

vim metaq9124/bin/env.sh

export JMX_PORT=9124

metaq9125相同,改动成不被占用的接口即可了 启动:

bin/metaServer.sh start

停止

bin/metaServer.sh stop

状态

bin/metaServer.sh status

zk上节点

摘自http://udukwilliam.iteye.com/blog/1931852

1) /consumers:存放消费者列表以及消费记录。消费者列表主要是以组的方式存在。结构主要例如以下:

       /consumers/xxGroup/ids/xxConsumerId:DATA(“:”后的DATA表示节点xxConsumerId相应的数据) 组内消费者Id;DATA为订阅主题列表。以”,”分隔
       /consumers/xxGroup/offsets/xxTopic/分区N:DATA  组内主题分区N的消费进度。DATA为topic下分区N详细进度值
       /consumers/xxGroup/owners/xxTopic/分区N:DATA 组内主题分区N的的消费者。DATA为消费者ID,表示XXTopic下分区N的数据由指定的消费者进行消费

2) /brokers/ids:存放Broker列表,假设Broker与Zookeeper失去连接,则会自己主动注销在/brokers/ids下的broker记录。样例例如以下:

    /brokers/ids/xxBroker

3) /brokers/topics-pub:存放公布的主题列表以及相应的可发送消息的Broker列表,样例例如以下:

    /brokers/topics-pub/xxTopic/xxBroker
    /brokers/topics-pub下记录的是可发送消息到xxTopic的Broker列表,意味着有多少个Broker同意存储Client发送到Topic数据

4) /brokers/topics-sub:存放订阅的主题列表以及相应可订阅的Broker列表。样例例如以下:

    /brokers/topics-sub/xxTopic/xxBroker
    /brokers/topics-sub下记录的可订阅xxTopic的Broker列表,意味着有多少个Broker同意被Client订阅topic的数据


这里使用sohu-zookeeper-view来看了下节点信息。当中meta-example是group

技术分享


技术分享

WEB DASHBOARD 

技术分享

metaq入门部署到实战

标签:tom   pop   wrapper   blog   mono   UI   download   订阅   home   

原文地址:http://www.cnblogs.com/mthoutai/p/7240090.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!