You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by si...@apache.org on 2019/05/26 09:24:21 UTC

[pulsar] branch master updated: [Doc] Add *Connect Pulsar to MySQL* (#4338)

This is an automated email from the ASF dual-hosted git repository.

sijie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new 7924846  [Doc] Add *Connect Pulsar to MySQL* (#4338)
7924846 is described below

commit 7924846211e7796f4b17529353380e2e85664bf4
Author: Anonymitaet <50...@users.noreply.github.com>
AuthorDate: Sun May 26 17:24:16 2019 +0800

    [Doc] Add *Connect Pulsar to MySQL* (#4338)
    
    Fix #4073
---
 site2/docs/functions-api.md        |   4 +-
 site2/docs/functions-quickstart.md |   4 +-
 site2/docs/io-quickstart.md        | 570 ++++++++++++++++++++++++++++++-------
 site2/docs/sql-getting-started.md  |   4 +-
 site2/website/sidebars.json        |   2 +-
 5 files changed, 473 insertions(+), 111 deletions(-)

diff --git a/site2/docs/functions-api.md b/site2/docs/functions-api.md
index adec1e6..5bcd081 100644
--- a/site2/docs/functions-api.md
+++ b/site2/docs/functions-api.md
@@ -156,7 +156,7 @@ Writing Pulsar Functions in Java involves implementing one of two interfaces:
 * The [`java.util.Function`](https://docs.oracle.com/javase/8/docs/api/java/util/function/Function.html) interface
 * The {@inject: javadoc:Function:/pulsar-functions/org/apache/pulsar/functions/api/Function} interface. This interface works much like the `java.util.Function` interface, but with the important difference that it provides a {@inject: javadoc:Context:/pulsar-functions/org/apache/pulsar/functions/api/Context} object that you can use in a [variety of ways](#context)
 
-### Getting started
+### Get started
 
 In order to write Pulsar Functions in Java, you'll need to install the proper [dependencies](#dependencies) and package your function [as a JAR](#packaging).
 
@@ -520,7 +520,7 @@ Writing Pulsar Functions in Python entails implementing one of two things:
 * A `process` function that takes an input (message data from the function's input topic(s)), applies some kind of logic to it, and either returns an object (to be published to the function's output topic) or `pass`es and thus doesn't produce a message
 * A `Function` class that has a `process` method that provides a message input to process and a [context](#context) object
 
-### Getting started
+### Get started
 
 Regardless of which [deployment mode](functions-deploying.md) you're using, 'pulsar-client' python library has to installed on any machine that's running Pulsar Functions written in Python.
 
diff --git a/site2/docs/functions-quickstart.md b/site2/docs/functions-quickstart.md
index 745bab9..6b7a026 100644
--- a/site2/docs/functions-quickstart.md
+++ b/site2/docs/functions-quickstart.md
@@ -1,7 +1,7 @@
 ---
 id: functions-quickstart
-title: Getting started with Pulsar Functions
-sidebar_label: Getting started
+title: Get started with Pulsar Functions
+sidebar_label: Get started
 ---
 
 This tutorial will walk you through running a [standalone](reference-terminology.md#standalone) Pulsar [cluster](reference-terminology.md#cluster) on your machine and then running your first Pulsar Functions using that cluster. The first function will run in local run mode (outside your Pulsar [cluster](reference-terminology.md#cluster)), while the second will run in cluster mode (inside your cluster).
diff --git a/site2/docs/io-quickstart.md b/site2/docs/io-quickstart.md
index fcd311f..8d94183 100644
--- a/site2/docs/io-quickstart.md
+++ b/site2/docs/io-quickstart.md
@@ -1,136 +1,94 @@
 ---
 id: io-quickstart
-title: "Tutorial: Connecting Pulsar with Apache Cassandra"
-sidebar_label: Getting started
+title: "Tutorial: Connect Pulsar with Database"
+sidebar_label: Get started
 ---
 
-This tutorial provides a hands-on look at how you can move data out of Pulsar without writing a single line of code.
-It is helpful to review the [concepts](io-overview.md) for Pulsar I/O in tandem with running the steps in this guide
-to gain a deeper understanding. At the end of this tutorial, you will be able to:
+This tutorial provides a hands-on look at how you can move data out of Pulsar without writing a single line of code.  
 
-- Connect your Pulsar cluster with your Cassandra cluster
+It is helpful to review the [concepts](io-overview.md) for Pulsar I/O with running the steps in this guide to gain a deeper understanding.   
+
+At the end of this tutorial, you will be able to:
+
+- [Connect Pulsar to Apache Cassandra](#Connect-Pulsar-to-Apache-Cassandra)
+  
+- [Connect Pulsar to MySQL](#Connect-Pulsar-to-MySQL)
 
 > #### Tip
 >
-> 1. These instructions assume you are running Pulsar in [standalone mode](getting-started-standalone.md). However all
+> * These instructions assume you are running Pulsar in [standalone mode](getting-started-standalone.md). However all
 > the commands used in this tutorial should be able to be used in a multi-nodes Pulsar cluster without any changes.
 >
-> 2. All the instructions are assumed to run at the root directory of a Pulsar binary distribution.
-
-## Installing Pulsar
-
-To get started running Pulsar, download a binary tarball release in one of the following ways:
-
-* by clicking the link below and downloading the release from an Apache mirror:
-
-  * <a href="pulsar:binary_release_url" download>Pulsar {{pulsar:version}} binary release</a>
-
-* from the Pulsar [downloads page](pulsar:download_page_url)
-* from the Pulsar [releases page](https://github.com/apache/pulsar/releases/latest)
-* using [wget](https://www.gnu.org/software/wget):
-
-  ```shell
-  $ wget pulsar:binary_release_url
-  ```
-
-Once the tarball is downloaded, untar it and `cd` into the resulting directory:
-
-```bash
-$ tar xvfz apache-pulsar-{{pulsar:version}}-bin.tar.gz
-$ cd apache-pulsar-{{pulsar:version}}
-```
+> * All the instructions are assumed to run at the root directory of a Pulsar binary distribution.
 
-## Installing Builtin Connectors
+## Install Pulsar and builtin connector
 
-Since release `2.3.0`, Pulsar releases all the `builtin` connectors as individual archives.
-If you would like to enable those `builtin` connectors, you can download the connectors "NAR"
-archives and from the Pulsar [downloads page](pulsar:download_page_url).
+Before connecting Pulsar to a database, we need to install Pulsar and the desired builtin connector.
 
-After downloading the desired builtin connectors, these archives should be places under
-the `connectors` directory where you have unpacked the Pulsar distribution.
+For more information about how to install a standalone Pulsar and builtin connectors, see [here](standalone/#installing-pulsar).
 
+## Start a standalone Pulsar 
 
-```bash
-# Unpack regular Pulsar tarball and copy connectors NAR archives
-$ tar xvfz /path/to/apache-pulsar-{{pulsar:version}}-bin.tar.gz
-$ cd apache-pulsar-{{pulsar:version}}
-$ mkdir connectors
-$ cp -r /path/to/downloaded/connectors/*.nar ./connectors
-
-$ ls connectors
-pulsar-io-aerospike-{{pulsar:version}}.nar
-pulsar-io-cassandra-{{pulsar:version}}.nar
-pulsar-io-kafka-{{pulsar:version}}.nar
-pulsar-io-kinesis-{{pulsar:version}}.nar
-pulsar-io-rabbitmq-{{pulsar:version}}.nar
-pulsar-io-twitter-{{pulsar:version}}.nar
-...
-```
+1. Start Pulsar locally.
 
-> #### Tip
->
-> You can also use the Docker image `apachepulsar/pulsar-all:{{pulsar:version}}` which already
-> comes with all the available builtin connectors.
+    ```bash
+    bin/pulsar standalone
+    ```
 
-## Start Pulsar Service
+    All the components of a Pulsar service will start in order. You can curl those pulsar service endpoints to make sure Pulsar service is up running correctly.
 
-```bash
-bin/pulsar standalone
-```
-
-All the components of a Pulsar service will start in order. You can curl those pulsar service endpoints to make sure Pulsar service is up running correctly.
-
-1. Check pulsar binary protocol port.
+2. Check Pulsar binary protocol port.
 
-```bash
-telnet localhost 6650
-```
+    ```bash
+    telnet localhost 6650
+    ```
 
-2. Check pulsar function cluster
+3. Check Pulsar Function cluster.
 
-```bash
-curl -s http://localhost:8080/admin/v2/worker/cluster
-```
+    ```bash
+    curl -s http://localhost:8080/admin/v2/worker/cluster
+    ```
 
-Example output:
-```shell
-[{"workerId":"c-standalone-fw-localhost-6750","workerHostname":"localhost","port":6750}]
-```
+    Example output:
+    ```shell
+    [{"workerId":"c-standalone-fw-localhost-6750","workerHostname":"localhost","port":6750}]
+    ```
 
-3. Make sure public tenant and default namespace exist
+4. Make sure public tenant and default namespace exist.
 
-```bash
-curl -s http://localhost:8080/admin/v2/namespaces/public
-```
+    ```bash
+    curl -s http://localhost:8080/admin/v2/namespaces/public
+    ```
 
-Example outoupt:
-```shell
-["public/default","public/functions"]
-```
+    Example outoupt:
+    ```shell
+    ["public/default","public/functions"]
+    ```
 
-4. All builtin connectors should be listed as available.
+5. All builtin connectors should be listed as available.
 
-```bash
-curl -s http://localhost:8080/admin/v2/functions/connectors
-```
+    ```bash
+    curl -s http://localhost:8080/admin/v2/functions/connectors
+    ```
 
-Example output:
-```json
-[{"name":"aerospike","description":"Aerospike database sink","sinkClass":"org.apache.pulsar.io.aerospike.AerospikeStringSink"},{"name":"cassandra","description":"Writes data into Cassandra","sinkClass":"org.apache.pulsar.io.cassandra.CassandraStringSink"},{"name":"kafka","description":"Kafka source and sink connector","sourceClass":"org.apache.pulsar.io.kafka.KafkaStringSource","sinkClass":"org.apache.pulsar.io.kafka.KafkaBytesSink"},{"name":"kinesis","description":"Kinesis sink connecto [...]
-```
+    Example output:
+    ```json
+    [{"name":"aerospike","description":"Aerospike database sink","sinkClass":"org.apache.pulsar.io.aerospike.AerospikeStringSink"},{"name":"cassandra","description":"Writes data into Cassandra","sinkClass":"org.apache.pulsar.io.cassandra.CassandraStringSink"},{"name":"kafka","description":"Kafka source and sink connector","sourceClass":"org.apache.pulsar.io.kafka.KafkaStringSource","sinkClass":"org.apache.pulsar.io.kafka.KafkaBytesSink"},{"name":"kinesis","description":"Kinesis sink conn [...]
+    ```
 
-If an error occurred while starting Pulsar service, you may be able to seen exception at the terminal you are running `pulsar/standalone`,
-or you can navigate the `logs` directory under the Pulsar directory to view the logs.
+    If an error occurred while starting Pulsar service, you may be able to seen exception at the terminal you are running `pulsar/standalone`,
+    or you can navigate the `logs` directory under the Pulsar directory to view the logs.
 
 ## Connect Pulsar to Apache Cassandra
 
-> Make sure you have docker available at your laptop. If you don't have docker installed, you can follow the [instructions](https://docs.docker.com/docker-for-mac/install/).
+> #### Tip
+> Make sure you have docker available at your computer. If you don't have docker installed, follow the instructions [here](https://docs.docker.com/docker-for-mac/install/).
 
 We are using `cassandra` docker image to start a single-node cassandra cluster in Docker.
 
-### Setup the Cassandra Cluster
+### Setup the Cassandra cluster
 
-#### Start a Cassandra Cluster
+#### Start a Cassandra cluster
 
 ```bash
 docker run -d --rm --name=cassandra -p 9042:9042 cassandra
@@ -180,7 +138,7 @@ cqlsh>
 
 All the following commands are executed in `cqlsh`.
 
-##### Create keyspace `pulsar_test_keyspace`
+#### Create keyspace `pulsar_test_keyspace`
 
 ```bash
 cqlsh> CREATE KEYSPACE pulsar_test_keyspace WITH replication = {'class':'SimpleStrategy', 'replication_factor':1};
@@ -193,12 +151,12 @@ cqlsh> USE pulsar_test_keyspace;
 cqlsh:pulsar_test_keyspace> CREATE TABLE pulsar_test_table (key text PRIMARY KEY, col text);
 ```
 
-### Configure a Cassandra Sink
+### Configure a Cassandra sink
 
 Now that we have a Cassandra cluster running locally. In this section, we will configure a Cassandra sink connector.
 The Cassandra sink connector will read messages from a Pulsar topic and write the messages into a Cassandra table.
 
-In order to run a Cassandra sink connector, you need to prepare a yaml config file including informations that Pulsar IO
+In order to run a Cassandra sink connector, you need to prepare a yaml config file including information that Pulsar IO
 runtime needs to know. For example, how Pulsar IO can find the cassandra cluster, what is the keyspace and table that
 Pulsar IO will be using for writing Pulsar messages to.
 
@@ -215,7 +173,7 @@ configs:
 
 To learn more about Cassandra Connector, see [Cassandra Connector](io-cassandra.md).
 
-### Submit a Cassandra Sink
+### Submit a Cassandra sink
 
 Pulsar provides the [CLI](reference-cli-tools.md) for running and managing Pulsar I/O connectors.
 
@@ -234,7 +192,7 @@ bin/pulsar-admin sink create \
 Once the command is executed, Pulsar will create a sink connector named `cassandra-test-sink` and the sink connector will be running
 as a Pulsar Function and write the messages produced in topic `test_cassandra` to Cassandra table `pulsar_test_table`.
 
-### Inspect the Cassandra Sink
+### Inspect the Cassandra sink
 
 You can use [sink CLI](reference-pulsar-admin.md#sink) and [source CLI](reference-pulsar-admin.md#source)
 for inspecting and managing the IO connectors.
@@ -276,7 +234,7 @@ Example output:
 }
 ```
 
-#### Check Sink Running Status
+#### Check Sink running status
 
 ```bash
 bin/pulsar-admin sink status \
@@ -310,7 +268,7 @@ Example output:
 }
 ```
 
-### Verify the Cassandra Sink
+### Verify the Cassandra sink
 
 Now lets produce some messages to the input topic of the Cassandra sink `test_cassandra`.
 
@@ -386,3 +344,407 @@ bin/pulsar-admin sink delete \
     --namespace default \
     --name cassandra-test-sink
 ```
+
+## Connect Pulsar to MySQL
+
+> #### Tip
+> Make sure you have Docker available at your computer. If you don't have Docker installed, follow the instructions [here](https://docs.docker.com/docker-for-mac/install/).
+
+### Setup a MySQL cluster
+
+Use the MySQL 5.7 docker image to start a single-node MySQL cluster in Docker.
+
+1. Pull the MySQL 5.7 image from Docker Hub.
+
+    ```text
+    $ docker pull mysql:5.7
+    ```
+
+2. Start MySQL.
+
+    ```text
+    $ docker run -d -it --rm \
+    --name pulsar-mysql \
+    -p 3306:3306 \
+    -e MYSQL_ROOT_PASSWORD=jdbc \
+    -e MYSQL_USER=mysqluser \
+    -e MYSQL_PASSWORD=mysqlpw \
+    mysql:5.7
+    ```
+
+    > #### Tip
+    >
+    > Flag | Description | This example
+    > - | - | -
+    > `-d` | To start a container in detached mode. | /
+    > `-it` | Keep STDIN open even if not attached and allocate a terminal. | /
+    > `--rm` | Remove the container automatically when it exits. | /
+    > `-name` | Assign a name to the container. | This example specifies _pulsar-mysql_ for the container.
+    > `-p` | Publish the port of the container to the host. | This example publishes the port _3306_ of the container to the host.
+    > `-e` | Set environment variables. | This example sets the following variables:<br>- The password for the root user is _jdbc_. <br>- The name for the normal user is _mysqluser_. <br>- The password for the normal user is _mysqlpw_.
+    > For more information about Docker command, see [here](#https://docs.docker.com/engine/reference/commandline/run/).
+
+3. Check if MySQL has been started successfully.
+
+    ```text
+    $ docker logs -f pulsar-mysql
+    ```
+
+    MySQL has been started successfully if the following message appears.
+
+    ```text
+    2019-05-11T10:40:58.709964Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
+    2019-05-11T10:40:58.710155Z 0 [Warning] CA certificate ca.pem is self signed.
+    2019-05-11T10:40:58.711921Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
+    2019-05-11T10:40:58.711985Z 0 [Note] IPv6 is available.
+    2019-05-11T10:40:58.712695Z 0 [Note]   - '::' resolves to '::';
+    2019-05-11T10:40:58.712742Z 0 [Note] Server socket created on IP: '::'.
+    2019-05-11T10:40:58.714334Z 0 [Warning] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
+    2019-05-11T10:40:58.723802Z 0 [Note] Event Scheduler: Loaded 0 events
+    2019-05-11T10:40:58.724200Z 0 [Note] mysqld: ready for connections.
+    Version: '5.7.26'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server (GPL)
+    ```
+
+4. Access to MySQL.
+
+    ```text
+    $ docker exec -it pulsar-mysql /bin/bash
+    mysql -h localhost -uroot -pjdbc 
+    ```
+
+5. Create a _pulsar_mysql_jdbc_sink_ table.
+
+    ```text
+    $ create database pulsar_mysql_jdbc_sink;
+
+    $ use pulsar_mysql_jdbc_sink;
+
+    $ create table if not exists pulsar_mysql_jdbc_sink
+    (
+    id INT AUTO_INCREMENT,
+    name VARCHAR(255) NOT NULL,
+    primary key (id)
+    )
+    engine=innodb;
+    ```
+
+### Configure a JDBC sink
+
+Now that we have a MySQL running locally. In this section, we will configure a JDBC sink connector. The JDBC sink connector will read messages from a Pulsar topic and write messages into a MySQL table.
+
+1. Add a configuration file.   
+   
+    To run a JDBC sink connector, you need to prepare a yaml config file including the information that Pulsar IO runtime needs to know. For example, how Pulsar IO can find the MySQL cluster, what is the JDBCURL and the table that Pulsar IO will use for writing messages to.
+
+    Create a _pulsar-mysql-jdbc-sink.yaml_ file , copy the following contents to this file, and place the file in the `pulsar/connectors` folder.
+
+    ```text
+    configs:
+      userName: "root"
+      password: "jdbc"
+      jdbcUrl: "jdbc:mysql://127.0.0.1:3306/pulsar_mysql_jdbc_sink"
+      tableName: "pulsar_mysql_jdbc_sink"
+    ```
+
+2. Create a schema.
+
+    Create a _avro-schema_ file, copy the following contents to this file, and place the file in the `pulsar/connectors` folder.
+
+    ```text
+    {
+      "type": "AVRO",
+      "schema": "{\"type\":\"record\",\"name\":\"Test\",\"fields\":[{\"name\":\"id\",\"type\":[\"null\",\"int\"]},{\"name\":\"name\",\"type\":[\"null\",\"string\"]}]}",
+      "properties": {}
+    }
+    ```
+
+    > #### Tip
+    >
+    > For more information about AVRO, see [Apache Avro Documentation](https://avro.apache.org/docs/1.8.2/).
+
+
+3. Upload a schema to a topic.  
+
+    This example uploads the _avro-schema_ schema to the _pulsar-mysql-jdbc-sink-topic_ topic.
+
+    ```text
+    $ bin/pulsar-admin schemas upload pulsar-mysql-jdbc-sink-topic -f ./connectors/avro-schema
+    ```
+
+4. Check if the schema has been uploaded successfully.
+
+    ```text
+    $ bin/pulsar-admin schemas get pulsar-mysql-jdbc-sink-topic
+    ```
+
+    The schema has been uploaded successfully if the following message appears.
+
+    ```text
+    {
+      "name" : "pulsar-mysql-jdbc-sink-topic",
+      "schema" : "eyJ0eXBlIjoicmVjb3JkIiwibmFtZSI6IlRlc3QiLCJmaWVsZHMiOlt7Im5hbWUiOiJpZCIsInR5cGUiOlsibnVsbCIsImludCJdfSx7Im5hbWUiOiJuYW1lIiwidHlwZSI6WyJudWxsIiwic3RyaW5nIl19XX0=",
+      "type" : "AVRO",
+      "properties" : { }
+    }
+    ```
+
+### Submit a JDBC sink
+
+Pulsar provides the [CLI](admin-api-overview.md) for running and managing Pulsar I/O connectors.
+
+This example creates a sink connector and specifies the desired information.
+
+```text
+$ bin/pulsar-admin sink create \
+--archive ./connectors/pulsar-io-jdbc-{{pulsar:version}}.nar \
+--inputs pulsar-mysql-jdbc-sink-topic \
+--name pulsar-mysql-jdbc-sink \
+--sink-config-file ./connectors/pulsar-mysql-jdbc-sink.yaml \
+--parallelism 1
+```
+
+Once the command is executed, Pulsar will create a sink connector named _pulsar-mysql-jdbc-sink_, and the sink connector will be running as a Pulsar Function and write the messages produced in the  _pulsar-mysql-jdbc-sink-topic_ topic to the MySQL _pulsar_mysql_jdbc_sink_ table.
+
+> #### Tip
+>
+> Flag | Description | This example
+> - | - | - |
+> `--archive` | Path to the archive file for the sink. | _pulsar-io-jdbc-{{pulsar:version}}.nar_ 
+> `--inputs` | The input topic or topics of the sink. <br> (Multiple topics can be specified as a comma-separated list.)
+> `--name` | The name of the sink. | _pulsar-mysql-jdbc-sink_
+> `--sink-config-file` | The path to a YAML config file specifying the configuration of the sink. | _pulsar-mysql-jdbc-sink.yaml_ 
+> `--parallelism` | The parallelism factor of the sink. <br> For example, the number of sink instances to run. |  _1_
+> For more information about `pulsar-admin sink create options`, see [here](pulsar-admin/#create-3).
+
+The sink has been created successfully if the following message appears.
+
+```text
+"Created successfully"
+```
+
+### Inspect a JDBC sink
+
+#### List all running JDBC sink(s)
+
+This example lists all running sink connectors.
+
+```text
+$ bin/pulsar-admin sink list \
+--tenant public \
+--namespace default
+```
+
+The result shows that only the _mysql-jdbc-sink_ sink is running.
+
+```text
+[
+ "pulsar-mysql-jdbc-sink"
+]
+```
+
+#### Get information of a JDBC sink
+
+This example gets the information about the _pulsar-mysql-jdbc-sink_ sink connector.
+
+```text
+$ bin/pulsar-admin sink get \
+--tenant public \
+--namespace default \
+--name pulsar-mysql-jdbc-sink
+```
+
+The result show the information of the sink connector, including tenant, namespace, topic and so on.
+
+```text
+{
+  "tenant": "public",
+  "namespace": "default",
+  "name": "pulsar-mysql-jdbc-sink",
+  "className": "org.apache.pulsar.io.jdbc.JdbcAutoSchemaSink",
+  "inputSpecs": {
+    "pulsar-mysql-jdbc-sink-topic": {
+      "isRegexPattern": false
+    }
+  },
+  "configs": {
+    "password": "jdbc",
+    "jdbcUrl": "jdbc:mysql://127.0.0.1:3306/pulsar_mysql_jdbc_sink",
+    "userName": "root",
+    "tableName": "pulsar_mysql_jdbc_sink"
+  },
+  "parallelism": 1,
+  "processingGuarantees": "ATLEAST_ONCE",
+  "retainOrdering": false,
+  "autoAck": true
+}
+```
+
+#### Get status of a JDBC sink
+
+This example checks the current status of the _pulsar-mysql-jdbc-sink_ sink connector.
+
+```text
+$ bin/pulsar-admin sink status \
+--tenant public \
+--namespace default \
+--name pulsar-mysql-jdbc-sink
+```
+
+The result shows the current status of sink connector, including the number of instance, running status, worker ID and so on.
+
+```text
+{
+  "numInstances" : 1,
+  "numRunning" : 1,
+  "instances" : [ {
+    "instanceId" : 0,
+    "status" : {
+      "running" : true,
+      "error" : "",
+      "numRestarts" : 0,
+      "numReadFromPulsar" : 0,
+      "numSystemExceptions" : 0,
+      "latestSystemExceptions" : [ ],
+      "numSinkExceptions" : 0,
+      "latestSinkExceptions" : [ ],
+      "numWrittenToSink" : 0,
+      "lastReceivedTime" : 0,
+      "workerId" : "c-standalone-fw-192.168.2.52-8080"
+    }
+  } ]
+}
+```
+
+### Stop a JDBC sink
+
+This example stops the _pulsar-mysql-jdbc-sink_ sink instance.
+
+```text
+$ bin/pulsar-admin sink stop \
+--tenant public \
+--namespace default \
+--name pulsar-mysql-jdbc-sink \
+--instance-id 0
+```
+
+The sink instance has been stopped successfully if the following message disappears.
+
+```text
+"Stopped successfully"
+```
+
+### Restart a JDBC sink
+
+This example starts the _pulsar-mysql-jdbc-sink_ sink instance.
+
+```text
+$ bin/pulsar-admin sink start \
+--tenant public \
+--namespace default \
+--name pulsar-mysql-jdbc-sink \
+--instance-id 0
+```
+
+The sink instance has been started successfully if the following message disappears.
+
+```text
+"Started successfully"
+```
+
+> #### Tip
+> Optionally, you can run a standalone sink connector using `pulsar-admin sink localrun options`. 
+> 
+> Note that `pulsar-admin sink localrun options` runs a sink connector locally, while `pulsar-admin sink start options` starts a sink connector in a cluster.
+>
+> For more information about `pulsar-admin sink localrun options`, see [here](pulsar-admin/#localrun-1).
+
+### Update a JDBC sink
+
+This example updates the parallelism of the _pulsar-mysql-jdbc-sink_ sink connector to 2.
+
+```text
+$ bin/pulsar-admin sink update \
+--name pulsar-mysql-jdbc-sink \
+--parallelism 2
+```
+
+> #### Tip
+> For more information about `pulsar-admin sink update options`, see [here](pulsar-admin/#update-2).
+
+The sink connector has been updated successfully if the following message disappears.
+
+```text
+"Updated successfully"
+```
+
+This example double-checks the information.
+
+```text
+$ bin/pulsar-admin sink get \
+--tenant public \
+--namespace default \
+--name pulsar-mysql-jdbc-sink
+```
+
+The result shows that the parallelism is 2.
+
+```text
+{
+  "tenant": "public",
+  "namespace": "default",
+  "name": "pulsar-mysql-jdbc-sink",
+  "className": "org.apache.pulsar.io.jdbc.JdbcAutoSchemaSink",
+  "inputSpecs": {
+    "pulsar-mysql-jdbc-sink-topic": {
+      "isRegexPattern": false
+    }
+  },
+  "configs": {
+    "password": "jdbc",
+    "jdbcUrl": "jdbc:mysql://127.0.0.1:3306/pulsar_mysql_jdbc_sink",
+    "userName": "root",
+    "tableName": "pulsar_mysql_jdbc_sink"
+  },
+  "parallelism": 2,
+  "processingGuarantees": "ATLEAST_ONCE",
+  "retainOrdering": false,
+  "autoAck": true
+}
+```
+
+### Delete a JDBC sink
+
+This example deletes the _pulsar-mysql-jdbc-sink_ sink connector.
+
+```text
+$ bin/pulsar-admin sink delete \
+--tenant public \
+--namespace default \
+--name pulsar-mysql-jdbc-sink
+```
+
+> #### Tip
+> For more information about `pulsar-admin sink delete options`, see [here](pulsar-admin/#delete-4).
+
+The sink connector has been deleted successfully if the following message appears.
+
+```text
+"Deleted successfully"
+```
+
+This example double-checks the existence of the sink connector.
+
+```text
+$ bin/pulsar-admin sink get \
+--tenant public \
+--namespace default \
+--name pulsar-mysql-jdbc-sink
+```
+
+The results shows that the sink connector does not exist.
+
+```text
+HTTP 404 Not Found
+
+Reason: Sink pulsar-mysql-jdbc-sink doesn't exist
+```
\ No newline at end of file
diff --git a/site2/docs/sql-getting-started.md b/site2/docs/sql-getting-started.md
index 0e673ac..dd7dff3 100644
--- a/site2/docs/sql-getting-started.md
+++ b/site2/docs/sql-getting-started.md
@@ -1,7 +1,7 @@
 ---
 id: sql-getting-started
-title: Pulsar SQL Getting Started
-sidebar_label: Getting Started
+title: Pulsar SQL Get Started
+sidebar_label: Get Started
 ---
 
 It is super easy to get started on querying data in Pulsar.  
diff --git a/site2/website/sidebars.json b/site2/website/sidebars.json
index cb4b77d..dcbc3d6 100644
--- a/site2/website/sidebars.json
+++ b/site2/website/sidebars.json
@@ -1,6 +1,6 @@
 {
   "docs": {
-    "Getting started": [
+    "Get started": [
       "pulsar-2.0",
       "standalone",
       "standalone-docker",