diff --git a/site2/docs/about.md b/site2/docs/about.md index 6a1dd53837275..25b093fdc0ff6 100644 --- a/site2/docs/about.md +++ b/site2/docs/about.md @@ -27,9 +27,9 @@ Select one of the content blocks below to begin your Pulsar journey. If you ... - + - + diff --git a/site2/docs/developers-landing.md b/site2/docs/developers-landing.md index df03e4fe318be..f5c8ccee181d3 100644 --- a/site2/docs/developers-landing.md +++ b/site2/docs/developers-landing.md @@ -1,12 +1,12 @@ --- id: developers-landing title: Pulsar for Developers -sidebar_label: "get started" +sidebar_label: "Pulsar for Developers" --- Developing applications for Pulsar can be a fun and rewarding experience. With Pulsar, you can quickly create, deploy, and manage your services using a powerful CLI tool and a comprehensive set of libraries. The topics below will get you started! -- [Simulation tools](develop-tools.md) -- [Developing binary protocol](developing-binary-protocol.md) -- [Modular load manager](develop-load-manager.md) -- [Pulsar plugin development](develop-plugin.md) +- [Develop simulation tools](develop-tools.md) +- [Develop binary protocol](developing-binary-protocol.md) +- [Develop load manager](develop-load-manager.md) +- [Develop Pulsar plugin](develop-plugin.md) diff --git a/site2/docs/how-to-landing.md b/site2/docs/how-to-landing.md new file mode 100644 index 0000000000000..90c47b64b6b34 --- /dev/null +++ b/site2/docs/how-to-landing.md @@ -0,0 +1,17 @@ +--- +Id: how-to-landing +title: How-to +sidebar_label: “” +--- + + +Learning new software can be an overwhelming task, but relax – most aspects of Pulsar can be easily configured in just a few steps. These tutorials will show you how to quickly create topics, tenants, and namespaces, produce and consume messages, and more! + +- [How to create a topic](tutorials-topic.md) +- [How to create a tenant](tutorials-tenant.md) +- [How to create a namespace](tutorials-namespace.md) +- [How to produce and consume messages](tutorials-produce-consume.md) + + + + diff --git a/site2/docs/install-deploy-upgrade-landing.md b/site2/docs/install-deploy-upgrade-landing.md new file mode 100644 index 0000000000000..5751dca2eb592 --- /dev/null +++ b/site2/docs/install-deploy-upgrade-landing.md @@ -0,0 +1,23 @@ +--- +Id: install-deploy-upgrade-landing +title: Install, Deploy and Upgrade Pulsar +sidebar_label: “Tutorials” +--- + + +Any developer can install, deploy, and upgrade Apache Pulsar in a few simple steps and start building scalable, real-time applications quickly. The resources below will kickstart your deployment! + +- [Set up a standalone Pulsar locally](getting-started-standalone.md) + +- [Deploy a Pulsar cluster on AWS using Terraform and Ansible](deploy-aws.md) + +- [Deploy a Pulsar cluster using Helm](helm-deploy.md) + +- [Upgrade Pulsar Helm release](helm-upgrade.md) + + + + + + + diff --git a/site2/docs/tutorials-namespace.md b/site2/docs/tutorials-namespace.md new file mode 100644 index 0000000000000..6caa4e784fb4a --- /dev/null +++ b/site2/docs/tutorials-namespace.md @@ -0,0 +1,44 @@ +--- +Id: tutorials-namespace +title: How to create a namespace +sidebar_label: “Tutorials” +--- + + +Pulsar namespaces are logical groupings of topics. + +Namespaces can be managed via: + +- The namespaces command of the pulsar-admin tool +- The /admin/v2/namespaces endpoint of the admin {@inject: rest:REST:/} API +- The namespaces method of the PulsarAdmin object in the Java API + +In this tutorial, we create a namespace called pulsar in the tenant apache. Then we list namespaces of tenant apache to see if the namespace is created successfully. + +Create the namespace. + +```bash +bin/pulsar-admin namespaces create apache/pulsar +``` + +Verify the namespace. + +```bash +bin/pulsar-admin namespaces list apache +``` + +You should see similar output to show the namespace apache/pulsar has been successfully created. + +#### Related Topics + +- [Set up a tenant](tutorials-tenant.md) +- [Create a topic](tutorials-topic.md) +- [Produce and consume messages](tutorials-produce-consume.md) +- [Manage clusters](admin-api-clusters.md) + + + + + + + diff --git a/site2/docs/tutorials-produce-consume.md b/site2/docs/tutorials-produce-consume.md new file mode 100644 index 0000000000000..dd333f5c73d56 --- /dev/null +++ b/site2/docs/tutorials-produce-consume.md @@ -0,0 +1,77 @@ +--- +Id: tutorials-produce-consume +title: Produce and consume messages +sidebar_label: “Tutorials” +--- + +In this tutorial, we will: +- Configure the Pulsar client +- Create a subscription +- Create a producer +- Send test messages +- Verify the results + +## Prerequisites + +- [Create tenant](tutorials-tenant.md) +- [Create namespace](tutorials-namespace.md) +- [Create topic](tutorials-topic.md) + +## Produce and consume messages + +1. In the `${PULSAR_HOME}/conf/client.conf` file, replace `webServiceUrl` and `brokerServiceUrl` with your service URL. + +2. Create a subscription to consume messages from `apache/pulsar/test-topic`. + + ```bash + bin/pulsar-client consume -s sub apache/pulsar/test-topic -n 0 + ``` + +3. In a new terminal, create a producer and send 10 messages to test-topic. + + ```bash + bin/pulsar-client produce apache/pulsar/test-topic -m "---------hello apache pulsar-------" -n 10 + ``` + +4. Verify the results. + + ``` + ----- got message ----- + ---------hello apache pulsar------- + ----- got message ----- + ---------hello apache pulsar------- + ----- got message ----- + ---------hello apache pulsar------- + ----- got message ----- + ---------hello apache pulsar------- + ----- got message ----- + ---------hello apache pulsar------- + ----- got message ----- + ---------hello apache pulsar------- + ----- got message ----- + ---------hello apache pulsar------- + ----- got message ----- + ---------hello apache pulsar------- + ----- got message ----- + ---------hello apache pulsar------- + ----- got message ----- + ---------hello apache pulsar------- + + Output from the producer side shows the messages have been produced successfully: + 18:15:15.489 [main] INFO org.apache.pulsar.client.cli.PulsarClientTool - 10 messages successfully produced. + ``` + +#### Related Topics +- [Set up a tenant](tutorials-tenant.md) +- [Create a topic](tutorials-topic.md) +- [Create a namespace](tutorials-namespace.md) +- [Manage clusters](admin-api-clusters.md) + + + + + + + + + diff --git a/site2/docs/tutorials-tenant.md b/site2/docs/tutorials-tenant.md new file mode 100644 index 0000000000000..92192797d893c --- /dev/null +++ b/site2/docs/tutorials-tenant.md @@ -0,0 +1,54 @@ +--- +Id: tutorials-tenant +title: How to set up a tenant +sidebar_label: “Tutorials” +--- + + +Pulsar is a powerful messaging system you can use to process and route high volumes of data. Each tenant provides a distinct unit of isolation with its own set of roles, permissions, configuration settings, and bookmarks. + +In this tutorial, you will create a new tenant, named “apache” in your Pulsar cluster, hosted in K8s helm. + +To create a tenant: + +1. Enter the toolset container. + + ```bash + kubectl exec -it -n pulsar pulsar-mini-toolset-0 -- /bin/bash + ``` + +2. In the toolset container, create a tenant named apache. + + ```bash + bin/pulsar-admin tenants create apache + ``` + +3. List the tenants to see if the tenant is created successfully. + + ```bash + bin/pulsar-admin tenants list + ``` + + You should see a similar output as below. + + ``` + The tenant apache has been successfully created. + "apache" + "public" + "pulsar" + ``` + +#### Related Topics + +- [How to create a namespace](tutorials-namespace.md) +- [How to create a topic](tutorials-topic.md) +- [Run a standalone cluster in Kubernetes](getting-started-helm.md) + + + + + + + + + diff --git a/site2/docs/tutorials-topic.md b/site2/docs/tutorials-topic.md new file mode 100644 index 0000000000000..e0ebc8fbfea9b --- /dev/null +++ b/site2/docs/tutorials-topic.md @@ -0,0 +1,39 @@ +--- +Id: tutorials-topic +title: How to create a topic +sidebar_label: “Tutorials” +--- + + +Apache Pulsar is a distributed messaging system that supports high performance and low latency. Topics are the primary way to structure data in Apache Pulsar. A Pulsar topic is a unit of storage that organizes messages into a stream. Each message in a topic has an offset, which uniquely identifies the message within the topic. + +## Prerequisites +[Publish to partitioned topics](admin-api-topics.md#publish-to-partitioned-topics) + +## Create a topic + +1. Create `test-topic` with 4 partitions in the namespace `apache/pulsar`. + + ```bash + bin/pulsar-admin topics create-partitioned-topic apache/pulsar/test-topic -p 4 + ``` + +2. List all the partitioned topics in the namespace `apache/pulsar`. + + ```bash + bin/pulsar-admin topics list-partitioned-topics apache/pulsar + ``` + +#### Related Topics + +- [How to set up a tenant](tutorials-tenant.md) +- [How to create a namespace](tutorials-namespace.md) +- [How to produce and consume messages](tutorial-produce-consume.md) + + + + + + + + diff --git a/site2/website/sidebars.json b/site2/website/sidebars.json index 4e0573602bdfb..44890c019e471 100644 --- a/site2/website/sidebars.json +++ b/site2/website/sidebars.json @@ -210,6 +210,10 @@ { "type": "category", "label": "Deployment", + "link": { + "type": "doc", + "id": "install-deploy-upgrade-landing" + }, "items": [ "deploy-aws", {