pulsar
sudo apt update && sudo apt -y install openjdk-8-jre-headless
curl https://archive.apache.org/dist/zookeeper/zookeeper-3.4.11/zookeeper-3.4.11.tar.gz -o zookeeper-3.4.11.tar.gz
tar -xzf zookeeper-3.4.11.tar.gz
cp zookeeper-3.4.11/conf/zoo_sample.cfg zookeeper-3.4.11/conf/zoo.cfg
cd zookeeper-3.4.11
bin/zkServer.sh start conf/zoo.cfg
wget https://archive.apache.org/dist/pulsar/pulsar-2.3.1/apache-pulsar-2.3.1-bin.tar.gz
tar xvzf apache-pulsar-2.3.1-bin.tar.gz
cd apache-pulsar-2.3.1
JAVA_HOME
export JAVA_HOME=/usr
bin/pulsar initialize-cluster-metadata \
--cluster pulsar-cluster-1 \
--zookeeper 192.168.2.100:2181 \
--configuration-store 192.168.2.100:2181 \
--web-service-url http://192.168.2.100:8080 \
--broker-service-url pulsar://192.168.2.100:6650
# 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
# 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
# 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"
# 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"
Web app The Twelve-Factor App The methodologies for developing a modern web app Container Docker The Ultimate Docker Cheat Sheet | dockerlabs Docker commands A Practical Introduction to Container Terminology | Red Hat Developer
Jan 3, 2022目標 運作於 EC2 上 每台 VM 跑一個 Consul container 可以單台運作,也可以多台組 cluster VM 重開機會自動啟動 Consul container Steps 前置(每台 VM 都要做) mkdir -p $HOME/consul/config
Jul 23, 2020Install Docker cat > install-docker.sh <<EOF #!/bin/bash apt update apt -y install apt-transport-https ca-certificates curl software-properties-common curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable" apt update apt-cache policy docker-ce apt install docker-ce -y
Feb 25, 2020or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up