Elasticsearch 7.4.2 安装配置

Posted max27149

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Elasticsearch 7.4.2 安装配置相关的知识,希望对你有一定的参考价值。

es配置文件修改

[root@manager ~]# vim /etc/elasticsearch/jvm.options
# Xms represents the initial size of total heap space
# Xmx represents the maximum size of total heap space
-Xms2g
-Xmx2g
[root@manager ~]# grep '^[^#]' /etc/elasticsearch/elasticsearch.yml
cluster.name: test-es
node.name: manager
node.attr.rack: r1
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
bootstrap.memory_lock: true    #官方文档建议为true
network.host: 192.168.50.65
http.port: 9200
discovery.seed_hosts: ["127.0.0.1"]
cluster.initial_master_nodes: ["manager"]
gateway.recover_after_nodes: 3
action.destructive_requires_name: true
[root@manager ~]# systemctl edit elasticsearch
[Service]
LimitMEMLOCK=infinity
[root@manager ~]# systemctl daemon-reload

系统参数修改

[root@manager ~]# sysctl -p
vm.max_map_count=262144

[root@manager ~]# cat /etc/security/limits.d/20-nproc.conf
*          soft    nproc     4096
root       soft    nproc     unlimited

[root@manager ~]# cat /etc/security/limits.conf
* soft nofile 65536
* hard nofile 65536
* soft nproc 2048
* hard nproc 4096

启动ES

[root@manager ~]# systemctl start elasticsearch.service

[root@manager ~]# jps  # 专门查看Java程序的ps,比直接用ps去查PID要方便一点
3292 Jps
25756 Elasticsearch

浏览器访问 http://192.168.50.65:9200/
或者curl

[root@manager ~]# curl http://192.168.50.65:9200/
{
  "name" : "manager",
  "cluster_name" : "test-es",
  "cluster_uuid" : "S8pmWc10SfKXZZxmxbN2Qg",
  "version" : {
    "number" : "7.4.2",
    "build_flavor" : "default",
    "build_type" : "rpm",
    "build_hash" : "2f90bbf7b93631e52bafb59b3b049cb44ec25e96",
    "build_date" : "2019-10-28T20:40:44.881551Z",
    "build_snapshot" : false,
    "lucene_version" : "8.2.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

基础知识参考
http://www.linuxe.cn/post-295.html
https://www.elastic.co/guide/en/elasticsearch/reference/7.4/heap-size.html

以上是关于Elasticsearch 7.4.2 安装配置的主要内容,如果未能解决你的问题,请参考以下文章

ElasticSearch集群的搭建

7.Kong入门与实战 基于Nginx和OpenResty的云原生微服务网关 --- 日志收集与分析

centos 7.5 安装ELK elasticsearch-7.6.2单点服务器+logstash+filebeat+kibana7.6.2安装设置

Elasticsearch各版本的MSI安装包和Kibana各版本的zip包(Windows)

es7.4安装

ElasticSearch的API使用