streamnative / mop

MQTT on Pulsar implemented using Pulsar Protocol Handler
Apache License 2.0
170 stars 54 forks source link

整合到pulsar的helm安装包里 #60

Closed iTigeroar closed 2 years ago

xiaoxiongmao-liu commented 3 years ago

请问有解决方案么

codelipenghui commented 3 years ago

@iTigeroar @xiaoxiongmao-liu Will build an image with MQTT protocol handler and upgrade the helm chart to allow enable MoP.

codelipenghui commented 3 years ago

@timmyyuan Could you please help with the MoP release part? Make sure we have MoP in the docker image such as KoP.

codering commented 3 years ago

any update?

liangyuanpeng commented 3 years ago

请问有解决方案么

@xiaoxiongmao-liu You can use init-container to download mop file of nar to protocols directory and juse use it.

xiaoxiongmao-liu commented 3 years ago

请问有解决方案么

@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

liangyuanpeng commented 3 years ago

请问有解决方案么

@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 commented 3 years ago

请问有解决方案么

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

准备mop的.nar文件

mop官方链接

准备Dockerfile

FROM  apachepulsar/pulsar-all:2.7.2

COPY *.nar ./protocols/

RUN echo 'messagingProtocols=mqtt \n\
mqttProxyEnable=true \n\
mqttProxyPort=5682' >> ./conf/broker.conf

注意:

如果没有下载源码,那么要在Dockerfile里写入broker.conf配置时新增,地址写pulsar在k8s中对内的服务名:{service_name}.{namespace}.svc.cluster.local,类似于上述给定的形式。若不知道,可以先尝试用pulsar的官方helm部署一次即可得知,后面还得加上端口号1883

我的环境相关

Mac,docker desk,docker desk自带的k8s

更多说明

其他可参考上述描述自行摸索,另外验证是否部署成功,可在k8s的dashboard进行观察,验证mop是否生效,可以部署一个pod用mqtt协议去连接pulsar,地址即是:{service_name}.{namespace}.svc.cluster.local:5682。若想在k8s外部验证,需要k8s对外开放此服务的5682端口,mqtt地址改成外部访问k8s此服务的域名或者地址,具体方法请自行摸索

codelipenghui commented 3 years ago

Here is an image that contains the MoP plugin under the ./protocols directly. And the subsequent release will also contain the MoP plugin.

liangyuanpeng commented 3 years ago

@xiaoxiongmao-liu

感谢你的分享,基本上就是自行打包镜像将nar文件放到镜像里面,但这样不能很好的跟着上游更新。

在我看来更友好的方式应该是用一个init-container去下载对应的nar文件到pulsar broker需要使用的protocols目录下. 或者是pulsar官方镜像有一个版本本身已经带有nar文件( 协议插件不是必须的,因此是另一个带有nar文件的版本 而不是pulsar原先的版本).

例如上述提供的streamnative/sn-pulsar, 这就可以作为一个带有nar文件的镜像版本使用

liangyuanpeng commented 3 years ago

I think streamnative/charts worth paying attention to.

Especially https://github.com/streamnative/charts/pull/295 (Enable MQTT-on-Pulsar on Broker ).