很是容易搭建,在我的电脑上便可进行搭建学习html
:tumbler_glass: 图中几个节点的名称和含义java
master node:维护元数据,管理集群各个节点的状态node
coordinate node:协调节点,搜索的数据存储于不一样的data node上时进行处理linux
data node:负责数据的查询和导入shell
hot node:热数据节点,保留短期内的热数据,超过期间进行迁移到冷节点json
warm node:冷数据节点,处理只读索引而且不是常常访问的数据bootstrap
ml node:(TODO:考察多个文档,暂未发现该节点做用,后续补充)windows
注:centos
- 可一次性将windows和linux的同时下载,在本身电脑上用windows操做,服务器上用linux
- es全家桶要求各个版本一致,为方便起见,同时下载Elasticsearch,Kibana,Beats,Logstash,下载地址www.elastic.co/cn/download…
elasticsearch-7.2.0\bin
下,双击 elasticsearch.bat
环境:浏览器
centos7
jdk8
[root@node2 download]# tar zxvf elasticsearch-7.3.1-linux-x86_64.tar.gz
[root@node2 download]# mv elasticsearch-7.3.1 /home/elasticsearch-7.3.1
# 注意:es不能使用root用户启动,以前我已经建立过esuser用户了,故修改用户组便可,建议建立新用户
[root@node2 home]# chown -R esuser:esuser /home/elasticsearch-7.3.1
[root@node2 home]# su esuser
[esuser@node2 home]$ cd /home/elasticsearch-7.3.1/
[esuser@node2 elasticsearch-7.3.1]$ bin/elasticsearch
复制代码
若是没法访问9200,请移步本章节的 相关问题-linux出现的问题
linux环境下经过curl查看
{
"name": "DESKTOP-1AMTS94",
"cluster_name": "elasticsearch",
"cluster_uuid": "8KXlt8BSRBmB4GikyjYq0A",
"version": {
"number": "7.2.0",
"build_flavor": "default",
"build_type": "zip",
"build_hash": "508c38a",
"build_date": "2019-06-20T15:54:18.811730Z",
"build_snapshot": false,
"lucene_version": "8.0.0",
"minimum_wire_compatibility_version": "6.8.0",
"minimum_index_compatibility_version": "6.0.0-beta1"
},
"tagline": "You Know, for Search"
}
复制代码
# 安装插件
bin/elasticsearch-plugin install analysis-icu
# 查看插件
bin/elasticsearch-plugin list
# 浏览器查看
http://localhost:9200/_cat/plugins
# 显示结果DESKTOP-1AMTS94 analysis-icu 7.2.0
复制代码
目录 | 配置文件 | 描述 |
---|---|---|
bin | 脚本文件,包括启动elasticsearch,安装插件,运行统计数据等 | |
config | elasticsearch.yml | 集群配置文件,user,role based相关配置 |
JDK | java运行环境 | |
data | path.data | 数据文件 |
lib | java类库 | |
modules | 日志文件 | |
plugins | 包含全部已经安装的插件 | |
logs | path.log | 日志文件 |
# 启动单节点
bin/elasticsearch -E node.name=node0 -E cluster.name=esFirst -E path.data=node0_data
# 运行多实例方法
#linux
bin/elasticsearch -E node.name=node0 -E cluster.name=esFirst -E path.data=node0_data
bin/elasticsearch -E node.name=node1 -E cluster.name=esFirst -E path.data=node1_data
bin/elasticsearch -E node.name=node2 -E cluster.name=esFirst -E path.data=node2_data
bin/elasticsearch -E node.name=node3 -E cluster.name=esFirst -E path.data=node3_data
# windows
.\bin\elasticsearch.bat -E node.name=node0 -E cluster.name=esFirst -E path.data=node0_data
.\bin\elasticsearch.bat -E node.name=node1 -E cluster.name=esFirst -E path.data=node1_data
.\bin\elasticsearch.bat -E node.name=node2 -E cluster.name=esFirst -E path.data=node2_data
.\bin\elasticsearch.bat -E node.name=node3 -E cluster.name=esFirst -E path.data=node3_data
# 删除进程
ps|grep elastcsearch
kill pid
# 查看集群
GET http://localhost:9200
#查看nodes
GET _cat/nodes
GET _cluster/health
复制代码
seccomp unavailable 错误 解决方法:elasticsearch.yml 配置 bootstrap.memory_lock: false
bootstrap.system_call_filter: false
max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536] 解决方法:修改 /etc/security/limits.conf,配置: hard nofile 80000
soft nofile 80000
ps:本地测试,修改了limits后,须要重启系统
max virtual memory areas vm.max_map_count [65530] is too low 解决方法:修改 /etc/sysctl.conf,添加 : vm.max_map_count = 262144
而后 sysctl -p 生效
the default discovery settings are unsuitable...., last least one of [....] must be configured 解决方法:elasticsearch.yml 开启配置: node.name: node-1
cluster.initial_master_nodes: ["node-1"]
localhost能够链接,固定IP没法访问
解决方法:elasticsearch.yml 开启配置
network.host: 0.0.0.0