Elasticsearch 无法在 Ubuntu 20.04 中启动服务
Elasticsearch Failed to start service in Ubuntu 20.04
(我是弹性搜索新手)
我想将弹性搜索作为服务启动 (sudo systemctl start elasticsearch),但它不会启动,并抛出如下图所示的错误
所以在那之后,我在 /var/log/elasticsearch/my-application.log
浏览了 elasticsearch 日志文件,在那里我发现了一些超出我范围的问题,下面附加的错误日志文件是
https://filebin.net/ca3a5l67t2hqcexd
到目前为止我已经尝试过的代码
sudo apt-cache search openjdk
sudo apt-get install openjdk-11-jre openjdk-11-jdk
java -version (openjdk 14.0.1 2020-04-14 OpenJDK Runtime Environment (build 14.0.1+7-Ubuntu-1ubuntu1) OpenJDK 64-Bit Server VM (build 14.0.1+7-Ubuntu-1ubuntu1, mixed mode, sharing))
sudo gedit /etc/environment
JAVA_HOME="/usr/lib/jvm/java-14-openjdk-amd64"
echo $JAVA_HOME (/usr/lib/jvm/java-14-openjdk-amd64)
curl -fsSL https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add - (OK)
echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee /etc/apt/sources.list.d/elastic-7.x.list - (deb https://artifacts.elastic.co/packages/7.x/apt stable main)
sudo apt-get update && sudo apt-get install elasticsearch
sudo gedit /etc/elasticsearch/elasticsearch.yml
overwritted in yml file of elasticsearch
(cluster.name: my-application
node.name: magentocom
network.publish.host: localhost
discovery.seed_hosts: []
network.host: 127.0.0.1
http.port: 9200
cluster.initial_master_nodes: 127.0.0.1)
sudo systemctl start elasticsearch
我也按照建议的答案给予了许可,但仍然没有成功:
任何帮助将不胜感激!
由于您是 运行 您在本地的 elasticsearch,我建议将配置保持在最低限度,并且不要使用像 official network doc 中提到的 network.publish_host
这样的高级网络设置。
由于您的错误日志中充满了 network.publish_host
,我建议您删除 elasticsearch.yml
中的所有设置并保持以下设置并重新启动 ES。
discovery.type: single-node
http.port: 9200
有关single-node
和启动问题的更多信息,请参考我的。
只需尝试将 network.publish.host
替换为 network.publish_host
仅适用于虚拟机用户。 (虚拟盒子Ubuntu20我有同样的问题)
已替换
network.host: 192.168.0.1
和
network.host: 127.0.0.1
这个(可选)没有下面也有效
discovery.type: single-node
(我是弹性搜索新手)
我想将弹性搜索作为服务启动 (sudo systemctl start elasticsearch),但它不会启动,并抛出如下图所示的错误
所以在那之后,我在 /var/log/elasticsearch/my-application.log
浏览了 elasticsearch 日志文件,在那里我发现了一些超出我范围的问题,下面附加的错误日志文件是
https://filebin.net/ca3a5l67t2hqcexd
到目前为止我已经尝试过的代码
sudo apt-cache search openjdk
sudo apt-get install openjdk-11-jre openjdk-11-jdk
java -version (openjdk 14.0.1 2020-04-14 OpenJDK Runtime Environment (build 14.0.1+7-Ubuntu-1ubuntu1) OpenJDK 64-Bit Server VM (build 14.0.1+7-Ubuntu-1ubuntu1, mixed mode, sharing))
sudo gedit /etc/environment
JAVA_HOME="/usr/lib/jvm/java-14-openjdk-amd64"
echo $JAVA_HOME (/usr/lib/jvm/java-14-openjdk-amd64)
curl -fsSL https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add - (OK)
echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee /etc/apt/sources.list.d/elastic-7.x.list - (deb https://artifacts.elastic.co/packages/7.x/apt stable main)
sudo apt-get update && sudo apt-get install elasticsearch
sudo gedit /etc/elasticsearch/elasticsearch.yml
overwritted in yml file of elasticsearch
(cluster.name: my-application
node.name: magentocom
network.publish.host: localhost
discovery.seed_hosts: []
network.host: 127.0.0.1
http.port: 9200
cluster.initial_master_nodes: 127.0.0.1)
sudo systemctl start elasticsearch
我也按照建议的答案给予了许可,但仍然没有成功:
任何帮助将不胜感激!
由于您是 运行 您在本地的 elasticsearch,我建议将配置保持在最低限度,并且不要使用像 official network doc 中提到的 network.publish_host
这样的高级网络设置。
由于您的错误日志中充满了 network.publish_host
,我建议您删除 elasticsearch.yml
中的所有设置并保持以下设置并重新启动 ES。
discovery.type: single-node
http.port: 9200
有关single-node
和启动问题的更多信息,请参考我的
只需尝试将 network.publish.host
替换为 network.publish_host
仅适用于虚拟机用户。 (虚拟盒子Ubuntu20我有同样的问题)
已替换
network.host: 192.168.0.1
和
network.host: 127.0.0.1
这个(可选)没有下面也有效
discovery.type: single-node