我搜索了几个小时,但仍然找不到它背后的原因。
以下是运行命令时得到的日志:
sudo bash -x /etc/init.d/elasticsearch start
日志:
+ PATH=/bin:/usr/bin:/sbin:/usr/sbin
+ NAME=elasticsearch
+ DESC='Elasticsearch Server'
+ DEFAULT=/etc/default/elasticsearch
++ id -u
+ '[' 0 -ne 0 ']'
+ . /lib/lsb/init-functions
+++ run-parts --lsbsysinit --list /lib/lsb/init-functions.d
++ for hook in '$(run-parts --lsbsysinit --list /lib/lsb/init-functions.d 2>/dev/null)'
++ '[' -r /lib/lsb/init-functions.d/01-upstart-lsb ']'
++ . /lib/lsb/init-functions.d/01-upstart-lsb
+++ unset UPSTART_SESSION
+++ _RC_SCRIPT=/etc/init.d/elasticsearch
+++ '[' -r /etc/init//etc/init.d/elasticsearch.conf ']'
+++ _UPSTART_JOB=elasticsearch
+++ '[' -r /etc/init/elasticsearch.conf ']'
++ for hook in '$(run-parts --lsbsysinit --list /lib/lsb/init-functions.d 2>/dev/null)'
++ '[' -r /lib/lsb/init-functions.d/20-left-info-blocks ']'
++ . /lib/lsb/init-functions.d/20-left-info-blocks
++ for hook in '$(run-parts --lsbsysinit --list /lib/lsb/init-functions.d 2>/dev/null)'
++ '[' -r /lib/lsb/init-functions.d/50-ubuntu-logging ']'
++ . /lib/lsb/init-functions.d/50-ubuntu-logging
+++ LOG_DAEMON_MSG=
++ FANCYTTY=
++ '[' -e /etc/lsb-base-logging.sh ']'
++ true
+ '[' -r /etc/default/rcS ']'
+ . /etc/default/rcS
++ UTC=yes
+ ES_USER=elasticsearch
+ ES_GROUP=elasticsearch
+ ES_HOME=/usr/share/elasticsearch
+ MAX_OPEN_FILES=65536
+ LOG_DIR=/var/log/elasticsearch
+ DATA_DIR=/var/lib/elasticsearch
+ CONF_DIR=/etc/elasticsearch
+ MAX_MAP_COUNT=262144
+ PID_DIR=/var/run/elasticsearch
+ '[' -f /etc/default/elasticsearch ']'
+ . /etc/default/elasticsearch
++ ES_STARTUP_SLEEP_TIME=5
+ '[' '!' -z '' ']'
+ PID_FILE=/var/run/elasticsearch/elasticsearch.pid
+ DAEMON=/usr/share/elasticsearch/bin/elasticsearch
+ DAEMON_OPTS='-d -p /var/run/elasticsearch/elasticsearch.pid --default.path.home=/usr/share/elasticsearch --default.path.logs=/var/log/elasticsearch --default.path.data=/var/lib/elasticsearch --default.path.conf=/etc/elasticsearch'
+ export ES_HEAP_SIZE
+ export ES_HEAP_NEWSIZE
+ export ES_DIRECT_SIZE
+ export ES_JAVA_OPTS
+ export ES_GC_LOG_FILE
+ export JAVA_HOME
+ export ES_INCLUDE
+ test -x /usr/share/elasticsearch/bin/elasticsearch
+ case "$1" in
+ checkJava
+ '[' -x /bin/java ']'
++ which java
+ JAVA=/usr/bin/java
+ '[' '!' -x /usr/bin/java ']'
+ '[' -n '' -a -z '' ']'
+ log_daemon_msg 'Starting Elasticsearch Server'
+ '[' -z 'Starting Elasticsearch Server' ']'
+ log_use_fancy_output
+ TPUT=/usr/bin/tput
+ EXPR=/usr/bin/expr
+ '[' -t 1 ']'
+ '[' xxterm '!=' x ']'
+ '[' xxterm '!=' xdumb ']'
+ '[' -x /usr/bin/tput ']'
+ '[' -x /usr/bin/expr ']'
+ /usr/bin/tput hpa 60
+ /usr/bin/tput setaf 1
+ '[' -z ']'
+ FANCYTTY=1
+ case "$FANCYTTY" in
+ true
+ /usr/bin/tput xenl
++ /usr/bin/tput cols
+ COLS=80
+ '[' 80 ']'
+ '[' 80 -gt 6 ']'
++ /usr/bin/expr 80 - 7
+ COL=73
+ log_use_plymouth
+ '[' n = y ']'
+ plymouth --ping
+ printf ' * Starting Elasticsearch Server '
* Starting Elasticsearch Server ++ /usr/bin/expr 80 - 1
+ /usr/bin/tput hpa 79
+ printf ' '
++ pidofproc -p /var/run/elasticsearch/elasticsearch.pid elasticsearch
++ local pidfile base status specified pid OPTIND
++ pidfile=
++ specified=
++ OPTIND=1
++ getopts p: opt
++ case "$opt" in
++ pidfile=/var/run/elasticsearch/elasticsearch.pid
++ specified=specified
++ getopts p: opt
++ shift 2
++ '[' 1 -ne 1 ']'
++ base=elasticsearch
++ '[' '!' specified ']'
++ '[' -n /var/run/elasticsearch/elasticsearch.pid -a -r /var/run/elasticsearch/elasticsearch.pid ']'
++ read pid
++ '[' -n '' ']'
++ '[' -n specified ']'
++ '[' -e /var/run/elasticsearch/elasticsearch.pid -a '!' -r /var/run/elasticsearch/elasticsearch.pid ']'
++ return 3
+ pid=
+ '[' -n '' ']'
+ mkdir -p /var/log/elasticsearch /var/lib/elasticsearch
+ chown elasticsearch:elasticsearch /var/log/elasticsearch /var/lib/elasticsearch
+ '[' -n /var/run/elasticsearch ']'
+ '[' '!' -e /var/run/elasticsearch ']'
+ '[' -n /var/run/elasticsearch/elasticsearch.pid ']'
+ '[' '!' -e /var/run/elasticsearch/elasticsearch.pid ']'
+ '[' -n 65536 ']'
+ ulimit -n 65536
+ '[' -n '' ']'
+ '[' -n 262144 -a -f /proc/sys/vm/max_map_count ']'
+ sysctl -q -w vm.max_map_count=262144
+ start-stop-daemon -d /usr/share/elasticsearch --start -b --user elasticsearch -c elasticsearch --pidfile /var/run/elasticsearch/elasticsearch.pid --exec /usr/share/elasticsearch/bin/elasticsearch -- -d -p /var/run/elasticsearch/elasticsearch.pid --default.path.home=/usr/share/elasticsearch --default.path.logs=/var/log/elasticsearch --default.path.data=/var/lib/elasticsearch --default.path.conf=/etc/elasticsearch
+ return=0
+ '[' 0 -eq 0 ']'
+ i=0
+ timeout=10
+ sleep 1
+ i=1
+ '[' 1 -gt 10 ']'
+ sleep 1
+ i=2
+ '[' 2 -gt 10 ']'
+ sleep 1
+ i=3
+ '[' 3 -gt 10 ']'
+ sleep 1
+ i=4
+ '[' 4 -gt 10 ']'
+ sleep 1
+ i=5
+ '[' 5 -gt 10 ']'
+ sleep 1
+ i=6
+ '[' 6 -gt 10 ']'
+ sleep 1
+ i=7
+ '[' 7 -gt 10 ']'
+ sleep 1
+ i=8
+ '[' 8 -gt 10 ']'
+ sleep 1
+ i=9
+ '[' 9 -gt 10 ']'
+ sleep 1
+ i=10
+ '[' 10 -gt 10 ']'
+ sleep 1
+ i=11
+ '[' 11 -gt 10 ']'
+ log_end_msg 1
+ '[' -z 1 ']'
+ '[' 73 ']'
+ '[' -x /usr/bin/tput ']'
+ log_use_plymouth
+ '[' n = y ']'
+ plymouth --ping
+ printf '\r'
+ /usr/bin/tput hpa 73
+ '[' 1 -eq 0 ']'
+ printf '['
[+ /usr/bin/tput setaf 1
+ printf fail
fail+ /usr/bin/tput op
+ echo ']'
]
+ return 1
+ exit 1
我使用弹性搜索版本2.4.1。 / var / log / elasticsearch
中没有日志我也尝试过跟随。
答案 0 :(得分:1)
错误的一个原因是java堆大小是否设置为高于可用系统内存
更新elastcsearch启动脚本以设置elasticsearch堆内存设置:
/etc/init.d/elasticsearch
ES_HEAP_SIZE=2g