【已解决】doris-manager-24.0.0升级doris时,配置文件中环境变量引起的问题

Viewed 76

版本:doris-manager-24.0.0
升级操作:doris2.1.4(使用doris-manager安装)升级到2.1.5
问题:升级过程,在【启动BE节点】环节报错,启动be失败,报错如下:

time="2024-07-24T17:53:06.455+08:00" level=error msg="failed to run command to start be node, failed to run serial command /service/doris/apache-doris-bin/be/bin/start_be.sh --daemon, exit status 1, output: The JAVA_HOME environment variable is not defined correctly\nThis environment variable is needed to run this program\nNB: JAVA_HOME should point to a JDK not a JRE\nYou can set it in be.conf\n"

问题分析:
java8是manager自己下载的,测试正常,fe.conf配置也正常

# Default to turn off aws sdk log, because aws sdk errors that need to be cared will be output through Doris logs
aws_log_level=0
## If you are not running in aws cloud, you can disable EC2 metadata
AWS_EC2_METADATA_DISABLED=true
be_port = 9060
webserver_port = 8040
heartbeat_service_port = 9050
brpc_port = 8060
storage_root_path = /service/doris/be_storage
priority_networks = 172.19.1.0/24
LOG_DIR = /service/doris/apache-doris-bin/be/log
sys_log_dir = /service/doris/apache-doris-bin/be/log
be_node_role = mix
# JAVA_HOME = /service/doris/apache-doris-bin/java8
lower_case_table_names = 0
JAVA_HOME = /service/doris/apache-doris-bin/java8
~                                                                                                                                                                                                    
"be/conf/be.conf" 110L, 4729B                           

问题解决
在be.conf文件末尾增加一个空行,就可以启动成功了。
doris-manager在升级时,会注释掉原来的JAVA_HOME然后在文件末尾增加JAVA_HOME,不知道为什么JAVA_HOME出现在最后一行会导致JAVA_HOME should point to a JDK not a JRE\nYou can set it in be.conf

关键日志如下:

