当前位置:网站首页>Deploying Apache pulsar on kubesphere
Deploying Apache pulsar on kubesphere
2022-06-23 04:24:00 【KubeSphere】
The authors introduce : Xu Wentao ,StreamNative Content Strategist, Love cloud native and open source technologies , Active in localization / file / Technology blog contribution , hold K8s CKA/CKAD/CKS authentication .
Apache Pulsar Introduce
Apache Pulsar As Apache Software foundation top projects , It is the next generation cloud native distributed message flow platform , Set message 、 Storage 、 Lightweight functional calculation as a whole , Using the separation of computing and storage architecture design , Multi tenant support 、 Persistent storage 、 Cross regional replication 、 Hierarchical storage , With strong consistency 、 High throughput 、 Low latency and high scalability streaming data storage features , It is the cloud native era to solve the real-time message stream data transmission 、 The best solution for storage and Computing .
Pulsar Of Broker There is no state , Don't store data .BookKeeper Responsible for storing data , Among them Bookie Support horizontal expansion , Metadata information is stored in ZooKeeper On . This architecture also facilitates the expansion and contraction of the container environment , Support high availability and other scenarios .

KubeSphere Introduce
KubeSphere It's based on Kubernetes A distributed operating system for cloud native applications , Fully open source , Support multi cloud and multi cluster management 、 The app store 、 Observability ( monitor 、 Alarm, audit, etc ) And multi tenancy , Provide a full stack of IT Automatic operation and maintenance capability , Simplify the enterprise DevOps workflow .

stay KubeSphere Installation on Apache Pulsar
As an application centric K8s Container platform ,KubeSphere Provide users with a variety of ways to install applications . For rapid deployment of applications , Here we recommend the following two methods :
- Directly from KubeSphere Install... In the app store of Pulsar.KubeSphere from 3.2.0 Added at the beginning of the version “ Dynamically load the app store ” The function of . Small partners who want to contribute applications can directly report to KubeSphere Of Helm Warehouse Contribute to the application Helm Chart, stay PR After approval, the latest app list will be loaded on the app store .
- add to Apache Pulsar Of Helm Warehouse to KubeSphere Application warehouse of , Then install... From the application repository Pulsar Application of the template . This installation is similar to the command line
helmRelated commands add the warehouse and install .
notes :KubeSphere The app store and the full lifecycle management function of apps are based on open source projects OpenPitrix. In the installation Pulsar front , You need first. stay KubeSphere Enable OpenPitrix.
Let's use the second method in KubeSphere Console Add Pulsar Of Helm Warehouse and install .
Prepare one KubeSphere colony . You can directly Use KubeKey install Or through ks-installer Already exist K8s Build on the cluster KubeSphere colony . meanwhile , Please note that Pulsar In the document for K8s Clusters and Helm Of Version for .
Create enterprise spaces and projects . The enterprise space is KubeSphere A logical unit in , For managing projects 、DevOps Resources such as projects and application templates , The administrator can manage the resource access rights ; Project means K8s Medium Namespace. For the convenience of demonstration , This article adopts
adminThe user action . be based on KubeSphere Multi tenant system , In a real-world environment, you can base on the responsibilities of each tenant in the organization , Create different accounts and assign corresponding roles .
In your corporate space , Click on Application Management > Application warehouse , Then click Add . After defining the warehouse name , add to
https://pulsar.apache.org/chartsWarehouse address . After the warehouse address is verified successfully , Click ok .
After the warehouse is successfully added , We also need to run a script , Create some and Pulsar dependent Secret And so on , For our follow-up visit Grafana and Pulsar Manager Tools such as . Go to your K8s node , Execution of the following command will pulsar-helm-chart Of GitHub Clone the warehouse locally . It should be noted that , You must be able to execute on this node
kubectlandhelmcommand .git clone https://github.com/apache/pulsar-helm-chartcd pulsar-helm-chartExecute the following command to run
prepare_helm_release.shScript . among -n Of or relating to Secret Generated Namespace,-k Refers to the usehelmInstall the application release name , These two places need to be with us KubeSphere The project specified on the corresponds to the application name . More information about the parameters available for this script , Can run./scripts/pulsar/prepare_helm_release.sh --helpCheck the details ../scripts/pulsar/prepare_helm_release.sh -n pulsar -k ks-pulsarGo to KubeSphere Project created in , The project in this example is named
pulsar.Click apply load > application , Under the template based application tab , Click Create .

Select apply template from , Select... From the drop-down list of the application template Pulsar The warehouse of . Click on Pulsar after , We can see it here Chart Some information about the file .

