ES安装、注意点(Elasticsearch 7.3.2)

ES安装、注意点(Elasticsearch 7.3.2)

时间:2019年10月22日
系统:CentOS 7.2
JDK安装
1.8
下载安装包
网页地址:https://www.elastic.co/cn/downloads/elasticsearch
下载地址:https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.3.2-linux-x86_64.tar.gz
cd /usr/local/es

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.3.2-linux-x86_64.tar.gz

tar -zxvf elasticsearch-7.3.2-linux-x86_64.tar.gz
TIPS:
1. 官方地址下载比较慢
使用elastic用户管理
#建立用户
useradd elsearch
#目录受权
chown -R elsearch:elsearch /usr/local/es
#切换用户
su elsearch
配置
cd /usr/local/es/elasticsearch-7.3.2
vim config/elasticsearch.yml
#支持远程访问
network.host: 192.168.1.92

#配置须要发现的初始节点列表
discovery.seed_hosts: ["192.168.1.92"]

#设置节点名称
node.name: master

#设置主节点列表
cluster.initial_master_nodes: ["master"]
启动和中止
cd /usr/local/es/elasticsearch-7.3.2
#启动
./bin/elasticsearch
#守护进程启动
./bin/elasticsearch -d

#其余启动方式【未验证】
./bin/elasticsearch -Xms512m -Xmx512m
#中止集群【未验证】
curl -X POST http://主机IP:9200/_cluster/nodes/节点标识符(如es-node1)/_shutdown
#检查服务是否启动
curl http://127.0.0.1:9200
curl http://192.168.1.92:9200

{
  "name" : "da3f6f7a9b00",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "o_KisXPYS26kfhcLhaPldg",
  "version" : {
    "number" : "7.3.2",
    "build_flavor" : "default",
    "build_type" : "tar",
    "build_hash" : "1c1faf1",
    "build_date" : "2019-09-06T14:40:30.409026Z",
    "build_snapshot" : false,
    "lucene_version" : "8.1.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}
注意点
  1. 系统条件不知足
ERROR: [1] bootstrap checks failed
[1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
#切换到root用户修改配置sysctl.conf
vim /etc/sysctl.conf

#添加配置
vm.max_map_count=262144

#应用
sysctl -p
  1. 添加配置network.host: 192.168.1.92后启动报错
ERROR: [1] bootstrap checks failed
[1]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers,cluster.initial_master_nodes] must be configured
【分析】:须要至少配置一项[discovery.seed_hosts, discovery.seed_providers,cluster.initial_master_nodes]

【解决方案】添加配置:discovery.seed_hosts: ["192.168.1.92"]
  1. 待续
HEAD插件安装
见同目录文档:==ES-HEAD插件安装.md==
IK分词器安装
见同目录文档:==ES-IK中文分词器安装.md==
Kibana安装
见同目录文档:==ES-Kibana安装.md==
相关文章
相关标签/搜索