Basic environment CentOS-7-x86_64-DVD-1908
1. Installation Configuration jdk
download the package and extract the configuration environment variable
jdk-8u231-linux-x64.tar.gz
configure the environment variables to modify the file vi / etc / profile
tail added
Export the JAVA_HOME = / GCL / jdk1.8.0_231
Export the JRE_HOME = $ the JAVA_HOME} {/ JRE
Export the CLASSPATH =:. $ {the JAVA_HOME} / lib: $ {} the JRE_HOME / lib
Export the PATH = $ {the JAVA_HOME} / bin: $ the PATH
configuration effective source / etc / profile
after the test successfully entered the java -version configuration step
2. build a zookeeper
download the package and extract the
apache-zookeeper-3.5.5-bin.tar.gz
copy profile
[root @ localhost conf] # cp zoo_sample.cfg zoo.cfg
Edit the file
[root @ localhost conf] # vi zoo.cfg
dataDir=/gcl/apache-zookeeper-3.5.5-bin/data
dataLogDir=/gcl/apache-zookeeper-3.5.5-bin/log
To ensure that the above configuration added
Commonly used commands
SH zkServer.sh Start
SH zkServer.sh Status
SH zkServer.sh STOP
After a successful start to the next step
Failed to start to start the logs directory to see the cause of failure, and then resolve
[root @ localhost logs] # tail -f zookeeper-root-server-localhost.localdomain.out
3. build kafka
download the package and extract
kafka_2.11-2.3.1.tgz
modify the configuration of
[the root @ localhost config] # VI the server.properties
Port = 9092
host.name = 192.168.6.114
log.dirs=/gcl/kafka_2.11-2.3.1/kafka-logs
zookeeper.connect=localhost:2181
bin/kafka-server-start.sh config/server.properties
Stop
./bin/kafka-server-stop.sh
Create a theme
./bin/kafka-topics.sh --create --zookeeper localhost: 2181 --replication- factor 1 --partitions 1 --topic TEST_TOPIC
Note: install the boot configuration zookeeper
Note: Error
advertised.listeners = PLAINTEXT: //192.168.6.92: 9092
4. command kafka
启动
bin/kafka-server-start.sh config/server.properties
Stop
./bin/kafka-server-stop.sh
Create a theme
./bin/kafka-topics.sh --create --zookeeper localhost: 2181 --replication- factor 1 --partitions 1 --topic TEST_TOPIC
View topic
bin / kafka-topics.sh --list --zookeeper localhost: 2181
Run
./bin/kafka-server-start.sh ./config/server.properties