环境centos7,目前项目需要用到分布式,Elasticsearch直接做单机版,需要配置副本分片为0,让它不要去同步即可,不然状态会变成yellow,正常是green。
Elasticsearch
安装环境:yum install java-1.8.0-openjdk* -y
下载:wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.8.4.tar.gz
解压:tar -zxvf ./elasticsearch-6.8.4.tar.gz
root下不能跑,添加用户:useradd elasticsearch
设置目录所属:chown -R elasticsearch.elasticsearch ./elasticsearch-6.8.4
切换用户:su elasticsearch
启动:./bin/elasticsearch -d
停止:./bin/elasticsearch stop
配置文件:config/elasticsearch.yml
network.host: 127.0.0.1
http.port: 9200
kibana官网
https://www.elastic.co/cn/downloads/past-releases/kibana-6-8-23
下载:wget https://artifacts.elastic.co/downloads/kibana/kibana-6.8.23-linux-x86_64.tar.gz
解压:tar -zxvf kibana-6.8.23-linux-x86_64.tar.gz
root下不能跑,添加用户:useradd kibana
设置目录所属: chown -R kibana.kibana ./kibana-6.8.23-linux-x86_64
切换用户:su kibana
启动:./bin/kibana
配置文件:config/kibana.yml
server.port: 9800
server.host: “172.27.126.154”
elasticsearch.hosts: [“http://127.0.0.1:9200”]
kibana.index: “.kibana”
i18n.locale: “zh-CN”
Kibana报错:版本对应不上
FATAL ProductNotSupportedError: The client noticed that the server is not Elasticsearch and we do not support this unknown product.
Unable to retrieve version information from Elasticsearch nodes
修改elasticsearch配置
PUT /index/_settings
{
“number_of_replicas”: 0
}
{
“acknowledged” : true
}
查看elasticsearch状态,正常status为green
GET _cluster/health