zookeeper 3.4,8
#see http://zookeeper.apache.org/releases.html
wget http://apache.stu.edu.tw/zookeeper/zookeeper-3.4.8/zookeeper-3.4.8.tar.gz
tar zxvf zookeeper-3.4.8.tar.gz
mv zookeeper-3.4.8 /usr/local/zookeeper
cd /usr/local/zookeeper
configuration
vi conf/zoo.cfg
1 | tickTime=2000 |
start & status
bin/zkServer.sh start
bin/zkServer.sh status
netstat|grep 2181
jps
use
bin/zkCli.sh
1 | ls / |
stop
bin/zkServer.sh stop
scala 2.11
apt-get isntall scala #2.11.6-6
scala -version
kafka 0.10.0.1
wget http://apache.stu.edu.tw/kafka/0.10.0.1/kafka_2.11-0.10.0.1.tgz
tar zxvf kafka_2.11-0.10.0.1.tgz
mv kafka_2.11-0.10.0.1 /usr/local/kafka
cd /usr/local/kafka
start
netstat|grep 2181
netstat|grep 9092
jps
bin/zookeeper-server-start.sh config/zookeeper.properties #自帶zookeeper,可以不用自己裝。
bin/kafka-server-start.sh config/server.properties
netstat|grep 2181
netstat|grep 9092
jps
QuorumPeerMain
kafka
jps
use
bin/kafka-topics.sh --zookeeper localhost:2181 --list #list all topics
bin/kafka-topics.sh --zookeeper localhost:2181 --create --replication-factor 1 --partitions 1 --topic hellokafka #create topic hellokafka
bin/kafka-topics.sh --zookeeper localhost:2181 --list #list all topics
bin/kafka-console-producer.sh --broker-list localhost:9092 -topic hellokafka #input some messages into topic hellokafka for test
bin/kafka-console-consumer.sh --zookeeper localhost:2181 -topic hellokafka --from-beginning #retrieve messages from topic hellokafka
stop
bin/zookeeper-server-stop.sh
bin/kafka-server-stop.sh