Kafka的入门简单命令
Step 1: 启动服务器首先启动zookeeperbin/zookeeper-server-start.sh config/zookeeper.properties(远程启动的时候需要在后面加上一个 & 作为后台进程,然后断开和远程的链接)接着启动kafka服务器bin/kafka-server-start.sh config/server.propertiesStep
Step 1: 启动服务器
首先启动zookeeper
bin/zookeeper-server-start.sh config/zookeeper.properties
(远程启动的时候需要在后面加上一个 & 作为后台进程,然后断开和远程的链接)
bin/zookeeper-server-start.sh config/zookeeper.properties &
接着启动kafka服务器
bin/kafka-server-start.sh config/server.properties &
Step 2: 创建 一个 topic
bin/kafka-topics.sh –create –zookeeper localhost:2181 –replication-factor 1 –partitions 1 –topic test
查看topicbin/kafka-topics.sh –list –zookeeper localhost:2181
Step 3: Send some messages
bin/kafka-console-producer.sh –broker-list localhost:9092 –topic test
This is a message
This is another message
Step 4: 启动一个客户端(消费者)
bin/kafka-console-consumer.sh –zookeeper localhost:2181 –topic test –from-beginning
参考:http://www.cnblogs.com/qingyuuu/p/5844790.html
http://blog.csdn.net/tangdong3415/article/details/53432166
更多推荐
所有评论(0)