日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 综合教程 >内容正文

综合教程

kafka 系列一(windows 安装)

發布時間:2023/12/24 综合教程 25 生活家
生活随笔 收集整理的這篇文章主要介紹了 kafka 系列一(windows 安装) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

1.kafka 官網

  http://kafka.apache.org/ 點擊下載如下文件

2. 首先確保系統已經安裝了 java 環境 可以用dos命令 java -version 查看

3.將下載的kafka 解壓到對應的文件夾

 F:kafkakafka_src 此文件夾是我解壓的目錄

4.修改kafka 配置文件的日志地址默認是linux的地址,修改成windows

 

  1.修改zookeeper.properties

  

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
# 
#    http://www.apache.org/licenses/LICENSE-2.0
# 
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# the directory where the snapshot is stored.
#修改這里的日志文件地址
dataDir=F:kafkakafka_srczookeeper
# the port at which the clients will connect
clientPort=2181
# disable the per-ip limit on the number of connections since this is a non-production config
maxClientCnxns=0
# Disable the adminserver by default to avoid port conflicts.
# Set the port to something non-conflicting if choosing to enable this
admin.enableServer=false
# admin.serverPort=8080

  2.修改kafka 的 server.propertis

  

# A comma separated list of directories under which to store log files
#修改這里的文件地址
log.dirs=F:kafkakafka_srclogskafka-logs

5.開始啟動zookeeper 后面都使用windows 的powershell

  .inwindowszookeeper-server-start.bat .configzookeeper.properties

注意紅框處,否則會導致閃退,因為官方的文檔是linux的教程。windows 腳本用.bat,位置在 binwindows 下

6 啟動kafka

  .inwindowskafka-server-start.bat .configserver.properties

7.測試是否啟動成功

  創建一個主題

  .inwindowskafka-topics.bat --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1 --topic test

  查看主題

.inwindowskafka-topics.bat --list --bootstrap-server localhost:9092

8 環境變量設置,類似java 設置系統環境變量

  

9.查看環境變量是否配置成功

  在任意文件下執行kafka 的命令

C:UsersAdministrator>kafka-topics.bat --list --bootstrap-server localhost:9092

返回
test

  

總結

以上是生活随笔為你收集整理的kafka 系列一(windows 安装)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。