sunjiebin opened a new issue #2384:
URL: https://github.com/apache/rocketmq/issues/2384


   **BUG REPORT**
   
   1. Please describe the issue you observed:
   When i deploy  Dledger cluster deployment , i set the dLegerPeers like this
   **dLegerPeers=n0-nt-node1:40911;n1-nt-node1:40912;n2-nt-node1:40913**
     the _nt-node1_ is my local hostname, I can ping successfully. **but the 
cluster start failed.**
   ### broker-n:*
   [root@nt-node1 dledger]# cat broker-n0.conf 
   ```
   brokerClusterName = RaftCluster
   brokerName=RaftNode00
   listenPort=30911
   namesrvAddr=127.0.0.1:9876
   storePathRootDir=/tmp/rmqstore/node00
   storePathCommitLog=/tmp/rmqstore/node00/commitlog
   enableDLegerCommitLog=true
   dLegerGroup=RaftNode00
   dLegerPeers=n0-nt-node1:40911;n1-nt-node1:40912;n2-nt-node1:40913
   ## must be unique
   dLegerSelfId=n0
   sendMessageThreadPoolNums=16
   ```
   [root@nt-node1 rocketmq]# cat /etc/hosts
   ```
   127.0.0.1   localhost localhost.localdomain localhost4 
localhost4.localdomain4
   ::1         localhost localhost.localdomain localhost6 
localhost6.localdomain6
   192.168.20.75    nt-node1 nt_node1
   ```
   [root@nt-node1 rocketmq]# ifconfig |grep 192.168.20.75
   `        inet 192.168.20.75  netmask 255.255.255.0  broadcast 192.168.20.255`
   
   ### error logs:
   ```
   java.lang.ArrayIndexOutOfBoundsException: 1
           at 
io.openmessaging.storage.dledger.DLedgerRpcNettyService.<init>(DLedgerRpcNettyService.java:93)
           at 
io.openmessaging.storage.dledger.DLedgerServer.<init>(DLedgerServer.java:64)
           at 
org.apache.rocketmq.store.dledger.DLedgerCommitLog.<init>(DLedgerCommitLog.java:88)
           at 
org.apache.rocketmq.store.DefaultMessageStore.<init>(DefaultMessageStore.java:129)
           at 
org.apache.rocketmq.broker.BrokerController.initialize(BrokerController.java:243)
           at 
org.apache.rocketmq.broker.BrokerStartup.createBrokerController(BrokerStartup.java:222)
           at 
org.apache.rocketmq.broker.BrokerStartup.main(BrokerStartup.java:58)
   ```
   so I tried to changing the hostname from _nt-node1_ to _nt_node1_, or some 
other host name that does not contain "-"
   for example:
   **dLegerPeers=n0-nt_node1:40911;n1-nt_node1:40912;n2-nt_node1:40913**
   **dLegerPeers=n0-localhost:40911;n1-localhost:40912;n2-localhost:40913**
   **_the cluster start ok~!_**
   
   In the end, I found that if I didn't have a "-" in the hostname, It would 
boot up successfully
   
   2. Please tell us about your environment:
   Rocketmq version is 4.7.1 
   
   **FEATURE REQUEST**
   
   1. Please describe the feature you are requesting.
   I expect the host name including "-" to be supported by the dLegerPeers 
parameter
   
   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?
   Because I want deploy the  Dledger cluster with k8s statefulset , The pod 
name generated by k8s must have - ,and the IP address is dynamic and I can't 
fix it , So I must use hostname with "-"
   I can fix IP by using hostNetwork of K8S, and then fill in the IP in 
dLegerPeers parameter to avoid this bug. However, in this way, Pod is bound to 
the host, thus losing flexibility.
   
   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to