1, Download and install
go to https://Download the latest version of Maven at maven.apache.org/download.cgi
2, Custom storage directory
Extract the file to D:\Program Files\Apache\maven directory
3, Environment variable configuration
- New environment variable MAVEN_HOME, assignment D:\Program Files\Apache\maven
2. Edit the environment variable Path and add% MAVEN_HOME%\bin
4, Check whether the installation is successful through the DOS command
redis installation and deployment1, Download installation package
- official https://redis.io/download Download address
Windows is not supported (but Redis project does not officially support windows. However, Microsoft open technology team develops and maintains this windows port for Win64) - Windows download address (Microsoft's GitHub address)
https://github.com/MSOpenTech/redis/releases
2, Environment variable configuration
3, Start the server and client
-
Method 1: in the directory, double-click redis-server.exe to start the service, and then double-click redis-cli.exe to start the client
-
Method 2: copy a redis.windows.conf file to the DOS command user, enter redis-server.exe redis.windows.conf in cmd to start the service
4, Is the verification successful
- After the server is started successfully, there is no need to close it. Reopen a cmd window and enter the redis-cli.exe -h 127.0.0.1 -p 6379 command
- Enter the command set myKey abc
- Enter the command get myKey
To install Kafka, you need to install Zookeeper first
Zookeeper configuration
1, Install java jdk and configure environment variables
2, Download and configure Zookeeper
- Download the installation package: http://zookeeper.apache.org/releases.html#download
- Unzip and enter the ZooKeeper directory, such as D:\Kafka\zookeeper-3.4.9\conf
- Rename "zoo_sample.cfg" to "zoo.cfg"
- Open "zoo.cfg" to find and edit dataDir = D: \ Kafka \ zookeeper-3.4.9 \ TMP (must be separated by \)
- Add system variable: ZOOKEEPER_HOME=D:\Kafka\zookeeper-3.4.9
- Edit the path system variable and add the path:% ZOOKEEPER_HOME%\bin
- Modify the default Zookeeper port (default port 2181) in the zoo.cfg file
- Open a new cmd, enter "zkServer" and run Zookeeper
- There may be a startup error prompt "ZooKeeper audit is disabled" when running due to version problems
- Add "- Dzookeeper.audit.enable=true" in zkServer.cmd configuration file
- The command line prompts "ZooKeeper audit is enabled" as follows: it indicates that the local Zookeeper is started successfully
- Note: do not close the ZooKeeper startup window
Kafka installation and configuration
- Download Kafka package download address
https://archive.apache.org/dist/kafka/
- Unzip and enter the Kafka directory, find the config directory, and open the file server.properties
- Locate and edit the log.dirs path
log.dirs=D:\Program Files\kafka\kafka-logs
- Edit service port
zookeeper.connect=localhost:2181
5. Execute the command to start kafka service
.\bin\windows\kafka-server-start.bat .\config\server.properties
- Startup error message:
ERROR Disk error while writing log start offsets checkpoint in directory
It's been a long time. The root cause is that the version installation is too high. I installed kafka_2.12-3.0.0 changed to kafka_2.12-3.8.0 like other configuration methods, execute the command again successfully
.\bin\windows\kafka-server-start.bat .\config\server.properties
7. Create a topic named test and enter the command
.\bin\windows\kafka-topics.bat --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test
8. The query subject input command is as follows:
.\bin\windows\kafka-topics.bat --list --zookeeper localhost:2181
9. Create a producer and enter a command
.\bin\windows\kafka-console-producer.bat --broker-list localhost:9092 --topic test
input: Pytest
10. Create a consumer and enter a command
.\bin\windows\kafka-console-consumer.bat --bootstrap-server localhost:9092 --topic test --from-beginning
- Write messages to the producer window, and the consumer window can also receive messages synchronously
- Query topic configuration information
.\bin\windows\kafka-topics.bat --describe --zookeeper localhost:2181 --topic test
Kafka installation configuration summary
- Open a new cmd and enter "zkServer" to start the zookeeper service without shutting it down
- kafka service starts without closing the page
.\bin\windows\kafka-server-start.bat .\config\server.properties
3. Create topic test topic kafka, and do not close the page successfully
.\bin\windows\kafka-topics.bat --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic Pytest
4. Query subject input command
.\bin\windows\kafka-topics.bat --list --zookeeper localhost:2181
5. Create a producer and generate a message without closing the page
.\bin\windows\kafka-console-producer.bat --broker-list localhost:9092 --topic Pytest
6. Create a consumer to receive messages without closing the page
.\bin\windows\kafka-console-consumer.bat --bootstrap-server localhost:9092 --topic Pytest --from-beginning
7. The producer sends the information again and synchronizes it to the consumer
8. Query topic configuration information
.\bin\windows\kafka-topics.bat --describe --zookeeper localhost:2181 --topic Pytest
9. Two topics are found
.\bin\windows\kafka-topics.bat --list --zookeeper localhost:2181
10. Deleting the topic test is only marked for deletion
.\bin\windows\kafka-topics.bat kafka.admin.DeleteTopicCommand --zookeeper localhost:2181 --delete --topic test