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

推荐订阅源

cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
G
GRAHAM CLULEY
Cyberwarzone
Cyberwarzone
Cisco Talos Blog
Cisco Talos Blog
I
Intezer
V
Vulnerabilities – Threatpost
C
CERT Recently Published Vulnerability Notes
AWS News Blog
AWS News Blog
L
LINUX DO - 热门话题
AI
AI
Webroot Blog
Webroot Blog
W
WeLiveSecurity
O
OpenAI News
T
Threatpost
L
Lohrmann on Cybersecurity
S
Secure Thoughts
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
T
The Exploit Database - CXSecurity.com
C
Cyber Attacks, Cyber Crime and Cyber Security
C
CXSECURITY Database RSS Feed - CXSecurity.com
Security Archives - TechRepublic
Security Archives - TechRepublic
S
Security Affairs
V2EX - 技术
V2EX - 技术
Cloudbric
Cloudbric
Google DeepMind News
Google DeepMind News
Stack Overflow Blog
Stack Overflow Blog
N
Netflix TechBlog - Medium
P
Proofpoint News Feed
F
Fortinet All Blogs
G
Google Developers Blog
K
Kaspersky official blog
Microsoft Security Blog
Microsoft Security Blog
Recorded Future
Recorded Future
云风的 BLOG
云风的 BLOG
T
Troy Hunt's Blog
N
News | PayPal Newsroom
Google DeepMind News
Google DeepMind News
Martin Fowler
Martin Fowler
Recent Announcements
Recent Announcements
P
Proofpoint News Feed
T
The Blog of Author Tim Ferriss
L
LangChain Blog
A
About on SuperTechFans
D
Docker
WordPress大学
WordPress大学
V
V2EX
Simon Willison's Weblog
Simon Willison's Weblog
M
MIT News - Artificial intelligence
T
Threat Research - Cisco Blogs
Attack and Defense Labs
Attack and Defense Labs

博客园 - 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