系统是: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_1和kibana_1这两个默认索引的时候报错,连接不上elasticsearch。。。
百度大多的解释都是说接不上一般都是IP不对,端口错了,或者端口没打开,先检查这几样总是没错的,但是配置文件我检查了好多遍都没有错,使用以下命令可以检查端口是否打开(我开了防火墙)
ufw status
# 想打开端口就
ufw allow 端口号
度娘回答不了我。。所以我就去找某g哥了。。。
然后某g哥说(具体链接忘记复制了):
# 改一下elasticsearch的以下配置
discovery.zen.minimum_master_nodes: 1 #最多的主节点个数
gateway.recover_after_nodes: 1 #超时后生效的节点数
改了以后。。就启动成功了,至于为什么。。我也搞不懂。。如果有大神知道为啥,希望可以在评论区指导一下。。到时候如果需要扩充节点,这个配置也是需要改的(目前一共只有两个节点)。
elasticsearch中文社区上的那个问题也是我发的。