1, the system: ubuntu
2, environment: jdk1.8
Deployment steps:
1, in the user directory create a folder, where the user as an example to seemmo
/home/seemmo/kafka
2, download kafka, zookeeper installation package to the next / home / seemmo / kafka
Links: https://pan.baidu.com/s/1zJ1MTLGGxNpJ7phfV_xg_g
extraction code: 7vqm
copy the contents of this open Baidu network disk phone App, the operation more convenient oh
3, extract the compressed kafka
4, the installation depends on the zookeeper zookeeper because kafka, so the first wave of this equipment
Put / home / seemmo / kafka down
5, the decompression zookeeper compressed, vim / etc / profile at the end of the additional profile
export ZOOKEEPER_HOME=/home/seemmo/kafka/zookeeper-3.4.12
6, zookeeper file into the folder, cd to the conf folder, the file zoo_sample.cfg file into zoo.cfg
7, go to the bin folder to see if the default port of 2181 has been launched after a run can confirm
8, into our file kafka_2.12-2.1.0 bin folder inside the folder, enter, it is amazing that need a zookeeper in the run, and then have to run here once kafka
nohup ./zookeeper-server-start.sh ../config/zookeeper.properties &
9, back to our kafka_2.12-2.1.0 the bin file folder, enter
nohup kafka-server-start.sh ../config/server.properties &
10, 9092 to see whether the port has occupied, you can confirm whether kafka have started successful
11, turned consumers and producers, into our kafka under the bin directory, open two terminals, each running
kafka-console-producer.sh --broker-list localhost:9092 --topic test
./kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic test
Enter the producer, whether consumers will observe output