time="2024-07-24T17:52:42.731+08:00" level=debug msg="be conf string: # Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# "License"); you may not use this file except in compliance\n# with the License. You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n# KIND, either express or implied. See the License for the\n# specific language governing permissions and limitations\n# under the License.\n\nCUR_DATE=date +%Y%m%d-%H%M%S\n\n# Log dir\n# LOG_DIR="${DORIS_HOME}/log/"\n\nJAVA_OPTS="-Xmx1024m -DlogPath=$LOG_DIR/jni.log -Xloggc:$DORIS_HOME/log/be.gc.log.$CUR_DATE -Djavax.security.auth.useSubjectCredsOnly=false -Dsun.security.krb5.debug=true -Dsun.java.command=DorisBE -XX:-CriticalJNINatives"\n\n# For jdk 9+, this JAVA_OPTS will be used as default JVM options\nJAVA_OPTS_FOR_JDK_9="-Xmx1024m -DlogPath=$DORIS_HOME/log/jni.log -Xlog:gc:$LOG_DIR/be.gc.log.$CUR_DATE -Djavax.security.auth.useSubjectCredsOnly=false -Dsun.security.krb5.debug=true -Dsun.java.command=DorisBE -XX:-CriticalJNINatives"\n\n# For jdk 17+, this JAVA_OPTS will be used as default JVM options\nJAVA_OPTS_FOR_JDK_17="-Xmx1024m -DlogPath=$LOG_DIR/jni.log -Xlog:gc:$LOG_DIR/be.gc.log.$CUR_DATE -Djavax.security.auth.useSubjectCredsOnly=false -Dsun.security.krb5.debug=true -Dsun.java.command=DorisBE -XX:-CriticalJNINatives --add-opens=java.base/java.net=ALL-UNNAMED"\n\n# since 1.2, the JAVA_HOME need to be set to run BE process.\n# JAVA_HOME=/path/to/jdk/\n\n# https://github.com/apache/doris/blob/master/docs/zh-CN/community/developer-guide/debug-tool.md#jemalloc-heap-profile\n# https://jemalloc.net/jemalloc.3.html\nJEMALLOC_CONF="percpu_arena:percpu,background_thread:true,metadata_thp:auto,muzzy_decay_ms:15000,dirty_decay_ms:15000,oversize_threshold:0,prof:false,lg_prof_interval:32,lg_prof_sample:19,prof_gdump:false,prof_accum:false,prof_leak:false,prof_final:false"\nJEMALLOC_PROF_PRFIX=""\n\n# ports for admin, web, heartbeat service \n# be_port = 9060\n# webserver_port = 8040\n# heartbeat_service_port = 9050\n# brpc_port = 8060\narrow_flight_sql_port = -1\n\n# HTTPS configures\nenable_https = false\n# path of certificate in PEM format.\nssl_certificate_path = "$DORIS_HOME/conf/cert.pem"\n# path of private key in PEM format.\nssl_private_key_path = "$DORIS_HOME/conf/key.pem"\n\n\n# Choose one if there are more than one ip except loopback address. \n# Note that there should at most one ip match this list.\n# If no ip match this rule, will choose one randomly.\n# use CIDR format, e.g. 10.10.10.0/24 or IP format, e.g. 10.10.10.1\n# Default value is empty.\n# priority_networks = 10.10.10.0/24;192.168.0.0/16\n\n# data root path, separate by ';'\n# You can specify the storage type for each root path, HDD (cold data) or SSD (hot data)\n# eg:\n# storage_root_path = /home/disk1/doris;/home/disk2/doris;/home/disk2/doris\n# storage_root_path = /home/disk1/doris,medium:SSD;/home/disk2/doris,medium:SSD;/home/disk2/doris,medium:HDD\n# /home/disk2/doris,medium:HDD(default)\n# \n# you also can specify the properties by setting ':', separate by ','\n# property 'medium' has a higher priority than the extension of path\n#\n# Default value is ${DORIS_HOME}/storage, you should create it by hand.\n# storage_root_path = ${DORIS_HOME}/storage\n\n# Default dirs to put jdbc drivers,default value is ${DORIS_HOME}/jdbc_drivers\n# jdbc_drivers_dir = ${DORIS_HOME}/jdbc_drivers\n\n# Advanced configurations\n# INFO, WARNING, ERROR, FATAL\nsys_log_level = INFO\n# sys_log_roll_mode = SIZE-MB-1024\n# sys_log_roll_num = 10\n# sys_log_verbose_modules = *\n# log_buffer_level = -1\n# palo_cgroups \n\n# aws sdk log level\n# Off = 0,\n# Fatal = 1,\n# Error = 2,\n# Warn = 3,\n# Info = 4,\n# Debug = 5,\n# Trace = 6\n# Default to turn off aws sdk log, because aws sdk errors that need to be cared will be output through Doris logs\naws_log_level=0\n## If you are not running in aws cloud, you can disable EC2 metadata\nAWS_EC2_METADATA_DISABLED=true\nbe_port = 9060\nwebserver_port = 8040\nheartbeat_service_port = 9050\nbrpc_port = 8060\nstorage_root_path = /service/doris/be_storage\npriority_networks = 172.19.1.0/24\nLOG_DIR = /service/doris/apache-doris-bin/be/log\nsys_log_dir = /service/doris/apache-doris-bin/be/log\nbe_node_role = mix\n# JAVA_HOME = /service/doris/apache-doris-bin/java8\nlower_case_table_names = 0\nJAVA_HOME = /service/doris/apache-doris-bin/java8"

1 Answers

【问题状态】已解决
【问题处理】manager在启动be的时候报错JAVA_HOME should point to a JDK not a JRE\nYou can set it in be.conf\n"。手动去编辑了下 be.conf文件就ok了(没修改内容,就是末尾追加了一个空行)