惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - coffee

apache配置http跳转https centos7使用yum安装mysql5.7 Jboot实现Redis操作事件通知 sun.misc.BASE64Encoder找不到jar包的解决方法 使用命令修改git的用户名和提交的邮箱 apache,请求来源特定域名,重定向到图片域名。 使用cron+php脚本监控后台任务脚本 Shell_exec php with nohup git常用命令 Jenkins+Gitee异常解决 statsvn使用小记 java.net.URLEncoder对中文的编码和解码 Apache配置WebSocket代理 php批量检查https证书有效期 504 Gateway Time-out ( Nginx + PHP ) 解决小计 VMware 扩展磁盘容量 查看mysql字符集、修改数据库、数据表、字段字符集 Docker常用命令 Docker 安装 MySQL 学习笔记
kafka安装和简单测试
coffee · 2019-12-11 · via 博客园 - coffee

kafka安装和简单测试

# 安装zookeeper(apache-zookeeper-3.5.6-bin)
https://archive.apache.org/dist/zookeeper/zookeeper-3.5.6/apache-zookeeper-3.5.6-bin.tar.gz

# 安装kafka(kafka_2.11-2.3.1)
http://mirrors.tuna.tsinghua.edu.cn/apache/kafka/2.3.1/kafka_2.11-2.3.1.tgz

# 启动zookeeper
[root@localhost apache-zookeeper-3.5.6-bin]# bin/zkServer.sh start
/usr/bin/java
ZooKeeper JMX enabled by default
Using config: /svelldata/apache-zookeeper-3.5.6-bin/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED

# 启动kafka server
[root@localhost kafka_2.11-2.3.1]# bin/kafka-server-start.sh config/server.properties

# 创建一个话题,test话题2个分区
[root@localhost kafka_2.11-2.3.1]# bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 2 --topic mytopic

[root@localhost kafka_2.11-2.3.1]# bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic mytopic

# 显示所有话题
[root@localhost kafka_2.11-2.3.1]# bin/kafka-topics.sh --list --zookeeper localhost:2181

# 显示话题信息
[root@localhost kafka_2.11-2.3.1]# bin/kafka-topics.sh --describe --zookeeper localhost:2181 --topic mytopic

# 启动一个生产者(输入消息)
[root@localhost kafka_2.11-2.3.1]# bin/kafka-console-producer.sh --broker-list localhost:9092 --topic mytopic

# 启动一个消费者(等待消息)
# 注意这里的--from-beginning,每次都会从头开始读取,你可以尝试去掉和不去掉看下效果
[root@localhost kafka_2.11-2.3.1]# bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic mytopic --from-beginning

[root@localhost kafka_2.11-2.3.1]# bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic mytopic


https://github.com/edenhill/librdkafka
yum install librdkafka-devel

https://github.com/arnaud-lb/php-rdkafka
https://github.com/arnaud-lb/php-rdkafka#installation

参考:

https://www.jianshu.com/p/6ff7f0ad2de9

https://segmentfault.com/a/1190000015765348