You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/12/21 03:09:55 UTC

[GitHub] [rocketmq] mxsm opened a new issue, #5745: The broker cannot register with the controller When the IP address of the machine on which the Broker is deployed changes

mxsm opened a new issue, #5745:
URL: https://github.com/apache/rocketmq/issues/5745

   **BUG REPORT**
   
   1. Please describe the issue you observed:
   
   when i started rocketmq with `bin/controller/fast-try.sh start` on WSL all of them. WSL IP :172.21.34.249"
   
   then i reboot WSL then it IP changes to: 172.28.90.102
   ![image](https://user-images.githubusercontent.com/15797831/208811350-f1634f3d-262f-42c5-a3be-78a7a4b1e69c.png)
   
   and then  i started rocketmq with `bin/controller/fast-try.sh start` on WSL again
   ![image](https://user-images.githubusercontent.com/15797831/208811467-9da9c768-a55c-4ebc-8f75-6def14e7822b.png)
   The broker cannot register with the controller
   
   2. Please tell us about your environment:
   
   3. Other information (e.g. detailed explanation, logs, related issues, suggestions on how to fix, etc):
   
   **FEATURE REQUEST**
   
   1. Please describe the feature you are requesting.
   
   2. Provide any additional detail on your proposed use case for this feature.
   
   2. Indicate the importance of this issue to you (blocker, must-have, should-have, nice-to-have). Are you currently using any workarounds to address this issue?
   
   4. If there are some sub-tasks involved, use -[] for each sub-task and create a corresponding issue to map to the sub-task:
   
   - [sub-task1-issue-number](example_sub_issue1_link_here): sub-task1 description here, 
   - [sub-task2-issue-number](example_sub_issue2_link_here): sub-task2 description here,
   - ...
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] mxsm commented on issue #5745: The broker cannot register with the controller When the IP address of the machine on which the Broker is deployed changes

Posted by "mxsm (via GitHub)" <gi...@apache.org>.
mxsm commented on issue #5745:
URL: https://github.com/apache/rocketmq/issues/5745#issuecomment-1471642198

   I will close this issue, Solution References #5989


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] mxsm commented on issue #5745: The broker cannot register with the controller When the IP address of the machine on which the Broker is deployed changes

Posted by GitBox <gi...@apache.org>.
mxsm commented on issue #5745:
URL: https://github.com/apache/rocketmq/issues/5745#issuecomment-1367041974

   #### EN
   
   After the Broker starts, the bound IP address is persisted to the local for the next start to compare with the bound address to determine if the IP address has changed. At the same time, the two IP addresses are sent to the Controller to execute the subsequent master selection logic to solve the problem of unable to re-elect the Broker Master due to address change. The specific steps are as follows:
   
   1. The Broker starts and loads the IP address persisted locally from the last start (the IP address is empty for the first start).
   2. Send a RequestCode.CONTROLLER_REGISTER_BROKER request to the Controller, and add an "oldBrokerAddress" field in the RegisterBrokerToControllerRequestHeader, which is used to mark the IP address persisted locally during the last start.
   3. After the Controller receives the RequestCode.CONTROLLER_REGISTER_BROKER request, it determines the execution logic by comparing the oldBrokerAddress and brokerAddress.
   4. If the oldBrokerAddress is the same as the brokerAddress or the oldBrokerAddress is empty (first start), execute the existing logic.
   5. If the oldBrokerAddress is different from the brokerAddress, use the oldBrokerAddress to get the original SyncStateInfo information and BrokerInfo election operation.
   6. Add the UpdateBrokerAddressEvent event, replacing the data in the oldBrokerAddress related to the state machine with the new brokerAddress information.
   7. Return the result to the Broker. If the result is successful, persist the current IP address locally, if not successful, do not persist until the normal registration is completed and persist again.
   
   
   
   #### 中文
   
   Broker启动后的绑定IP地址持久化到本地提供给下一次启动时候时候绑定的地址作对比来判断是否IP地址发生变化。同时将两个IP地址发送到Controller来执行后续的选主逻辑从而解决因为地址改变不能重新选举Broker Master的问题。具体步骤如下:
   
   1. Broker启动,从本地文件中加载上一次持久化的IP地址(第一次启动IP地址为空)
   2. 发送RequestCode.CONTROLLER_REGISTER_BROKER请求到Controller,RegisterBrokerToControllerRequestHeader增加oldBrokerAddress字段,这个字段用来标记前一次启动时候持久化在本地IP地址。
   3. Controller收到RequestCode.CONTROLLER_REGISTER_BROKER的请求后通过判断oldBrokerAddress与brokerAddress是否相同来决定执行逻辑。
   4. oldBrokerAddress与brokerAddress相同或者oldBrokerAddress为空(第一次启动)执行现有逻辑。
   5. oldBrokerAddress与brokerAddress不同,用oldBrokerAddress获取原有的SyncStateInfo信息和BrokerInfo选举操作。
   6. 增加UpdateBrokerAddressEvent事件,将状态机中的oldBrokerAddress相关的数据替换成新的brokerAddress的信息
   7. 返回结果给Broker,如果结果为成功就将现在IP地址持久化到本地,不成功就不持久化知道能够正常注册完成再次进行持久化。
   
   ![image](https://user-images.githubusercontent.com/15797831/209897806-b66f3e33-dd8c-4128-ab9a-582c4a705c30.png)
   
   @RongtongJin @hzh0425 @tsunghanjacktsai @TheR1sing3un 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] mxsm closed issue #5745: The broker cannot register with the controller When the IP address of the machine on which the Broker is deployed changes

Posted by "mxsm (via GitHub)" <gi...@apache.org>.
mxsm closed issue #5745: The broker cannot register with the controller When the IP address of the machine on which the Broker is deployed changes
URL: https://github.com/apache/rocketmq/issues/5745


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] RongtongJin commented on issue #5745: The broker cannot register with the controller When the IP address of the machine on which the Broker is deployed changes

Posted by GitBox <gi...@apache.org>.
RongtongJin commented on issue #5745:
URL: https://github.com/apache/rocketmq/issues/5745#issuecomment-1360968247

   @mxsm This is a known problem, let's optimize it together.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] mxsm commented on issue #5745: The broker cannot register with the controller When the IP address of the machine on which the Broker is deployed changes

Posted by GitBox <gi...@apache.org>.
mxsm commented on issue #5745:
URL: https://github.com/apache/rocketmq/issues/5745#issuecomment-1360989366

   > @mxsm This is a known problem, let's optimize it together.
   
   OK


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org