如何在分布式模式下本地启动drillbit?

时间:2016-11-09 11:45:31

标签: apache-drill

我下载了Apache Drill v1.8,编辑了conf/drill-override.conf以进行以下更改:

drill.exec: {
  cluster-id: "drillbits1",
  zk.connect: "10.178.23.140:2181,10.178.23.140:2182,10.178.23.140:2183,10.178.23.140:2184"
}

.. zookeeper集群实际上是由同一个机器上启动的4个Zookeeper实例组成的,我试图开始钻取。 (即我只使用一台机器用于Apache Drill和Zookeeper的集群,机器的IP 10.178.23.140

所以我一直收到这个错误:

Exception in thread "main" org.apache.drill.exec.exception.DrillbitStartupException: Failure during initial startup of Drillbit.
    at org.apache.drill.exec.server.Drillbit.start(Drillbit.java:295)
    at org.apache.drill.exec.server.Drillbit.start(Drillbit.java:271)
    at org.apache.drill.exec.server.Drillbit.main(Drillbit.java:267)
Caused by: org.apache.drill.exec.exception.DrillbitStartupException: Drillbit is disallowed to bind to loopback address in distributed mode.
    at org.apache.drill.exec.service.ServiceEngine.checkLoopbackAddress(ServiceEngine.java:186)
    at org.apache.drill.exec.service.ServiceEngine.start(ServiceEngine.java:146)
    at org.apache.drill.exec.server.Drillbit.run(Drillbit.java:119)
    at org.apache.drill.exec.server.Drillbit.start(Drillbit.java:291)
    ... 2 more

为什么drillbit会抱怨绑定到环回地址?!

  1. 我没有为钻头配置一个IP来绑定!
  2. 既然我在我的机器上启动了钻头进程,我的机器会尝试绑定哪些其他IP?!

1 个答案:

答案 0 :(得分:3)

问题是我的 / etc / hosts 文件有此条目

127.0.1.1   mgelbana-machine

这使我的主机名可解析为环回地址。要解决此问题,您可以执行以下任一操作

  • 删除此行解决了我的问题。
  • 将我的主机名解析为非环回IP地址。

Source

private void checkLoopbackAddress(String address) throws DrillbitStartupException, UnknownHostException {
  if (isDistributedMode && InetAddress.getByName(address).isLoopbackAddress()) {
    throw new DrillbitStartupException("Drillbit is disallowed to bind to loopback address in distributed mode.");
  }
}

Drill拒绝在绑定到环回地址时启动的原因是differentiate between Drill nodes registered in Zookeeper.