安装 Kafka 作为 windows 服务 [英] Install Kafka as windows service

查看:29
本文介绍了安装 Kafka 作为 windows 服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何安装和运行 Apache Kafka 作为 Windows 服务?现在我需要转到命令提示符并启动 zookeeper 和 kafka 服务器.有什么办法可以将 Apache Kafka 安装为 Windows 服务吗?

How can I install and run Apache Kafka as windows service? Right now I need to go to command prompt and start zookeeper and kafka server. Is there any way so that I can install Apache Kafka as Windows service?

我只看到下面的博客,但不知道调整 Windows 环境的设置"和以发布模式构建项目"是什么意思http://www.lukemerrett.com/2015/12/01/apache-kafka-windows-service-wrapper/

I saw only below blog but don't know what they mean by "Adjusts the settings for a Windows environment" and "Build the project in Release mode" http://www.lukemerrett.com/2015/12/01/apache-kafka-windows-service-wrapper/

谢谢!

推荐答案

执行以下中指定的所有先决条件和安装步骤:
在 Windows 操作系统上设置和运行 Apache Kafka

Perform all the pre-requisites and installation steps as specified in:
Setting Up and Running Apache Kafka on Windows OS

完成 C 部分第 6 步之前的所有步骤.

Complete all the steps till step 6 of section C.

(i) 使用 NSSM(一个免费的服务管理器)并在路径和参数中输入以下内容,为 ZooKeeper 创建一个 Windows 服务:
路径:\bin\windows\zookeeper-server-start.bat
参数:\config\zookeeper.properties

(i) Use NSSM (a FREE service manager) and enter the below in Path and Arguments, to create a Windows service for ZooKeeper:
Path: <ZooKeeper directory>\bin\windows\zookeeper-server-start.bat
Arguments: <ZooKeeper directory>\config\zookeeper.properties

(ii) 使用 NSSM(一个免费的服务管理器)并在路径和参数中输入以下内容,为 Kafka 创建一个 Windows 服务:
路径:\bin\windows\kafka-server-start.bat
参数:\config\kafka.properties

(ii) Use NSSM (a FREE service manager) and enter the below in Path and Arguments, to create a Windows service for Kafka:
Path: <Kafka directory>\bin\windows\kafka-server-start.bat
Arguments: <Kafka directory>\config\kafka.properties

提供一个ZooKeeper服务的依赖(在Kafka的NSSM设置中的Dependencies选项卡下),这样当你启动Kafka服务时,ZooKeeper服务会自动启动(如果它还没有运行).

Provide a dependency of ZooKeeper service (under the Dependencies tab in the NSSM setup of Kafka), so that when you startup Kafka service, ZooKeeper service is automatically started (if it isn't running already).

注意:请注意,ZooKeeper 与 Kafka 一起提供,启动和停止 ZooKeeper 服务的二进制文件位于同一个 \bin\windows\ 目录中.

NB: Please note that ZooKeeper ships with Kafka, and the binaries to start and stop the ZooKeeper service is found in the same <Kafka directory>\bin\windows\ directory.

希望它能解释!

这篇关于安装 Kafka 作为 windows 服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