Click on the install . Define application name ( That is, when executing the script just now release name ), Select the version and installation location ( If you enable the multi cluster feature and add multiple clusters , There is also a choice Pulsar The cluster where the installation is located ), Click next .
Go to the application settings page , This is similar to using
helmCommand time customization values.yaml Document parameters . We set upnamespaceIs the project name ,initializebytrue( First installation only Pulsar You need to set ), And enable the Pulsar Manager( Set upcomponents.pulsar_managerbytrue), Then click Install . More specific information about these parameters , May refer to Pulsar file .
Wait a while , see Pulsar Whether the components of have been in normal operation .


Use Pulsar Manager establish Tenant、Namespace as well as Topic
Pulsar After the cluster is built , We can use Web Tools Pulsar Manager To manage Pulsar Tenants in (Tenant)、 Namespace (Namespace) And the theme (Topic). These resources can be used to ensure data isolation between different departments in the same organization , As shown in the figure below .

- Go to the application load > service , Entry exposure Pulsar Manager Of Service The details page of , And according to which LoadBalancer Type of IP Address plus slogan access Pulsar Manager. Note here , Depending on the deployment environment, you may also need to configure the corresponding firewall or port forwarding rules .

- Through the default account password
pulsar/pulsarSign in , Then add the environment .Service URL Fill in here Broker Of Service Address and port number , In this example http://ks-pulsar-broker:8080.
- Get into Pulsar Manager Of Dashboard after , Add... Under different menus Tenant、Namespace as well as Topic. Definition Topic We need to select the Topic The type of ( Persistent or non persistent ), And designate Topic The partition (Partition) Number . stay Pulsar in ,Topic The format is :{persistent | non-persistent}://tenant/namespace/topic. We need to record this information first , Back to the Topic When sending a message .


towards Pulsar The cluster sends information and consumes
Now we have created the relevant resources , You can try to Pulsar The cluster sends information and consumes .
Download it locally first Pulsar Binary file , Then decompress .
Get into Pulsar After the directory is modified conf/client.conf In the document webServiceUrl and brokerServiceUrl Address , Is used to Pulsar Client and Pulsar Cluster binding . In this example, the proxy access cluster is enabled , The address here needs to fill in the... Exposed by the agent IP Address . We can do it in KubeSphere Service page to find the proxy Service, And see... On its details page IP Address .

webServiceUrl=http://34.71.201.104:8080brokerServiceUrl=pulsar://34.71.201.104:6650After modification , stay Pulsar Execute the following command under the directory to create a subscription and consume information , In the command
kubesphere/kubesphere/kubesphereCorresponding to just now Pulsar Manager Created in Tenant、Namespace as well as Topic../bin/pulsar-client consume -s sub kubesphere/kubesphere/kubesphere -n 0
Be careful : Please make sure that... Is installed before operation Applicable Java JRE/JDK edition .
Open another command line window , Execute the following command to produce information .
./bin/pulsar-client produce kubesphere/kubesphere/kubesphere -m “Hello KubeSphere and Pulsar” -n 10You can see that the message has been successfully consumed .

adopt Grafana monitor Pulsar indicators
Pulsar Of Helm Chart Will be installed during deployment Grafana Provide with Pulsar Relevant observability indicators , It is convenient for us to conduct subsequent operation and maintenance analysis .
- And visit Pulsar Manager similar , Go to the application load > service , Entry exposure Grafana Of Service The details page of , And according to which LoadBalancer Type of IP Address plus slogan access Grafana.
- Through the default account password
pulsar/pulsarSign in . Select one in the upper left corner Dashboard To see Pulsar Related indicators . - You can see that the relevant data is successfully displayed in Grafana On .

summary
This article demonstrates the application of KubeSphere Upper Department Apache Pulsar Operation steps of . With the help of Pulsar Nature adapts to the characteristics of cloud native environment , We can use KubeSphere The operation and maintenance friendly operation interface is easy to deploy and manage Pulsar. Interested friends can read KubeSphere and Pulsar For more information .
6 month 25 On the daily line Meetup Notice
6 month 25 Japan ,KubeSphere Community unity Apache Pulsar Community , Jointly organize an online Meetup, A total of four topics , Registration is now open , Welcome to scan the QR code in the poster to sign up !

This article by the blog one article many sends the platform OpenWrite Release !
边栏推荐
猜你喜欢
随机推荐
What if the self incrementing IDs of online MySQL are exhausted?
Why APP But Not WebPage
Software project management 8.4 Software project quality plan
Pytorch---Pytorch进行自定义Dataset
折半查找法
最新编程语言排行榜
Getting started with tensorflow
photoshop PS 查看像素坐标、像素颜色、像素HSB颜色
Differences between MyISAM and InnoDB of MySQL storage engine
在 KubeSphere 上部署 Apache Pulsar
Twitter与Shopify合作 将商家产品引入Twitter购物当中
mysql,字段问题
Select sort method
For patch rollback, please check the cbpersistent log
node+express如何操作cookie
Three ways to export excel from pages
P1347 sorting (TOPO)
粒子动画背景登录页面particles.js
[greed] leetcode991 Broken Calculator
顺序表查找









