Jennifer88huang commented on a change in pull request #4229: [Doc]
Documentation about deploying and configuring pulsar functions-worker
URL: https://github.com/apache/pulsar/pull/4229#discussion_r283379561
##########
File path: site2/docs/functions-worker.md
##########
@@ -0,0 +1,260 @@
+---
+id: functions-worker
+title: Deploy and manage functions worker
+sidebar_label: Functions Worker
+---
+
+Pulsar `functions-worker` is the component to run Pulsar Functions in cluster
mode.
+This document describes the options, steps and configurations to set up Pulsar
+`functions-worker`.
+
+Before continuing the documentation, please be noted with a few things:
+
+1. The `--- Service Urls---` lines in the following diagrams represents that
Pulsar
+ service urls that Pulsar client and admin use to connect to a Pulsar
cluster.
+
+## Deployment options
+
+Pulsar `functions-worker` is designed as a logic component. It can run as part
of
+a broker or as a complete different process in a different broker. This section
+explores these two different options and how to configure them.
+
+### Run Functions-Worker with brokers
+
+The following diagram illustrates a deployment of functions-workers running
along with
+brokers.
+
+
+
+To enable functions-worker running as part of a broker,
`functionsWorkerEnabled` should
+be set to `true` in the broker configuration `broker.conf`.
+
+```conf
+functionsWorkerEnabled=true
+```
+
+Changing `functionsWorkerEnabled` to `true` only tells broker to start
functions-worker
+as part of it. You need to configure `conf/functions_worker.yml` to customize
your functions_worker.
+
+#### Configure Functions-Worker for running with brokers
+
+In this mode, since `functions-worker` is running as part of broker, most of
the settings
+already inherit from your broker configuration (e.g. configurationStore
settings, authentication settings, and etc).
+
+Below are the required settings you need to pay attentions to in configuring
functions-worker in this mode.
+
+- `numFunctionPackageReplicas`: The number of replicas for storing function
packages. The default value is 1, which
+ is good for a standalone deployment. For a production deployment, you should
change it to be more than `2` to ensure
+ high availability.
+- `pulsarFunctionsCluster`: Set the value to your Pulsar cluster name (same as
the `clusterName` setting in broker configuration).
+
+
+If authentication is enabled on the BookKeeper cluster, you should also
configure the BookKeeper authentication settings.
+They are:
+
+- `bookkeeperClientAuthenticationPlugin`: the BookKeeper client authentication
plugin name.
+- `bookkeeperClientAuthenticationParametersName`: the BookKeeper client
authentication plugin parameters name.
+- `bookkeeperClientAuthenticationParameters`: the BookKeeper client
authentication plugin parameters.
+
+#### Start Functions-Worker with broker
+
+Once you have configured the `functions_worker.yml`, you can just (re)start
your broker.
+
+After that you can use following command to verify if `functions-worker` is
running well.
+
+```bash
+curl <broker-ip>:8080/admin/v2/worker/cluster
+```
+
+It should return the list of function workers alive in the cluster. Similar
output is shown below as a reference.
+
+```json
+[{"workerId":"<worker-id>","workerHostname":"<worker-hostname>","port":8080}]
+```
+
+### Run Functions-Worker separately
+
+This section illustrates how to run `functions-worker` as a separated process
in separated machines.
+
+
+
+> NOTE: In this mode, you need to make sure `functionsWorkerEnabled` is set to
`false` so that your brokers
+don't start `functions-worker` by mistake.
+
+#### Configure Functions-Worker for running separately
+
+Following are the instructions for configuring function-worker.
+
+##### Worker settings
Review comment:
Could we just use "Worker parameters"? And same for the following titles.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services