ElasticSearch7 kibana centos7 安装与配置修改 设置外网访问失败

elasticsearch外网访问9200端口失败,bootstrap checks failed,the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts,
discovery.seed_providers, cluster.initial_master_nodes] must be configured

Linux安装ElasticSearch,修改配置文件elasticsearch.yml 后启动失败。

  • CentOS Linux release 7.5
  • ElasticSearch version 7.3.0
  • Java openjdk version 1.8.0_222

我的设置:

vim /etc/elasticsearch/elasticsearch.yml
# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
network.host: 0.0.0.0
#

查看日志发现 (npm 安装elasticsearch 日志路径 /var/log/elasticsearch)

[ERROR][o.e.b.Bootstrap] [localhost.localdomain] node validation exception
[1] bootstrap checks failed
[1]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts,
discovery.seed_providers, cluster.initial_master_nodes] must be configured

翻译过来就是,在discovery.seed_hosts,discovery.seed_providers, cluster.initial_master_nodes中至少设置一项。

仔细看了官网文档:discovery.seed_hosts 设置成默认值即可。

discovery.seed_hosts: ["127.0.0.1", "[::1]"]

Centos 7安装   Elasticsearch  Kibana

 
服务器:阿里云ECS
操作系统:Centos 7.0 64bit,安装用户:root
Elasticsearch:7.8.2
Kibana:7.8.2
官网:https://www.elastic.co/
GitHub:https://www.elastic.co/
安装ES
RPM安装
下载最新版本RPM,下载地址:https://www.elastic.co/cn/downloads/past-releases#elasticsearch

执行安装命令

rpm -ivh elasticsearch-7.8.2-x86_64.rpm
设置开机启动,并启动ES服务

systemctl daemon-reload
systemctl enable elasticsearch.service
systemctl restart elasticsearch.service
验证启动结果

curl -X GET http://localhost:9200/
看到如下内容

{
  "name" : "iZuf657r4ko787z28jy8lmZ",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "kQnbwr6mS6iG2lfNiwrH4w",
  "version" : {
    "number" : "7.8.2",
    "build_flavor" : "default",
    "build_type" : "rpm",
    "build_hash" : "ef48eb35cf30adf4db14086e8aabd07ef6fb113f",
    "build_date" : "2020-03-26T06:34:37.794943Z",
    "build_snapshot" : false,
    "lucene_version" : "8.4.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}
设置允许远程访问
修改ES的配置文件,不限制访问地址,允许远程访问,运行命令

vi /etc/elasticsearch/elasticsearch.yml
# 找到network修改为如下
network.host: 0.0.0.0
discovery.seed_hosts: ["::1"]
 
安装kibana
yum安装
# yum安装
rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
vi /etc/yum.repos.d/kibana.repo
# 添加如下内容
[kibana-7.x]
name=Kibana repository for 7.x packages
baseurl=https://artifacts.elastic.co/packages/7.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md

# 安装
sudo yum install kibana

# 设置开机启动
systemctl enable kibana.service

# 启动
systemctl start kibana.service
设置允许远程访问
# 编辑配置文件
vi /etc/kibana/kibana.yml
# 修改如下内容
server.host: "0.0.0.0"
访问kibana
如果安装顺利,访问 http://47.101.220.158:5601 可以看到kibana欢迎界面

猜你喜欢

转载自blog.csdn.net/oqzuser12345678999q/article/details/107174109