metaq入門部署到實戰

五柳-先生發表於2015-08-21

初識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

單機多例項需要解決埠衝突的問題

1,修改JMX埠,修改服務埠,修改dashboardWeb埠,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 


轉載: http://blog.csdn.net/luyee2010/article/details/40186871

相關文章