Skip to content

Commit

Permalink
Site updated: 2024-06-22 19:47:23
Browse files Browse the repository at this point in the history
  • Loading branch information
jxhsjxhs committed Jun 22, 2024
1 parent 634d0d3 commit bd1dce4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion 2024/06/22/kafka-topic指定节点重平衡/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ <h3 id="背景:"><a href="#背景:" class="headerlink" title="背景:"></a
</blockquote>
<p>在实际生产环境中,第一种方式是对其他topic影响最小,并且最符合稳定性要求的方案。图示如下</p>
<p><img src="/img/newimg/2024-06-22-02.png" srcset="/img/loading.gif" alt=""></p>
<h3 id="迁移操作步骤如下:"><a href="#迁移操作步骤如下:" class="headerlink" title="迁移操作步骤如下:"></a>迁移操作步骤如下:</h3><h4 id="1、首先查看kafka集群的broker信息确保迁移的broker已经加入集群"><a href="#1、首先查看kafka集群的broker信息确保迁移的broker已经加入集群" class="headerlink" title="1、首先查看kafka集群的broker信息确保迁移的broker已经加入集群"></a>1、首先查看kafka集群的broker信息确保迁移的broker已经加入集群</h4><figure class="highlight angelscript"><table><tr><td class="gutter hljs"><div class="hljs code-wrapper"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></div></td><td class="code"><div class="hljs code-wrapper"><pre><code class="hljs angelscript">本实验环境有三个broker,分别是<span class="hljs-number">0</span><span class="hljs-number">1</span><span class="hljs-number">2</span><span class="hljs-number">3</span><span class="hljs-number">4</span><span class="hljs-number">5</span><span class="hljs-number">6</span>,其中<span class="hljs-number">1</span><span class="hljs-number">2</span><span class="hljs-number">3</span>三个节点有zooKeeper。<br>/data/zookeeper/bin/zkCli.sh<br>[zk: localhost:<span class="hljs-number">2181</span>(CONNECTED) <span class="hljs-number">0</span>] ls /brokers/ids<br>[<span class="hljs-number">0</span>, <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>, <span class="hljs-number">6</span>]<br></code></pre></div></td></tr></table></figure>
<h3 id="迁移操作步骤如下:"><a href="#迁移操作步骤如下:" class="headerlink" title="迁移操作步骤如下:"></a>迁移操作步骤如下:</h3><h4 id="1、首先查看kafka集群的broker信息确保迁移的broker已经加入集群"><a href="#1、首先查看kafka集群的broker信息确保迁移的broker已经加入集群" class="headerlink" title="1、首先查看kafka集群的broker信息确保迁移的broker已经加入集群"></a>1、首先查看kafka集群的broker信息确保迁移的broker已经加入集群</h4><figure class="highlight angelscript"><table><tr><td class="gutter hljs"><div class="hljs code-wrapper"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></div></td><td class="code"><div class="hljs code-wrapper"><pre><code class="hljs angelscript">本实验环境有七个broker,分别是<span class="hljs-number">0</span><span class="hljs-number">1</span><span class="hljs-number">2</span><span class="hljs-number">3</span><span class="hljs-number">4</span><span class="hljs-number">5</span><span class="hljs-number">6</span>,其中<span class="hljs-number">1</span><span class="hljs-number">2</span><span class="hljs-number">3</span>三个节点有zooKeeper。<br>/data/zookeeper/bin/zkCli.sh<br>[zk: localhost:<span class="hljs-number">2181</span>(CONNECTED) <span class="hljs-number">0</span>] ls /brokers/ids<br>[<span class="hljs-number">0</span>, <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>, <span class="hljs-number">6</span>]<br></code></pre></div></td></tr></table></figure>
<p><img src="/img/newimg/2024-06-22-03.png" srcset="/img/loading.gif" alt=""></p>
<h4 id="2、查看topic分区的ISR,确保topic的Leader、Replicas、ISR参数正常,确保ISR同步队列正常。"><a href="#2、查看topic分区的ISR,确保topic的Leader、Replicas、ISR参数正常,确保ISR同步队列正常。" class="headerlink" title="2、查看topic分区的ISR,确保topic的Leader、Replicas、ISR参数正常,确保ISR同步队列正常。"></a>2、查看topic分区的ISR,确保topic的Leader、Replicas、ISR参数正常,确保ISR同步队列正常。</h4><figure class="highlight yaml"><table><tr><td class="gutter hljs"><div class="hljs code-wrapper"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></div></td><td class="code"><div class="hljs code-wrapper"><pre><code class="hljs yaml"><span class="hljs-string">root@kafka-2:~#</span> <span class="hljs-string">/data/kafka/bin/kafka-topics.sh</span> <span class="hljs-string">--describe</span> <span class="hljs-string">--topic</span> <span class="hljs-string">my-topic</span> <span class="hljs-string">--bootstrap-server</span> <span class="hljs-number">192.168</span><span class="hljs-number">.1</span><span class="hljs-number">.231</span><span class="hljs-string">:9092</span><br><span class="hljs-attr">Topic:</span> <span class="hljs-string">my-topic</span> <span class="hljs-attr">TopicId:</span> <span class="hljs-string">1FtXs5m8TMyjC18Qjs3ttg</span> <span class="hljs-attr">PartitionCount:</span> <span class="hljs-number">3</span> <span class="hljs-attr">ReplicationFactor:</span> <span class="hljs-number">3</span> <span class="hljs-attr">Configs:</span> <span class="hljs-string">segment.bytes=1073741824</span><br> <span class="hljs-attr">Topic:</span> <span class="hljs-string">my-topic</span> <span class="hljs-attr">Partition:</span> <span class="hljs-number">0</span> <span class="hljs-attr">Leader:</span> <span class="hljs-number">0</span> <span class="hljs-attr">Replicas:</span> <span class="hljs-number">0</span><span class="hljs-string">,1,2</span> <span class="hljs-attr">Isr:</span> <span class="hljs-number">0</span><span class="hljs-string">,1,2</span><br> <span class="hljs-attr">Topic:</span> <span class="hljs-string">my-topic</span> <span class="hljs-attr">Partition:</span> <span class="hljs-number">1</span> <span class="hljs-attr">Leader:</span> <span class="hljs-number">1</span> <span class="hljs-attr">Replicas:</span> <span class="hljs-number">1</span><span class="hljs-string">,2,0</span> <span class="hljs-attr">Isr:</span> <span class="hljs-number">0</span><span class="hljs-string">,1,2</span><br> <span class="hljs-attr">Topic:</span> <span class="hljs-string">my-topic</span> <span class="hljs-attr">Partition:</span> <span class="hljs-number">2</span> <span class="hljs-attr">Leader:</span> <span class="hljs-number">1</span> <span class="hljs-attr">Replicas:</span> <span class="hljs-number">2</span><span class="hljs-string">,1,0</span> <span class="hljs-attr">Isr:</span> <span class="hljs-number">1</span><span class="hljs-string">,2,0</span><br></code></pre></div></td></tr></table></figure>
<p><img src="/img/newimg/2024-06-22-04.png" srcset="/img/loading.gif" alt=""></p>
Expand Down
Loading

0 comments on commit bd1dce4

Please sign in to comment.