启动kibana时报错信息如下:
[qingtao@0531 bin]$ ./kibana
log [07:12:03.521] [fatal][root] { ValidationError: child "elasticsearch" fails because [child "hosts" fails because ["hosts" at position 0 fails because ["0" must be a valid uri with a scheme matching the http|https pattern], "hosts" at position 1 fails because ["1" must be a valid uri with a scheme matching the http|https pattern], "hosts" at position 2 fails because ["2" must be a valid uri with a scheme matching the http|https pattern]]]
at Object.exports.process (/midware/kibana-6.8.0-linux-x86_64/node_modules/joi/lib/errors.js:196:19)
at internals.Object._validateWithOptions (/midware/kibana-6.8.0-linux-x86_64/node_modules/joi/lib/types/any/index.js:675:31)
at module.exports.internals.Any.root.validate (/midware/kibana-6.8.0-linux-x86_64/node_modules/joi/lib/index.js:146:23)
at Config._commit (/midware/kibana-6.8.0-linux-x86_64/src/server/config/config.js:139:35)
at Config.set (/midware/kibana-6.8.0-linux-x86_64/src/server/config/config.js:108:10)
at Config.extendSchema (/midware/kibana-6.8.0-linux-x86_64/src/server/config/config.js:81:10)
at extendConfigService (/midware/kibana-6.8.0-linux-x86_64/src/plugin_discovery/plugin_config/extend_config_service.js:45:10) name: 'ValidationError' }
FATAL ValidationError: child "elasticsearch" fails because [child "hosts" fails because ["hosts" at position 0 fails because ["0" must be a valid uri with a scheme matching the http|https pattern], "hosts" at position 1 fails because ["1" must be a valid uri with a scheme matching the http|https pattern], "hosts" at position 2 fails because ["2" must be a valid uri with a scheme matching the http|https pattern]]]
可以发现报错信息中有这么一句话:
["0" must be a valid uri with a scheme matching the http|https pattern]
需要在配置文件 kibana.yml中添加协议类型 http/https
elasticsearch.hosts: ["http://10.211.16.161:9300", "http://10.211.16.162:9300","http://10.211.16.163:9300"]
主要问题是我配置的端口号不对,它通过http协议找不到
我在改正错误之前配置的是9300端口,9300是集群通信端口,应该配置9200端口
elasticsearch.hosts: ["http://10.211.16.161:9200", "http://10.211.16.162:9200","http://10.211.16.163:9200"]