A complete Pulsar cluster is composed of Pulsar broker, necessary ZooKeeper and BookKeeper services. The specific deployment methods can be divided into two types, they are:
-
Standalone, all services are started on one host, easy to deploy, suitable for local development and testing, and can also be used in some production environments.
-
Cluster, the service is scattered on different hosts, the deployment is slightly complicated, but it has the characteristics of high availability, load balancing, etc. It is suitable for the production environment.
- Java 8
- Linux operating system
Download from Pulsar official website download page
or
Use the wget command to download:
$ wget https://archive.apache.org/dist/pulsar/pulsar-2.7.0/apache-pulsar-2.7.0-bin.tar.gzAfter downloading the compressed file, unzip it to "/data/projects/fate/common" and use the cd command to enter the target directory:
$ tar -xvfz apache-pulsar-2.7.0-bin.tar.gz -C /data/projects/fate/common
$ cd /data/projects/fate/common/apache-pulsar-2.7.0- Edit the "conf/standalone.conf" file and modify it as follows:
# Enable to delete inactive topic
brokerDeleteInactiveTopicsEnabled=true
# Setting time interval for scanning of inactive topic
brokerDeleteInactiveTopicsFrequencySeconds=36000
# Setting number of connection for replication
replicationConnectionsPerBroker=4
# Modify the frame size of bookkie to 128MB, the default size is 5MB
nettyMaxFrameSizeBytes=134217728
# Modify the size of the pulsar message capacity to 128MB, the default is 5MB
maxMessageSize=134217728
# Default per-topic backlog quota limit(-1 means no limit)
backlogQuotaDefaultLimitGB=-1For more details about the configuration, please refer to the file mentioned above.
- Edit the "conf/pulsar_env.sh" file and modify it as follows:
# Extra options to be passed to the jvm
PULSAR_MEM=${PULSAR_MEM:-"-Xms4g -Xmx4g -XX:MaxDirectMemorySize=8g"}- Start the pulsar service
$ bin/bin/pulsar-daemon start standalone -nssThe running log is in the logs directory under the pulsar software deployment directory .
- Stop the pulsar service
When the pulsar cluster is no longer needed, the following command can be used to stop it.
$ bin/pulsar-daemon stop standaloneWhen the data generated by the pulsar service is no longer used, the user can remove "apache-pulsar-2.7.0/data" directory.
For more information about the configuration of the standalone version of Pulsar, please refer to the official Pulsar document Set up a standalone Pulsar locally
For Pulsar service deployment in cluster mode, please refer to the official document Deploying a multi-cluster on bare metal, Among them, Deployment Configuration store can be skipped.