Connect to your cluster using Lenses

Note

This QuickStart assumes that you have created a Pulsar cluster with the Kafka protocol enabled, created a service account, and granted the service account produce and consume permissions to a namespace for the target topic.

This document shows how to connect to your Pulsar cluster using Lenses through Token authentication.

Before you begin

Note

  • Before getting the token of a service account, verify that the service account is authorized as a superuser or an admin of the tenants and namespaces.
  • A token has a system-defined Time-To-Live (TTL) of 7 days. Before a token expires, ensure that you generate a new token for your service account.
  • The password for different utilities as kcat will be equal to token:TOKEN
  • Get the JWT token.

    1. On the left navigation pane, click Service Accounts.

    2. In the row of the service account you want to use, in the Token column, click Generate new token, then click the Copy icon to copy the token to your clipboard.

  • Get the service URL of your Pulsar cluster.

    1. On the left navigation pane, in the Admin area, click Pulsar Clusters.
    2. Select the Details tab, and in the Access Points area, click Copy at the end of the row of the Kafka Service URL (TCP).

Steps

This section describes how to connect to your Pulsar cluster and export data from your Pulsar cluster using Lenses.

  1. Go to the Lenses UI and configure your Pulsar cluster.

    • [1] Bootstrap Servers: the Kafka service URL of your Pulsar cluster.
    • [2] Security Protocol: the security protocol of your Pulsar cluster.
    • [3] SASL Mechanism: the security mechanism of your Pulsar cluster.
    • [4] JAAS Configuration
      • username: the tenant and namespace name, in the format of <tenant-name>/<namespace-name>.
      • password: the token of your service account, in the format of token:<JWT token of your service account>

    configure pulsar cluster in Lenses

  2. View data in the target topic.

    a. On the left navigation pane of the Lenses UI, click Explore to navigate to the Explore page. b. Select the target topic.

    view data in the kop-topic topic

    The message in the topic kop-topic looks like the below:

    {
      "value": {
        "address": {
          "street": "Summer Place",
          "streetNumber": "79",
          "apartmentNumber": "",
          "postalCode": "96518",
          "city": "San Francisco"
        },
        "firstName": "Skylar",
        "middleName": "Skylar",
        "lastName": "Vega",
        "email": "[email protected]",
        "username": "skylarv",
        "password": "BAhSz5sB",
        "sex": "FEMALE",
        "telephoneNumber": "728-020-424",
        "dateOfBirth": -499301348331,
        "age": 69,
        "company": {
          "name": "Klein",
          "domain": "klein.biz",
          "email": "[email protected]",
          "vatIdentificationNumber": "62-0006870"
        },
        "companyEmail": "[email protected]",
        "nationalIdentityCardNumber": "860-15-3193",
        "nationalIdentificationNumber": "",
        "passportNumber": "TbfdoEIBP"
      }
    }
    
  3. Query data in the target topic.

    a. From the Header Bar menu, go to the Dashboard panel.

    b. On the side navigation, select SQL Studio under the Data section.

    query data in the kop-topic topic

Previous
KSQL