# Ensure configs below had been set correctly:# advertisedAddress=# zkServers=# extraServerComponents=org.apache.bookkeeper.stream.server.StreamStorageLifecycleComponent
vim conf/bookkeeper.conf
# Start the bookie
bin/pulsar-daemon start bookie
# Test the BookKeeper cluster had been run
bin/bookkeeper shell bookiesanity
# (Run this if needed) Clear BAD state of BookKeeper states
bin/bookkeeper shell metaformat -f
Provision the Pulsar Brokers
brokerServicePort: 6650
webServicePort: 8080
# Ensure configs below had been set correctly:# advertisedAddress=# zookeeperServers=# configurationStoreServers= <- set it eaqul to 'zookeeperServers' in most cases# clusterName= <- the same as you assigned to stpe 'Initialize cluster metadata'# managedLedgerDefaultEnsembleSize=1 <- Number of bookies to use when creating a ledger# managedLedgerDefaultWriteQuorum=1 <- Number of copies to store for each message# managedLedgerDefaultAckQuorum=1 <- Number of guaranteed copies (acks to wait before write is complete)# functionsWorkerEnabled=true <- set to true if wants to enalbe Pulsar Functions
vim conf/broker.conf
# If wants to enable Pulsar Functions, ensure the cluster name is correct # pulsarFunctionsCluster: <- the same as you assigned to stpe 'Initialize cluster metadata'
vim conf/functions_worker.yml
# Start the Pulsar Broker
bin/pulsar-daemon start broker
Use pulsar-client to test the cluster had been provisioned correctly
# Ensure pulsar-client can connect to the Pulsar cluster# webServiceUrl=# brokerServiceurl=
vim conf/client.conf
# Start a consumer
bin/pulsar-client consume \
persistent://public/default/test \
-n 100 \
-s "consumer-test" \
-t "Exclusive"# Produce a message
bin/pulsar-client produce \
persistent://public/default/test \
-n 1 \
-m "Hello Pulsar"
Test Pulsar Functions
# Create a Pulsar Function
bin/pulsar-admin functions create \
--jar examples/api-examples.jar \
--classname org.apache.pulsar.functions.api.examples.ExclamationFunction \
--inputs persistent://public/default/exclamation-input \
--output persistent://public/default/exclamation-output \
--tenant public \
--namespace default \
--name exclamation
# Trigger the Pulsar Function
bin/pulsar-admin functions trigger --name exclamation --trigger-value "hello world"