您好,登錄后才能下訂單哦!
本篇內容主要講解“kafka啟動報錯怎么解決”,感興趣的朋友不妨來看看。本文介紹的方法操作簡單快捷,實用性強。下面就讓小編來帶大家學習“kafka啟動報錯怎么解決”吧!
kafka啟動過程報錯,配置沒有問題,這就懵了!!
Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000c0130000, 986513408, 0) failed; error='Cannot allocate memory' (errno=12)
說是內存不足,沒辦法,請教同學之后了解到kafka默認內存是1g,然后直接vim為100m就好了,具體就是:
{$KAFKA_HOME}/bin下,直接
vim kafka-server-start.sh
然后更改其中的export KAFKA_HEAP_OPTS="-Xmx1G -Xms1G"
為export KAFKA_HEAP_OPTS="-Xmx100m -Xms100m"
看圖:
#!/bin/bash # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License.
if [ $# -lt 1 ]; then echo "USAGE: $0 [-daemon] server.properties" exit 1 fi base_dir=$(dirname $0) export KAFKA_LOG4J_OPTS="-Dlog4j.configuration=file:$base_dir/../config/log4j.properties" export KAFKA_HEAP_OPTS="-Xmx100m -Xms100m"
EXTRA_ARGS="-name kafkaServer -loggc"
COMMAND=$1 case $COMMAND in -daemon) EXTRA_ARGS="-daemon "$EXTRA_ARGS shift ;; *) ;; esac
exec $base_dir/kafka-run-class.sh $EXTRA_ARGS kafka.Kafka $@
到此,相信大家對“kafka啟動報錯怎么解決”有了更深的了解,不妨來實際操作一番吧!這里是億速云網站,更多相關內容可以進入相關頻道進行查詢,關注我們,繼續學習!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。