GithubHelp home page GithubHelp logo

Comments (11)

xiaoxiongmao-liu avatar xiaoxiongmao-liu commented on May 26, 2024

请问有解决方案么

from mop.

codelipenghui avatar codelipenghui commented on May 26, 2024

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

from mop.

codelipenghui avatar codelipenghui commented on May 26, 2024

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

from mop.

codering avatar codering commented on May 26, 2024

any update?

from mop.

liangyuanpeng avatar liangyuanpeng commented on May 26, 2024

请问有解决方案么

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

from mop.

xiaoxiongmao-liu avatar xiaoxiongmao-liu commented on May 26, 2024

请问有解决方案么

@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

from mop.

liangyuanpeng avatar liangyuanpeng commented on May 26, 2024

请问有解决方案么

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

xiaoxiongmao-liu avatar xiaoxiongmao-liu commented on May 26, 2024

请问有解决方案么

@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官方链接

  • 第一种方式:直接下载官方已打好的nar包
  • 第二种方式:从官方拷贝源码,自己在本地打包,打包过程在官方文档中说明的比较清楚

准备Dockerfile

FROM  apachepulsar/pulsar-all:2.7.2

COPY *.nar ./protocols/

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

注意:

  • 基础镜像我在这里选择的是pulsar官方提供的2.7.2版本,后续helm版本要保持一致,若不能保证完全一致,至少要保证helm的版本是2.7.*
  • 写入 broker.conf配置文件中的配置我这里少写了一个
    mqttListeners=mqtt://127.0.0.1:1883
    这里如果下载了源码进行打包的同学可以在 MQTTProtocolHandler类中下面位置新增被圈中的代码
    image

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

  • Dockerfile要与nar文件处于同一目录下,如/etc/mop

生成镜像

在/etc/mop目录下执行docker build -t apachepulsar/pulsar-all:2.7.2-mop . 生成本地镜像
##准备helm
pulsar-helm官方地址

  • 安装好helm,网上教程很多,这里就不在赘述
  • 从pulsar-helm官方网址中下载pulsar-helm到本地
  • 修改helm中的values.yaml文件中pulsar镜像配置,路径:../pulsar-helm-chart/charts/pulsar/values.yaml找到images配置,如下图
    image ,apachepulsar/pulsar-all的tag都改成2.7.2-mop
  • 在pulsar-helm-chart目录下执行以下命令
helm 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此服务的域名或者地址,具体方法请自行摸索

from mop.

codelipenghui avatar codelipenghui commented on May 26, 2024

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

from mop.

liangyuanpeng avatar liangyuanpeng commented on May 26, 2024

@xiaoxiongmao-liu

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

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

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

from mop.

liangyuanpeng avatar liangyuanpeng commented on May 26, 2024

I think streamnative/charts worth paying attention to.

Especially streamnative/charts#295 (Enable MQTT-on-Pulsar on Broker ).

from mop.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.