AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 664593
Accepted
Greg Dubicki
Greg Dubicki
Asked: 2015-02-04 04:14:28 +0800 CST2015-02-04 04:14:28 +0800 CST 2015-02-04 04:14:28 +0800 CST

Apache Kafka 0.8.1.1 干净关闭不起作用

  • 772

我有一个:

  • 使用默认配置(server.properties等)从源安装的 Apache Kafka(2.9.2-0.8.1.1)的单个实例,
  • Zookeeper (3.4.5+dfsg-2) 单机,从包中安装

..在 Ubuntu 14.04 LTS 主机上运行,​​名称为hostname1.


我尝试干净地关闭 Kafka,但我不能。


我尝试了两种方法:

  • 发送 SIGINT - 但 Kafka 只是忽略它(没有提到在任何日志中接收信号,继续运行)[SIGTERM 有效,但这不是重点]

  • 使用受控关机工具- 但它失败了以下..

..堆栈跟踪:

[2015-02-03 12:55:49,461] ERROR Operation failed due to controller failure (kafka.admin.ShutdownBroker$)
java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: hostname1; nested exception is:
        java.net.ConnectException: Connection refused]
        at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:369)
        at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:268)
        at kafka.admin.ShutdownBroker$.kafka$admin$ShutdownBroker$$invokeShutdown(ShutdownBroker.scala:56)
        at kafka.admin.ShutdownBroker$.main(ShutdownBroker.scala:109)
        at kafka.admin.ShutdownBroker.main(ShutdownBroker.scala)
Caused by: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: hostname1; nested exception is:
        java.net.ConnectException: Connection refused]
        at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:118)
        at com.sun.jndi.toolkit.url.GenericURLContext.lookup(GenericURLContext.java:203)
        at javax.naming.InitialContext.lookup(InitialContext.java:411)
        at javax.management.remote.rmi.RMIConnector.findRMIServerJNDI(RMIConnector.java:1929)
        at javax.management.remote.rmi.RMIConnector.findRMIServer(RMIConnector.java:1896)
        at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:286)
        ... 4 more
Caused by: java.rmi.ConnectException: Connection refused to host: hostname1; nested exception is:
        java.net.ConnectException: Connection refused
        at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:619)
        at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:216)
        at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202)
        at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:341)
        at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
        at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:114)
        ... 9 more
Caused by: java.net.ConnectException: Connection refused
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
        at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
        at java.net.Socket.connect(Socket.java:579)
        at java.net.Socket.connect(Socket.java:528)
        at java.net.Socket.<init>(Socket.java:425)
        at java.net.Socket.<init>(Socket.java:208)
        at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:40)
        at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:147)
        at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:613)
        ... 14 more 
apache-2.2
  • 2 2 个回答
  • 1517 Views

2 个回答

  • Voted
  1. Best Answer
    MaasSql
    2015-03-14T10:48:33+08:002015-03-14T10:48:33+08:00

    对于 0.8.1.1 这个工具:

    • 不能开箱即用,
    • 不再需要。

    引用 “受控关闭工具似乎无法开箱即用”的 Kafka JIRA 问题:

    我们甚至不再需要这个工具了吗?当前受控关闭是通过配置启用的,并在 Kafka 服务器的 kill -15 期间自动启动。我几乎认为我们可以摆脱一个工具来控制关机。


    这是我最终放入的内容config/server.properties:

    controlled.shutdown.enable=true
    controlled.shutdown.max.retries=3
    controlled.shutdown.retry.backoff.ms=5000
    
    • 2
  2. Greg Dubicki
    2015-03-15T08:20:44+08:002015-03-15T08:20:44+08:00

    首先是我使用了错误的信号。我应该使用 SIGTERM (15) 而不是 SIGINT (2)。


    其次,正如@MaasSql 所指出的,您必须在 Kafka 0.8.1.1 中明确打开受控关闭。

    (对于 0.8.2+,您不必这样做 -默认情况下已启用。)

    • 0

相关问题

  • Apache Django Mod_Wsgi - 自动重新加载应用程序

  • Apache:对多个虚拟主机使用相同的目录指令

  • Apache 上的子域不工作 - 找不到服务器

  • PHP 作为 CGI 还是 Apache 模块?

  • 避免将某些丢失的文件记录到 Apache2 错误日志中

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve