-
Notifications
You must be signed in to change notification settings - Fork 323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
consumer的问题 #54
Comments
配置下log4j.properties,在conf下有个样例。将日志输出都贴在下面。 |
2016-11-03 14:25:39.292 INFO ZookeeperConsumerConnector - Connecting to zookeeper instance at 192.168.1.97:2181,192.168.1.98:2181,192.168.1.96:2181 |
还有用给的java demo 发送消息也报错了 |
java.nio.channels.UnresolvedAddressException 无法解析ZK1的域名,解决方法(任选一种):
|
hosts 文件下我已经配置了 还是一样的错误 |
需要在 producer/consumer出设置,目前是 producer和consumer服务解析hostname |
但是我第一篇安装的时候并没有报错啊server.properties中的hostname参数为本机的IP地址 我都没有设置 |
如果是在一台机器上执行的话,hosts文件会解析的,跨机器如果没有域名就需要ip地址 |
不在一台机器上 zookeeper 集群在VMware vSphere 搭建的 。然后本地win8系统 的eclipse 跑的 java demo |
java有DNS缓存,如果eclipse的java程序hosts没有生效,需要重启下eclispe。 另外,如果服务器(broker)没有域名的话,建议使用ip地址,这样每一个producer/consumer都无需设置hosts文件 |
因为后面还要在这三台虚拟机上搭建hadoop 和hbase 所以hosts 文件就配置了域名解析 |
eclipse重启之后还是报同样的错误 |
eclipse这台机器上ping ZK1 |
[hadoop@ZK1 bin]$ ./consumer-console.sh --zookeeper 192.168.1.97:2181,192.168.1.96:2181,192.168.1.98:2181 --topic ly --from-beginning
log4j:WARN No appenders could be found for logger (com.sohu.jafka.consumer.ZookeeperConsumerConnector).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Exception in thread "main" java.lang.NullPointerException
at com.github.zkclient.ZkClient.deleteRecursive(ZkClient.java:442)
at com.sohu.jafka.console.ConsoleConsumer.tryCleanupZookeeper(ConsoleConsumer.java:174)
at com.sohu.jafka.console.ConsoleConsumer.main(ConsoleConsumer.java:106)
消费者接受消息为什么会报错啊,我用给的java demo 是可以接收的 ,但是这个却不可以。求解
The text was updated successfully, but these errors were encountered: