Closed iTigeroar closed 2 years ago
@iTigeroar @xiaoxiongmao-liu Will build an image with MQTT protocol handler and upgrade the helm chart to allow enable MoP.
@timmyyuan Could you please help with the MoP release part? Make sure we have MoP in the docker image such as KoP.
any update?
请问有解决方案么
@xiaoxiongmao-liu You can use init-container to download mop file of nar to protocols directory and juse use it.
请问有解决方案么
@xiaoxiongmao-liu You can use init-container to download mop file of nar to protocols directory and juse use it.
@liangyuanpeng I have solved it
请问有解决方案么
@xiaoxiongmao-liu You can use init-container to download mop file of nar to protocols directory and juse use it.
@liangyuanpeng I have solved it
Great, Could you share your case? I think it will help the other people.
请问有解决方案么
@xiaoxiongmao-liu You can use init-container to download mop file of nar to protocols directory and juse use it.
@liangyuanpeng I have solved it
Great, Could you share your case? I think it will help the other people.
FROM apachepulsar/pulsar-all:2.7.2
COPY *.nar ./protocols/
RUN echo 'messagingProtocols=mqtt \n\
mqttProxyEnable=true \n\
mqttProxyPort=5682' >> ./conf/broker.conf
注意:
mqttListeners=mqtt://127.0.0.1:1883
这里如果下载了源码进行打包的同学可以在 MQTTProtocolHandler类中下面位置新增被圈中的代码
如果没有下载源码,那么要在Dockerfile里写入broker.conf配置时新增,地址写pulsar在k8s中对内的服务名:{service_name}.{namespace}.svc.cluster.local
,类似于上述给定的形式。若不知道,可以先尝试用pulsar的官方helm部署一次即可得知,后面还得加上端口号1883
在/etc/mop目录下执行docker build -t apachepulsar/pulsar-all:2.7.2-mop .
生成本地镜像
../pulsar-helm-chart/charts/pulsar/values.yaml
找到images配置,如下图
,apachepulsar/pulsar-all的tag都改成2.7.2-mophelm install pulsar charts/pulsar \
--timeout 10m \
--set initialize=true \
--set volumes.persistence=false \
--set namespaceCreate=true \
--set namespace=pulsar \
--set affinity.anti_affinity=false
等待部署完成即可,部署所在k8s的namespace为pulsar。
Mac,docker desk,docker desk自带的k8s
其他可参考上述描述自行摸索,另外验证是否部署成功,可在k8s的dashboard进行观察,验证mop是否生效,可以部署一个pod用mqtt协议去连接pulsar,地址即是:{service_name}.{namespace}.svc.cluster.local:5682
。若想在k8s外部验证,需要k8s对外开放此服务的5682端口,mqtt地址改成外部访问k8s此服务的域名或者地址,具体方法请自行摸索
Here is an image that contains the MoP plugin under the ./protocols
directly. And the subsequent release will also contain the MoP plugin.
@xiaoxiongmao-liu
感谢你的分享,基本上就是自行打包镜像将nar文件放到镜像里面,但这样不能很好的跟着上游更新。
在我看来更友好的方式应该是用一个init-container去下载对应的nar文件到pulsar broker需要使用的protocols目录下. 或者是pulsar官方镜像有一个版本本身已经带有nar文件( 协议插件不是必须的,因此是另一个带有nar文件的版本 而不是pulsar原先的版本).
例如上述提供的streamnative/sn-pulsar
, 这就可以作为一个带有nar文件的镜像版本使用
I think streamnative/charts worth paying attention to.
Especially https://github.com/streamnative/charts/pull/295 (Enable MQTT-on-Pulsar on Broker ).
请问有解决方案么