<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Yan-Hao Chu on Medium]]></title>
        <description><![CDATA[Stories by Yan-Hao Chu on Medium]]></description>
        <link>https://medium.com/@herbertc?source=rss-9a186b205426------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*OWcvTBtQHiuKZGeKoQWvCg.gif</url>
            <title>Stories by Yan-Hao Chu on Medium</title>
            <link>https://medium.com/@herbertc?source=rss-9a186b205426------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 16:45:46 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@herbertc/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Enable Home&End Key on Zsh Terminal]]></title>
            <link>https://herbertc.medium.com/enable-home-end-key-on-zsh-terminal-6984cd220eb0?source=rss-9a186b205426------2</link>
            <guid isPermaLink="false">https://medium.com/p/6984cd220eb0</guid>
            <category><![CDATA[oh-my-zsh]]></category>
            <category><![CDATA[zsh]]></category>
            <dc:creator><![CDATA[Yan-Hao Chu]]></dc:creator>
            <pubDate>Tue, 23 Feb 2021 06:41:15 GMT</pubDate>
            <atom:updated>2021-02-23T06:41:15.419Z</atom:updated>
            <content:encoded><![CDATA[<p>在使用oh my zsh ! 之後發現在 Terminal 中， Home鍵與End鍵失去用了。</p><p>環境：</p><blockquote><em>macOS Catalina 10.15.7</em></blockquote><blockquote><em>iTerm2 3.3.12</em></blockquote><p>解法：</p><pre>vim ~/.zshrc</pre><p>加入兩行</p><pre>bindkey &quot;^[[H&quot; beginning-of-line<br>bindkey &quot;^[[F&quot; end-of-line</pre><p>然後重新打開Terminal或者</p><pre>source ~/.zshrc</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6984cd220eb0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploy Kafka Cluster in Dev. Environment with docker-compose]]></title>
            <link>https://herbertc.medium.com/deploy-kafka-cluster-in-dev-environment-with-docker-compose-2506c8034c0c?source=rss-9a186b205426------2</link>
            <guid isPermaLink="false">https://medium.com/p/2506c8034c0c</guid>
            <category><![CDATA[kafka]]></category>
            <category><![CDATA[kafka-streams]]></category>
            <dc:creator><![CDATA[Yan-Hao Chu]]></dc:creator>
            <pubDate>Thu, 18 Feb 2021 14:59:28 GMT</pubDate>
            <atom:updated>2021-02-18T15:09:09.585Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*47_3QTvnfRt3f_kf.png" /><figcaption>reference : <a href="https://docs.confluent.io/platform/current/kafka/multi-node.html">https://docs.confluent.io/platform/current/kafka/multi-node.html</a></figcaption></figure><p>if you are trying to deploy a multi-node kafka cluster in dev. environment with docker-compose, should be aware of the key configuration KAFKA_ADVERTISED_LISTENERS as shown in the picture, kafka can be configure to multi-listener if running in different subnet, since the kafka node will in the same subnet, KAFKA_INTER_BROKER_LISTENER_NAME can be configure to internal use listener and the producer and consumer can be use the external listener.</p><p>After the producer/consumer connect to broker, kafka will send the metadata to producer/consumer to tell them where to send message, and the hostname configure in KAFKA_ADVERTISED_LISTENERS will send to them, hence the hostname should be resolvable by producer/consumer.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c069968edf3f65f63a9bb53e86b7a4a5/href">https://medium.com/media/c069968edf3f65f63a9bb53e86b7a4a5/href</a></iframe><p>KAFKA_ADVERTISED_LISTENERS : will be send to client in metadata, should a hostname that client are able to resolved, if the client running on the host not the same with the docker. can be a ip or hostname</p><p>KAFKA_NUM_PARTITIONS: default partition number</p><p>KAFKA_DEFAULT_REPLICATION_FACTOR: default replica number</p><p>KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: default internal _offset topic number</p><h3>Query Metadata via kafkacat</h3><pre>❯ kafkacat  -L -b kafka-broker</pre><pre>Metadata for all topics (from broker -1: 10.206.1.144:9092/bootstrap):<br> 3 brokers:<br>  broker 2 at localhost:9093<br>  broker 1 at localhost:9092<br>  broker 3 at localhost:9094 (controller)<br></pre><h4>if set hostname &quot;kafka-broker&quot; to KAFKA_ADVERTISED_LISTENERS and query metadata via kafkacat will shown as below</h4><pre>❯ kafkacat -L -b kafka-broker                                                                   <br>Metadata for all topics (from broker 1: kafka-broker:9092/1):<br> 3 brokers:<br>  broker 2 at kafka-broker:9093<br>  broker 1 at kafka-broker:9092 (controller)<br>  broker 3 at kafka-broker:9094<br></pre><h3>Topic</h3><h3>Create Topic</h3><pre>kafka-topics --bootstrap-server kafka1:9092 --create --topic hc.test.01 --partitions 3 -replication-factor 3</pre><h3>Create Topic with specific configuration</h3><pre>kafka-topics --create --zookeeper zookeeper:2181 --topic hc.test.04.ready.go --replication-factor 2 --partitions 3 --config &quot;cleanup.policy=compact&quot; --config &quot;delete.retention.ms=100&quot;  --config &quot;segment.bytes=204800&quot; --config &quot;min.cleanable.dirty.ratio=0.01&quot;</pre><h3>Delete Topic</h3><pre>kafka-topic --bootstrap-server kafka1:29092 --delete --topic test123</pre><h3>Show Topic</h3><pre>kafka-topics--bootstrap-server kafka1:29092 -- list</pre><h3>Alter Topic</h3><pre>kafka-topics --zookeeper zookeeper:2181 --alter --topic hc.topic.01 --partitions 3</pre><h3>Topic Consumer</h3><pre>kafka-console-consumer --bootstrap-server kafka1:9092 --from-beginning --topic hc-topic --group g1</pre><h3>Consumer Groups Offest Status (All)</h3><pre>kafka-consumer-groups --bootstrap-server kafka1:29092 --all-topics --all-groups --describe</pre><h3>Consumer Groups Offset Status (1)</h3><pre>kafka-consumer-groups --bootstrap-server kafka1:29092 --group group1 --describe</pre><h3>Dump message from log file</h3><pre>kafka-run-class kafka.tools.DumpLogSegments --deep-iteration --print-data-log --files hc.test.03.ready.go-0/00000000000000000000.log</pre><h3>Kafdrop</h3><p><a href="https://github.com/obsidiandynamics/kafdrop">https://github.com/obsidiandynamics/kafdrop</a></p><p>Kafdrop is a web UI for viewing Kafka topics and browsing consumer groups. The tool displays information such as brokers, topics, partitions, consumers, and lets you view messages.</p><h3>Kafkacat</h3><p><a href="https://github.com/edenhill/kafkacat">https://github.com/edenhill/kafkacat</a></p><p>kafkacat is a generic non-JVM producer and consumer for Apache Kafka &gt;=0.8, think of it as a netcat for Kafka.</p><h3>Producer</h3><pre>kafkacat -P -b kafka-broker -t hc.test.01 -K :</pre><h3>Consumer</h3><pre>kafkacat -b kafka-broker -G group1 &quot;hc.test.01&quot;</pre><h3>Metadata Query</h3><pre>kafkacat -L -b kafka-broker</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2506c8034c0c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>