Exception in thread "main" ElasticsearchParseException[malformed, expected settings to start with 'object', instead was [VALUE_STRING]]
报错信息
2023-04-06 15:40:50,427 main ERROR No Log4j 2 configuration file found. Using default configuration (logging only errors to the console), or user programmatically provided configurations. Set system property 'log4j2.debug' to show Log4j 2 internal initialization logging. See https://logging.apache.org/log4j/2.x/manual/configuration.html for instructions on how to configure Log4j 2
Exception in thread "main" ElasticsearchParseException[malformed, expected settings to start with 'object', instead was [VALUE_STRING]]
应该是缺少Log4j2文件找不到,所以通过yum安装一下
yum install -y log4j
安装好了之后再次运行,可以看到端口号已经展示出来了,但是访问elasticsearch后台依旧报错,还是这个错误信息
看起来并不像是log4j的问题
解决方式
我之前是这么运行的,很遗憾我找不出哪里有问题文章来源:https://www.toymoban.com/news/detail-725806.html
docker run --name elasticsearch -p 9200:9200 -p 9300:9300 \
-e "discovery.type=single-node" \
-e ES_JAVA_OPTS="-Xms512m -Xmx512m" \
-v /mydata/elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml \
-v /mydata/elasticsearch/data/:/usr/share/elasticsearch/data \
-v /mydata/elasticsearch/plugins:/usr/share/elasticsearch/plugins \
-d elasticsearch
后来我换了黑马的elasticsearch的安装教程,用的是下面这一段,启动没问题,最终也正常连接上了elasticsearch,绷不住了文章来源地址https://www.toymoban.com/news/detail-725806.html
docker run -d \
--name es \
-e "ES_JAVA_OPTS=-Xms512m -Xmx512m" \
-e "discovery.type=single-node" \
-v es-data:/usr/share/elasticsearch/data \
-v es-plugins:/usr/share/elasticsearch/plugins \
--privileged \
--network es-net \
-p 9200:9200 \
-p 9300:9300 \
elasticsearch
到了这里,关于docker安装elasticsearch报错 main ERROR No Log4j 2 configuration file found. Using default configuration的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!