You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "xuziyang (via GitHub)" <gi...@apache.org> on 2024/03/26 00:36:53 UTC
[I] broker设置podIp环境变量没有生效 [rocketmq-operator]
xuziyang opened a new issue, #218:
URL: https://github.com/apache/rocketmq-operator/issues/218
rockermq 版本 4.9.4
k8s 版本 v1.23.17
代码里有设置hostIp的环境变量,如下图

但是broker的xml却没有这个环境变量,如下如

--
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
Re: [I] broker设置podIp环境变量没有生效 [rocketmq-operator]
Posted by "RockteMQ-AI (via GitHub)" <gi...@apache.org>.
RockteMQ-AI commented on issue #218:
URL: https://github.com/apache/rocketmq-operator/issues/218#issuecomment-5192840090
**Issue Evaluation**
Category: `question`
The `podIp` environment variable is set in the operator code but may not be referenced in the broker's XML configuration. The broker XML needs to explicitly use `${podIp}` (or the actual env var name) for it to take effect.
Please verify:
1. The exact env var name in the StatefulSet spec (check with `kubectl describe pod <broker-pod>`)
2. The broker configuration file references that env var correctly
---
*Automated evaluation by RockteMQ-AI*
--
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
Re: [I] broker设置podIp环境变量没有生效 [rocketmq-operator]
Posted by "fitme96 (via GitHub)" <gi...@apache.org>.
fitme96 commented on issue #218:
URL: https://github.com/apache/rocketmq-operator/issues/218#issuecomment-3227545527
我最近构建5.2.0版本镜像后部署时也遇到POD_IP为空导致注册到nameserver brokerAddr为":10911" 返回的broker地址为空无法正常使用。
但是我发现operator 0.3.0 版本brokerGenConfig.sh没有追加brokerIP1, 新版本增加了, 所以我把brokerGenConfig.sh脚本中追加brokerIP1注释了,rocketMQ目前看起来是正常的
<img width="2031" height="553" alt="Image" src="https://github.com/user-attachments/assets/41a3d4cb-6d52-4d5a-9730-244499bffe35" />
没注释前broker日志
<img width="1749" height="488" alt="Image" src="https://github.com/user-attachments/assets/182e083e-00a5-4757-8e52-24e477d09dfb" />
注释后
<img width="2072" height="266" alt="Image" src="https://github.com/user-attachments/assets/0dfcb911-9b9e-4edd-acc1-ac44e6ffaf49" />
--
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
Re: [I] broker设置podIp环境变量没有生效 [rocketmq-operator]
Posted by "suyanhj (via GitHub)" <gi...@apache.org>.
suyanhj commented on issue #218:
URL: https://github.com/apache/rocketmq-operator/issues/218#issuecomment-3227587996
> 我最近构建5.2.0版本镜像后部署时也遇到POD_IP为空导致注册到nameserver brokerAddr为":10911" 返回的broker地址为空无法正常使用。 但是我发现operator 0.3.0 版本brokerGenConfig.sh没有追加brokerIP1, 新版本增加了, 所以我把brokerGenConfig.sh脚本中追加brokerIP1注释了,rocketMQ目前看起来是正常的
放 k8s 里面运行,记得固定在一个节点运行,且 pod ip 不能变,不然重启后 ip 变了,nameserver 不识别,必须继续增加 broker 才行.
之前因为这鬼东西生产出大坑,mq 集群做k8s节点维护,驱逐到新节点启动后,namesrv 里面是空的
--
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
Re: [I] broker设置podIp环境变量没有生效 [rocketmq-operator]
Posted by "fitme96 (via GitHub)" <gi...@apache.org>.
fitme96 commented on issue #218:
URL: https://github.com/apache/rocketmq-operator/issues/218#issuecomment-3227629348
> > 我最近构建5.2.0版本镜像后部署时也遇到POD_IP为空导致注册到nameserver brokerAddr为":10911" 返回的broker地址为空无法正常使用。 但是我发现operator 0.3.0 版本brokerGenConfig.sh没有追加brokerIP1, 新版本增加了, 所以我把brokerGenConfig.sh脚本中追加brokerIP1注释了,rocketMQ目前看起来是正常的
>
> 放 k8s 里面运行,记得固定在一个节点运行,且 pod ip 不能变,不然重启后 ip 变了,nameserver 不识别,必须继续增加 broker 才行. 之前因为这鬼东西生产出大坑,mq 集群做k8s节点维护,驱逐到新节点启动后,namesrv 里面是空的
broker有master和slave了吗? namesrv也驱逐了吗?我看broker会主动注册不应该为空吧,你nameserver地址用的svc_name还是?
你现在还在k8s里面跑着没?
--
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
Re: [I] broker设置podIp环境变量没有生效 [rocketmq-operator]
Posted by "RockteMQ-AI (via GitHub)" <gi...@apache.org>.
RockteMQ-AI commented on issue #218:
URL: https://github.com/apache/rocketmq-operator/issues/218#issuecomment-5207330358
**Issue Evaluation**
Category: | Status: **Needs Info**
I verified the codebase. The operator **does** set the environment variable in the broker container (via fieldRef in ), and the default broker image entrypoint script writes into .
So the mechanism exists, but it generates a **properties-format** config (), not XML.
To help diagnose why is not taking effect in your environment, could you clarify:
1. **Which broker image are you using?** The default alpine image runs which writes to . If you are using a custom image, this script may not be executed.
2. **Is your broker reading from XML or properties?** You mentioned RocketMQ 4.9.4 — if the broker is configured to load an XML config file (e.g., ), the in would not be picked up.
3. **Can you into the broker pod and check the generated config?**
This will show whether is present in the generated config.
If the generated does contain but the broker still binds to the wrong address, the issue may be in how the broker startup command references the config file.
---
*Automated evaluation by github-manager*
--
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
Re: [I] broker设置podIp环境变量没有生效 [rocketmq-operator]
Posted by "RockteMQ-AI (via GitHub)" <gi...@apache.org>.
RockteMQ-AI commented on issue #218:
URL: https://github.com/apache/rocketmq-operator/issues/218#issuecomment-5487025929
**Issue Evaluation**
Category: `bug` | Status: **Needs Info**
The broker podIp environment variable not taking effect suggests the operator is not properly passing environment variables to the broker container spec.
Please provide:
- [ ] The broker CR YAML you applied
- [ ] The resulting pod spec (`kubectl get pod <broker-pod> -o yaml`)
- [ ] Whether the env var appears in the container but is ignored, or is missing entirely
---
*Automated evaluation by RockteMQ-AI*
--
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
Re: [I] broker设置podIp环境变量没有生效 [rocketmq-operator]
Posted by "suyanhj (via GitHub)" <gi...@apache.org>.
suyanhj commented on issue #218:
URL: https://github.com/apache/rocketmq-operator/issues/218#issuecomment-2171409010
> rockermq 版本 4.9.4 k8s 版本 v1.23.17
>
> 代码里有设置hostIp的环境变量,如下图 
>
> 但是broker的xml却没有这个环境变量,如下如 
老哥,我也遇到你这种问题了,不过我是看了你提供的代码截图,然后想到代码是从环境变量:POD_IP获取ip,就可以手动指定环境变量即可,从status.podip原样获取,我修改后,可以正常获取ip了


