windows10部署kafka並开机后后台自动启动

1.下载kafka

windows10部署kafka並开机后后台自动启动_第1张图片

 

2.配置zookeeper

2.1 修改配置文件

打开kafka_2.12-2.6.0\config\zookeeper.properties ,重新指定dataDir的路径,默认为Linux路径

2.2 编写启动脚本zookeeper-start.bat

G:\kafka_2.12-2.6.0\bin\windows\zookeeper-server-start.bat G:\kafka_2.12-2.6.0\config\zookeeper.properties

2.3 尝试下启动zookeeper

windows10部署kafka並开机后后台自动启动_第2张图片

 

3.配置kafka

3.1 修改配置文件

打开kafka_2.12-2.6.0\config\server.properties,修改listeners ,指定为具体的IP,例如

listeners=PLAINTEXT://192.168.10.123:9092

不然有可能出现连接不上的问题

windows10部署kafka並开机后后台自动启动_第3张图片

 

修改log.dirs 

windows10部署kafka並开机后后台自动启动_第4张图片

3.2 编写启动脚本kafka-start.bat

G:\kafka_2.12-2.6.0\bin\windows\kafka-server-start.bat G:\kafka_2.12-2.6.0\config\server.properties

3.3 尝试下启动kafka

windows10部署kafka並开机后后台自动启动_第5张图片

 

4.添加开机启动

运行shell:Common Startup 打开启动文件夹

windows10部署kafka並开机后后台自动启动_第6张图片

 

在里面创建脚本

zookeeper-start.vbs

createobject(“wscript.shell”).run"G:\\zookeeper-start.bat",o

kafka-start.vbs

createobject(“wscript.shell”).run"G:\\kafka-start.bat",o

 

 

然后试试重启就可以了

你可能感兴趣的:(kafka,windows)