Skip to content

jnan77/metaq-php

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#MetaQ PHP Client library

  • Support producer short connection and long connection, this require the config file
  • Producer random select a broker-partition for load balance, no proxy required
  • Support master async salve group cluster, circle backups
  • Producer auto failover
  • Consumer will read from both master and slaves
  • Slave broker can be read by consumers
  • Store consumer offset in zookeeper
  • Consumer do not require the config file, they will fetch meta data from zookeeper
  • Consumer will auto-rebalance if consumer group changes
  • Suggest to use superviord auto restarting when consumer process dies. see http://supervisord.org/

##MetaQ server installation and configurations:

wget http://fnil.net/downloads/metaq-server-1.4.6.2.tar.gz

Web UI for MetaQ: http://ip:8120/
Web UI for zookeeper: https://github.com/qiuxiafei/zk-web.git

##Notes

Remember to set

updateConsumerOffsets=false

Master node configuration:

[system]
brokerId=0
numPartitions=1
serverPort=8123
dashboardHttpPort=8120
unflushThreshold=1000
unflushInterval=10000
maxSegmentSize=1073741824
maxTransferSize=1048576
deletePolicy=delete,168
deleteWhen=0 0 6,18 * * ?
flushTxLogAtCommit=1
stat=true
getProcessThreadCount=40
putProcessThreadCount=40
dataPath=/home/bruce/meta2

;; Update consumers offsets to current max offsets when consumers offsets are out of range of current broker's messages.
;; It must be false in production.But recommend to be true in development or test.
updateConsumerOffsets=false

[zookeeper]
zk.zkConnect=localhost:2181
zk.zkSessionTimeoutMs=30000
zk.zkConnectionTimeoutMs=30000
zk.zkSyncTimeMs=5000

;; Topics section
[topic=t1]
numPartitions=5

Slave configuration:

slaveId=1
slaveGroup=meta-slave-group
slaveMaxDelayInMills=50
autoSyncMasterConfig=true

Install PHP zookeeper extension:

1. Install libzookeeper
2. pecl install zookeeper-0.2.2

Packages

No packages published

Languages

  • PHP 100.0%