--
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
Re: [I] broker设置podIp环境变量没有生效 [rocketmq-operator]
Posted by "RockteMQ-AI (via GitHub)" <gi...@apache.org>.
RockteMQ-AI commented on issue #218:
URL: https://github.com/apache/rocketmq-operator/issues/218#issuecomment-5655102069
**Issue Evaluation**
Category: `type/bug` | Status: **Needs Info**
The `podIp` environment variable set via the operator's broker CR is not being reflected in the broker's runtime configuration. This could be caused by the broker startup script not reading the environment variable, or by the operator not properly injecting it into the pod spec.
Please provide the broker pod's environment variables (`kubectl exec env | grep -i ip`) and the broker's `broker.conf` to diagnose.
---
*Automated evaluation by github-manager*
--
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
Re: [I] broker设置podIp环境变量没有生效 [rocketmq-operator]
Posted by "suyanhj (via GitHub)" <gi...@apache.org>.
suyanhj commented on issue #218:
URL: https://github.com/apache/rocketmq-operator/issues/218#issuecomment-3243637168
@fitme96 换mq 了,之前用 operator放 k8s 跑生产的,就是我说的重启的坑,后面用虚拟机单独跑,运行一段时间后又发现个别等级延迟消息不发送的 bug,现在直接买谷歌云的 mq
namesrv 的内部会维护 master 和slave 的 ip 的,把他们的 ip 记录,你放 k8s 里面重启,使用 podip 时,一旦重启就容器 ip 就变了,跟 ns 中记录的不一致了,直接不识别,你只能继续新开一个集群,然后继续保证新开出来的 ip 不要变
operator 本身部署的时候,使用的就是 host 网络模式,应该就是从这个原因去考虑的,但很多云平台的托管k8s集群不给接触 节点 host,如果你是自建的集群可以考虑可行性,只有 1 点注意,这 broker 的 ip 不变
--
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
Re: [I] broker设置podIp环境变量没有生效 [rocketmq-operator]
Posted by "suyanhj (via GitHub)" <gi...@apache.org>.
suyanhj commented on issue #218:
URL: https://github.com/apache/rocketmq-operator/issues/218#issuecomment-2171409846
感觉这operator的bug挺多的,最后一个版本也是2022年的,不知道是不是放弃维护了
--
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