安装kibana7.5.2报错Unable to connect to Elasticsearch.

系统是:ubuntu 16.04
elasticsearch版本:7.5.2
kibana版本:7.5.2
这两个安装包都是下载tar.gz包解压安装的
两个节点(我也知道最好三个。。可是目前机器就只有两个)
elasticsearch集群可以正常启动,遇到标题的错查了一下百度说加以下配置,可是我本来就加了:

network.host: 0.0.0.0
http.port: 9200

Kibana的kibana.yml我也是设置

server.host: "0.0.0.0"

设置好之后直接到bin目录./Kibana启动,然后发现连接不上显示以下错误:
报错

文字版:
 log   [10:16:11.107] [warning][licensing][plugins] License information could not be obtained from Elasticsearch for the [data] cluster. TypeError: Cannot use 'in' operator to search for 'type' in null
  log   [10:16:13.761] [warning][migrations] Unable to connect to Elasticsearch. Error: [cluster_block_exception] index [.kibana_task_manager_1] blocked by: [SERVICE_UNAVAILABLE/1/state not recovered / initialized];
  log   [10:16:13.762] [warning][migrations] Unable to connect to Elasticsearch. Error: [cluster_block_exception] index [.kibana_1] blocked by: [SERVICE_UNAVAILABLE/1/state not recovered / initialized];
  log   [10:16:41.112] [warning][licensing][plugins] License information could not be obtained from Elasticsearch for the [data] cluster. TypeError: Cannot use 'in' operator to search for 'type' in null
  log   [10:17:11.114] [warning][licensing][plugins] License information could not be obtained from Elasticsearch for the [data] cluster. TypeError: Cannot use 'in' operator to search for 'type' in null
  log   [10:17:41.117] [warning][licensing][plugins] License information could not be obtained from Elasticsearch for the [data] cluster. TypeError: Cannot use 'in' operator to search for 'type' in null
  log   [10:18:11.121] [warning][licensing][plugins] License information could not be obtained from Elasticsearch for the [data] cluster. TypeError: Cannot use 'in' operator to search for 'type' in null
  log   [10:18:41.123] [warning][licensing][plugins] License information could not be obtained from Elasticsearch for the [data] cluster. TypeError: Cannot use 'in' operator to search for 'type' in null
  log   [10:19:11.126] [warning][licensing][plugins] License information could not be obtained from Elasticsearch for the [data] cluster. TypeError: Cannot use 'in' operator to search for 'type' in null
  log   [10:19:41.129] [warning][licensing][plugins] License information could not be obtained from Elasticsearch for the [data] cluster. TypeError: Cannot use 'in' operator to search for 'type' in null

两个连接不上的错误,然后再循环显示下面的警告。
从这个报错的信息里面可以了解到的是,当启动Kibana的时候,创建kibana_task_manager_1kibana_1这两个默认索引的时候报错,连接不上elasticsearch。。。
百度大多的解释都是说接不上一般都是IP不对,端口错了,或者端口没打开,先检查这几样总是没错的,但是配置文件我检查了好多遍都没有错,使用以下命令可以检查端口是否打开(我开了防火墙)

ufw status
# 想打开端口就
ufw allow 端口号

度娘回答不了我。。所以我就去找某g哥了。。。
然后某g哥说(具体链接忘记复制了):

# 改一下elasticsearch的以下配置
discovery.zen.minimum_master_nodes: 1 #最多的主节点个数
gateway.recover_after_nodes: 1 #超时后生效的节点数

改了以后。。就启动成功了,至于为什么。。我也搞不懂。。如果有大神知道为啥,希望可以在评论区指导一下。。到时候如果需要扩充节点,这个配置也是需要改的(目前一共只有两个节点)。
elasticsearch中文社区上的那个问题也是我发的。

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值