博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
kafka 重启的一些记录
阅读量:3576 次
发布时间:2019-05-20

本文共 4217 字,大约阅读时间需要 14 分钟。

重启前集群的一些状态记录:

 

[els@els1 wchane-1]$ kafka-topics.sh --zookeeper 10.156.10.126:2181 --describe --topic wchane

Topic:wchane PartitionCount:3 ReplicationFactor:2 Configs:

Topic: wchane Partition: 0 Leader: 2 Replicas: 2,0 Isr: 2,0

Topic: wchane Partition: 1 Leader: 0 Replicas: 0,1 Isr: 0,1

Topic: wchane Partition: 2 Leader: 1 Replicas: 1,2 Isr: 1,2

 

 

查看 brokerid 为 0 下文件的更新时间:

 

[els@els1 wchane-1]$ ls -al

总用量 20496

drwxrwxr-x 2 els els 4096 5月 28 10:28 .

drwxrwxr-x 5 els els 4096 5月 28 10:37 ..

-rw-rw-r-- 1 els els 10485760 5月 28 10:28 00000000000000000000.index

-rw-rw-r-- 1 els els 95 5月 28 10:28 00000000000000000000.log

-rw-rw-r-- 1 els els 10485756 5月 28 10:28 00000000000000000000.timeindex

-rw-rw-r-- 1 els els 8 5月 28 10:28 leader-epoch-checkpoint

 

接下来把brokerid 为0 的节点杀了

kill ****

接下来我们看看集群的一些状态:

Topic:wchane PartitionCount:3 ReplicationFactor:2 Configs:

Topic: wchane Partition: 0 Leader: 2 Replicas: 2,0 Isr: 2

Topic: wchane Partition: 1 Leader: 1 Replicas: 0,1 Isr: 1

Topic: wchane Partition: 2 Leader: 1 Replicas: 1,2 Isr: 1,2

 

接下来我们重启一下。

nohup kafka-server-start.sh ../config/server.properties &

 

接下来我们再看看集群的一些状态:

[els@els1 wchane-1]$ kafka-topics.sh --zookeeper 10.156.10.126:2181 --describe --topic wchane

Topic:wchane PartitionCount:3 ReplicationFactor:2 Configs:

Topic: wchane Partition: 0 Leader: 2 Replicas: 2,0 Isr: 2,0

Topic: wchane Partition: 1 Leader: 0 Replicas: 0,1 Isr: 1,0

Topic: wchane Partition: 2 Leader: 1 Replicas: 1,2 Isr: 1,2

 

发现brokerid=0的重新加入了集群并且恢复为leader。

 

再来看看日志文件的一些变化

[els@els1 wchane-1]$ ls -al

总用量 20500

drwxrwxr-x 2 els els 4096 5月 28 10:39 .

drwxrwxr-x 5 els els 4096 5月 28 10:48 ..

-rw-rw-r-- 1 els els 10485760 5月 28 10:42 00000000000000000000.index

-rw-rw-r-- 1 els els 95 5月 28 10:28 00000000000000000000.log

-rw-rw-r-- 1 els els 10485756 5月 28 10:42 00000000000000000000.timeindex

-rw-rw-r-- 1 els els 10 5月 28 10:39 00000000000000000002.snapshot

-rw-rw-r-- 1 els els 8 5月 28 10:28 leader-epoch-checkpoint

 

接下来。试试强杀

kill -9 **

[els@els1 wchane-1]$ kafka-topics.sh --zookeeper 10.156.10.126:2181 --describe --topic wchane

Topic:wchane PartitionCount:3 ReplicationFactor:2 Configs:

Topic: wchane Partition: 0 Leader: 2 Replicas: 2,0 Isr: 2

Topic: wchane Partition: 1 Leader: 1 Replicas: 0,1 Isr: 1

Topic: wchane Partition: 2 Leader: 1 Replicas: 1,2 Isr: 1,2

 

 

重启之后:

[els@els1 wchane-1]$ kafka-topics.sh --zookeeper 10.156.10.126:2181 --describe --topic wchane

Topic:wchane PartitionCount:3 ReplicationFactor:2 Configs:

Topic: wchane Partition: 0 Leader: 2 Replicas: 2,0 Isr: 2,0

Topic: wchane Partition: 1 Leader: 1 Replicas: 0,1 Isr: 1,0

Topic: wchane Partition: 2 Leader: 1 Replicas: 1,2 Isr: 1,2

 

 

总用量 20500

drwxrwxr-x 2 els els 4096 5月 28 10:51 .

drwxrwxr-x 5 els els 4096 5月 28 10:52 ..

-rw-rw-r-- 1 els els 10485760 5月 28 10:51 00000000000000000000.index

-rw-rw-r-- 1 els els 95 5月 28 10:28 00000000000000000000.log

-rw-rw-r-- 1 els els 10485756 5月 28 10:51 00000000000000000000.timeindex

-rw-rw-r-- 1 els els 10 5月 28 10:51 00000000000000000002.snapshot

-rw-rw-r-- 1 els els 8 5月 28 10:28 leader-epoch-checkpoint

 

接下来。停了broker 0 并进行数据写入。

 

[els@els1 wchane-1]$ kafka-topics.sh --zookeeper 10.156.10.126:2181 --describe --topic wchane

Topic:wchane PartitionCount:3 ReplicationFactor:2 Configs:

Topic: wchane Partition: 0 Leader: 2 Replicas: 2,0 Isr: 2

Topic: wchane Partition: 1 Leader: 1 Replicas: 0,1 Isr: 1

Topic: wchane Partition: 2 Leader: 2 Replicas: 1,2 Isr: 2,1

 

写入数据之后再试试重启

[els@els1 wchane-1]$ kafka-topics.sh --zookeeper 10.156.10.126:2181 --describe --topic wchane

Topic:wchane PartitionCount:3 ReplicationFactor:2 Configs:

Topic: wchane Partition: 0 Leader: 2 Replicas: 2,0 Isr: 2,0

Topic: wchane Partition: 1 Leader: 1 Replicas: 0,1 Isr: 1,0

Topic: wchane Partition: 2 Leader: 1 Replicas: 1,2 Isr: 2,1

 

 

[els@els1 wchane-1]$ ls -al

总用量 20500

drwxrwxr-x 2 els els 4096 5月 28 11:02 .

drwxrwxr-x 5 els els 4096 5月 28 11:03 ..

-rw-rw-r-- 1 els els 10485760 5月 28 11:02 00000000000000000000.index

-rw-rw-r-- 1 els els 190 5月 28 11:02 00000000000000000000.log

-rw-rw-r-- 1 els els 10485756 5月 28 11:02 00000000000000000000.timeindex

-rw-rw-r-- 1 els els 10 5月 28 10:51 00000000000000000002.snapshot

-rw-rw-r-- 1 els els 12 5月 28 11:02 leader-epoch-checkpoint

发现日志文件也进行的更新。

 

转载地址:http://shagj.baihongyu.com/

你可能感兴趣的文章
最短路径最基本的三种算法【此后无良辰】
查看>>
class的点点滴滴的总结
查看>>
vector 的点点滴滴的总结
查看>>
测试用例
查看>>
自动化测试学习步骤
查看>>
自动化测试需要掌握的知识
查看>>
HTTP协议
查看>>
Python小程序——冒泡排序
查看>>
cmd中输入net start mysql 提示:服务名无效或者MySQL正在启动 MySQL无法启动
查看>>
LeetCode 206反转链表 [javsScript]
查看>>
[LeetCode javaScript] 3. 无重复字符的最长子串
查看>>
[LeetCode javaScript] 6. Z字形变换
查看>>
[LeetCode javaScript]455. 分发饼干
查看>>
[LeetCode javaScript] 735. 行星碰撞
查看>>
[LeetCode javaScript] 125. 验证回文串
查看>>
[LeetCode javaScript] 226. 翻转二叉树
查看>>
[LeetCode javaScript] 520. 检测大写字母
查看>>
[LeetCode javaScript] 53.最大子序和
查看>>
[LeetCode javaScript] 101. 对称二叉树
查看>>
[LeetCode javaScript] 860. 柠檬水找零
查看>>