好吧,我似乎已经用BigInsights Image拍了我的第一个问题,不是一个大问题,而是需要考虑的事情。在我的Ambari浏览器服务页面上显示Kafka服务没有运行,我尝试了多次重启,但这似乎一直都失败了。所以我认为我最好再深入研究一下。在这种情况下,问题出在Ambari主服务器上,该服务器上运行的服务最多。 因此,首先要求行动是看Ambari是否没有正确拨打电话:
[root@master ~]# kafka
Usage: /usr/bin/kafka {start|stop|status|clean}
[root@master ~]# kafka status
Kafka is not running.
[root@master ~]# kafka start
Starting Kafka succeeded with PID=15815.
[root@master ~]# kafka status
Kafka is not running.
接下来我厌倦了一个干净的开始,而不是我认为它会有很大的不同,但可能是日志不允许它重新启动的问题:
[root@master ~]# kafka clean
Removed the Kafka PID file: /var/run/kafka/kafka.pid.
Removed the Kafka OUT file: /var/log/kafka/kafka.out.
Removed the Kafka ERR file: /var/log/kafka/kafka.err.
[root@master ~]# kafka status
Kafka is not running. No pid file found.
[root@master ~]# kafka start
Starting Kafka succeeded with PID=15875.
[root@master-01 ~]# kafka status
Kafka is not running.
答案 0 :(得分:1)
所以让我们仔细看看日志:
[root@master ~]# ls -ltr /var/log/kafka/
-<cut>-
-rw-r--r-- 1 kafka hadoop 6588 Aug 11 13:55 controller.log.2015-08-11-13
-rw-r--r-- 1 kafka hadoop 6000 Aug 11 13:59 server.log.2015-08-11-13
-rw-r--r-- 1 kafka hadoop 6588 Aug 11 14:55 controller.log
-rw-r--r-- 1 kafka hadoop 5700 Aug 11 14:56 server.log
-rw-r--r-- 1 root root 284 Aug 11 15:09 kafka.err
-rw-r--r-- 1 root root 522 Aug 11 15:09 kafka.out
-rw-r--r-- 1 kafka hadoop 707 Aug 11 15:09 kafkaServer-gc.log
让我们看一下错误和输出文件:
[root@master ~]# cat /var/log/kafka/kafka.err
OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000c5330000, 986513408, 0) failed; error='Cannot allocate memory' (errno=12)
OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000c5330000, 986513408, 0) failed; error='Cannot allocate memory' (errno=12)
[root@master ~]# cat /var/log/kafka/kafka.out
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 986513408 bytes for committing reserved memory.
# An error report file with more information is saved as:
# /root/hs_err_pid15875.log
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 986513408 bytes for committing reserved memory.
# An error report file with more information is saved as:
# /root/hs_err_pid16305.log
啊,这很奇怪,因为我要求为我的VM提供至少4GB的内存,请检查:
[root@master ~]# cat /proc/meminfo
MemTotal: 1922260 kB
MemFree: 278404 kB
Buffers: 8600 kB
Cached: 43384 kB
最好分配更多内存! 通常,您应该按照IBM支持页面的建议安装BigInsights的最小值为8GB,这样您就可以深入了解原因。即使在开始加载数据库和运行查询之前,至少有2GB用于运行系统上已安装的服务。