sudo apt-get update sudo apt-get install default-jdk
wget https://archive.apache.org/dist/zookeeper/zookeeper-3.4.14/zookeeper-3.4.14.tar.gz tar -xvf zookeeper-3.4.14.tar.gz cd zookeeper-3.4.14 ./configure make sudo make install
/etc/zookeeper/conf/zoo.cfg
文件,并添加以下内容:
sudo mkdir /var/lib/zookeeper sudo chown zookeeper:zookeeper /var/lib/zookeeper
启动ZooKeeper:
dataDir=/var/lib/zookeeper clientPort=2181
sudo service zookeeper start
编辑/etc/kafka/server.properties
wget https://archive.apache.org/dist/kafka/2.8.0/kafka_2.13-2.8.0.tgz tar -xvf kafka_2.13-2.8.0.tgz cd kafka_2.13-2.8.0
broker.id=0 listeners=PLAINTEXT://:9092 zookeeper.connect=localhost:2181
./bin/kafka-server-start.sh config/server.properties
./bin/kafka-topics.sh --create --topic test --partitions 1 --replication-factor 1
./bin/kafka-console-producer.sh --topic test
Atas ialah kandungan terperinci Pasang dan mulakan dengan cepat dengan Kafka dalam Linux: panduan langkah demi langkah. Untuk maklumat lanjut, sila ikut artikel berkaitan lain di laman web China PHP!